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:
64 The action set that Peano will generate that corresponds to this class
65 should not be modified by users and can safely be overwritten every time
66 we run the Python toolkit.
74 We need the solver repository in this action set, as we directly access
75 the solver object. We also need access to Peano's d-dimensional loops.
79#include "repositories/SolverRepository.h"
80#include "peano4/utils/Loop.h"
81#include "mghype/matrixfree/solvers/CGMultigrid.h"
87 Configure name of generated C++ action set
89 This action set will end up in the directory observers with a name that
90 reflects how the observer (initialisation) is mapped onto this action
91 set. The name pattern is ObserverName2ActionSetIdentifier where this
92 routine co-determines the ActionSetIdentifier. We make is reflect the
96 return __name__.replace(
".py",
"").replace(
".",
"_")
Action set (reactions to events)
This also should be called before the solver stuff.
get_action_set_name(self)
Configure name of generated C++ action set.
str templateTouchVertexFirstTime
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=False)
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...