12Initialise degrees of freedom associated with cells
15 TemplateInitCell =
"""
16 if ( fineGridCell{{SOLVER_NAME}}PETScData.getType() == celldata::{{SOLVER_NAME}}PETScData::Type::Interior ) {
18 dfor( k, {{POLYNOMIAL_DEGREE+1}} ) {
19 {% if CELL_UNKNOWNS>1 %}
22 double value, rhs, exactSol;
23 tarch::la::Vector<Dimensions,double> x = marker.getOffset();
24 for (int d=0; d<Dimensions; d++) {
25 x(d) += repositories::{{SOLVER_INSTANCE}}.QuadraturePointsInUnitInterval[ k(d) ] * marker.h()(d);
27 repositories::{{SOLVER_INSTANCE}}.initNode(
34 fineGridCell{{SOLVER_NAME}}.setValue(dof,value);
35 fineGridCell{{SOLVER_NAME}}.setRhs(dof,rhs);
36 fineGridCell{{SOLVER_NAME}}.setExactSol(dof,exactSol);
47Initialise vertex-associated degrees of freedom
49The initialisation requires a solver object, as we have to know what C++
50object this solver will produce.
52solver: petsc.solvers.CollocatedLowOrderDiscretisation or similar solver where
53 degrees of freedom are assigned exclusively to the vertices.
56 super( InitCellDoFs, self ).
__init__()
58 self.
d[
"SOLVER_INSTANCE"] = solver.instance_name()
59 self.
d[
"SOLVER_NAME"] = solver.typename()
60 self.
d[
"CELL_UNKNOWNS"] = solver.cell_unknowns
61 self.
d[
"POLYNOMIAL_DEGREE"] = solver.polynomial_degree
67Provide C++ code snippet for peano4.solversteps.ActionSet.OPERATION_TOUCH_VERTEX_FIRST_TIME
69Only touchVertexFirstTime is an event where this action set actually
70does something: It inserts the template TemplateInitVertex and
71replaces it with entries from the dictionary. The latter is befilled
76 if operation_name==peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
85 Configure name of generated C++ action set
87 This action set will end up in the directory observers with a name that
88 reflects how the observer (initialisation) is mapped onto this action
89 set. The name pattern is ObserverName2ActionSetIdentifier where this
90 routine co-determines the ActionSetIdentifier. We make is reflect the
94 return __name__.replace(
".py",
"").replace(
".",
"_")
100 The action set that Peano will generate that corresponds to this class
101 should not be modified by users and can safely be overwritten every time
102 we run the Python toolkit.
111 We need the solver repository in this action set, as we directly access
112 the solver object. We also need access to Peano's d-dimensional loops.
116#include "../repositories/SolverRepository.h"
117#include "peano4/utils/Loop.h"
Initialise degrees of freedom associated with cells.
get_includes(self)
We need the solver repository in this action set, as we directly access the solver object.
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.
__init__(self, solver)
Initialise vertex-associated degrees of freedom.
get_body_of_operation(self, operation_name)
Provide C++ code snippet for peano4.solversteps.ActionSet.OPERATION_TOUCH_VERTEX_FIRST_TIME
Action set (reactions to events)