12 @todo There's documentation missing
16 templateTouchCellFirstTime=
"""
18 all we need to do here is project updated solution u^c onto the faces
22 fineGridCell{{SOLVER_NAME}}.getType() != celldata::{{SOLVER_NAME}}::Type::Coarse
24 repositories::{{SOLVER_INSTANCE}}.projectOntoFaces()
26 // apply cell to face projection, store it in faceProjections
27 // no tricky indexing needed here, since the whole of the cell
28 // solution vector is in scope here.
29 tarch::la::Vector< repositories::{{SOLVER_INSTANCE}}.FaceUnknownsProjection * TwoTimesD, double > faceProjections =
30 repositories::{{SOLVER_INSTANCE}}. applyFaceFromCellMatrix(
33 fineGridCell{{SOLVER_NAME}}.getSolution()
36 logTraceInWith3Arguments("ProjectOntoFace", marker.toString(), faceProjections, fineGridCell{{SOLVER_NAME}}.getSolution());
38 // first D faces - only care about right-side projection
39 for (int f=0; f<Dimensions; f++) {
40 // the projection vector should be twice as long as the number of solutions, so jump
41 // ahead by this number. NOTE THAT THIS CODE CAN BE REFACTORED TO REMOVE THE REDUNDANCY NOW
42 const int offset = repositories::{{SOLVER_INSTANCE}}.FaceUnknownsSolution;
44 for (int p=0; p<repositories::{{SOLVER_INSTANCE}}.NodesPerFace * repositories::{{SOLVER_INSTANCE}}.ProjectionsPerFaceNode; p++)
46 fineGridFaces{{SOLVER_NAME}}(f).setRProjection(
48 faceProjections( f*repositories::{{SOLVER_INSTANCE}}.FaceUnknownsProjection + p + offset )
54 // second D faces - left side this time
55 for (int f=Dimensions; f<TwoTimesD; f++) {
56 for (int p=0; p<repositories::{{SOLVER_INSTANCE}}.NodesPerFace * repositories::{{SOLVER_INSTANCE}}.ProjectionsPerFaceNode; p++)
58 fineGridFaces{{SOLVER_NAME}}(f).setLProjection(
60 faceProjections( f*repositories::{{SOLVER_INSTANCE}}.FaceUnknownsProjection + p )
66 logTraceOut("ProjectOntoFace");
73 descend_invocation_order=0,
75 super( ProjectOntoFaces, self ).
__init__(
76 descend_invocation_order,
80 self.
d[
"SOLVER_INSTANCE"] = solver.instance_name()
81 self.
d[
"SOLVER_NAME"] = solver.typename()
85 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
93 Configure name of generated C++ action set
95 This action set will end up in the directory observers with a name that
96 reflects how the observer (initialisation) is mapped onto this action
97 set. The name pattern is ObserverName2ActionSetIdentifier where this
98 routine co-determines the ActionSetIdentifier. We make is reflect the
102 return __name__.replace(
".py",
"").replace(
".",
"_") +
"_ProjectOntoFaces"
107 The action set that Peano will generate that corresponds to this class
108 should not be modified by users and can safely be overwritten every time
109 we run the Python toolkit.
117 We need the solver repository in this action set, as we directly access
118 the solver object. We also need access to Peano's d-dimensional loops.
122#include "../repositories/SolverRepository.h"
123#include "peano4/utils/Loop.h"
Action set (reactions to events)
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
user_should_modify_template(self)
The action set that Peano will generate that corresponds to this class should not be modified by user...
get_action_set_name(self)
Configure name of generated C++ action set.
str templateTouchCellFirstTime
get_includes(self)
We need the solver repository in this action set, as we directly access the solver object.
__init__(self, solver, descend_invocation_order=0, parallel=True)