9 This also should be called before the solver stuff
11 templateTouchVertexFirstTime=
"""
13 repositories::{{SOLVER_INSTANCE}}.prolongate()
15 fineGridVertex{{SOLVER_NAME}}.getLevel() == repositories::{{SOLVER_INSTANCE}}.getActiveLevel() - 1
17 logTraceInWith1Argument("prolongate::setDelta", fineGridVertex{{SOLVER_NAME}}.toString());
18 for (int i=0; i<{{VERTEX_CARDINALITY}}; i++)
19 fineGridVertex{{SOLVER_NAME}}.setDelta(
21 fineGridVertex{{SOLVER_NAME}}.getU(i) - fineGridVertex{{SOLVER_NAME}}.getOldU(i)
23 logTraceOutWith1Argument("prolongate::setDelta", fineGridVertex{{SOLVER_NAME}}.toString());
27 repositories::{{SOLVER_INSTANCE}}.prolongate()
29 fineGridVertex{{SOLVER_NAME}}.getLevel() == repositories::{{SOLVER_INSTANCE}}.getActiveLevel()
31 // do some real prolongation...
32 mghype::matrixfree::solvers::cgmultigrid::prolongate<{{SOLVER_NAME}}>(
33 repositories::{{SOLVER_INSTANCE}}.getProlongationMatrix(marker.x(), marker.h()),
34 coarseGridVertices{{SOLVER_NAME}},
35 fineGridVertex{{SOLVER_NAME}},
43 descend_invocation_order=0,
45 super( Prolongation, self ).
__init__(
46 descend_invocation_order,
50 self.
d[
"SOLVER_INSTANCE"] = solver.instance_name()
51 self.
d[
"SOLVER_NAME"] = solver.typename()
52 self.
d[
"VERTEX_CARDINALITY"] = solver._unknowns_per_vertex_node
56 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_VERTEX_FIRST_TIME:
67 The action set that Peano will generate that corresponds to this class
68 should not be modified by users and can safely be overwritten every time
69 we run the Python toolkit.
77 We need the solver repository in this action set, as we directly access
78 the solver object. We also need access to Peano's d-dimensional loops.
82#include "repositories/SolverRepository.h"
83#include "peano4/utils/Loop.h"
84#include "mghype/matrixfree/solvers/CGMultigrid.h"
90 Configure name of generated C++ action set
92 This action set will end up in the directory observers with a name that
93 reflects how the observer (initialisation) is mapped onto this action
94 set. The name pattern is ObserverName2ActionSetIdentifier where this
95 routine co-determines the ActionSetIdentifier. We make is reflect the
99 return __name__.replace(
".py",
"").replace(
".",
"_") +
"_Prolongation"
This also should be called before the solver stuff.
str templateTouchVertexFirstTime
get_includes(self)
We need the solver repository in this action set, as we directly access the solver object.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_action_set_name(self)
Configure name of generated C++ action set.
__init__(self, solver, descend_invocation_order=0, parallel=False)
user_should_modify_template(self)
The action set that Peano will generate that corresponds to this class should not be modified by user...
Action set (reactions to events)