12 @todo Documntation missing
15 templateTouchCellFirstTime=
"""
17 fineGridCell{{SOLVER_NAME}}.getType() != celldata::{{SOLVER_NAME}}::Type::Coarse
19 // only one condition here - ensures that we don't do this when restricting the residual
20 repositories::{{SOLVER_INSTANCE}}.updateResidual()
22 logTraceInWith4Arguments("updateResidual",
23 fineGridCell{{SOLVER_NAME}}.getSolution(),
24 fineGridCell{{SOLVER_NAME}}.getRhs(),
26 repositories::{{SOLVER_INSTANCE}}.getMassMatrix( marker.x(), marker.h() )
29 // write Mb into it, i.e. mass matrix * rhs
30 tarch::la::Vector< repositories::{{SOLVER_INSTANCE}}.CellUnknowns, double > r =
31 repositories::{{SOLVER_INSTANCE}}.getMassMatrix( marker.x(), marker.h() ) * fineGridCell{{SOLVER_NAME}}.getRhs();
33 // also subtract A^cc u^c
34 r = r - repositories::{{SOLVER_INSTANCE}}.getLocalAssemblyMatrix(marker.x(), marker.h()) * fineGridCell{{SOLVER_NAME}}.getSolution();
36 fineGridCell{{SOLVER_NAME}}.setResidual( r );
38 logTraceOut("updateResidual");
45 descend_invocation_order=0,
47 super( UpdateResidual, self ).
__init__(
48 descend_invocation_order,
52 self.
d[
"SOLVER_INSTANCE"] = solver.instance_name()
53 self.
d[
"SOLVER_NAME"] = solver.typename()
57 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
65 Configure name of generated C++ action set
67 This action set will end up in the directory observers with a name that
68 reflects how the observer (initialisation) is mapped onto this action
69 set. The name pattern is ObserverName2ActionSetIdentifier where this
70 routine co-determines the ActionSetIdentifier. We make is reflect the
74 return __name__.replace(
".py",
"").replace(
".",
"_") +
"_UpdateResidual"
79 The action set that Peano will generate that corresponds to this class
80 should not be modified by users and can safely be overwritten every time
81 we run the Python toolkit.
89 We need the solver repository in this action set, as we directly access
90 the solver object. We also need access to Peano's d-dimensional loops.
94#include "../repositories/SolverRepository.h"
95#include "peano4/utils/Loop.h"
__init__(self, solver, descend_invocation_order=0, parallel=True)
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_includes(self)
We need the solver repository in this action set, as we directly access the solver object.
get_action_set_name(self)
Configure name of generated C++ action set.
str templateTouchCellFirstTime
Action set (reactions to events)