3from enum
import IntEnum
9 Superclass has to be IntEnum, as I use this one within Jinja2 templates
10 where I struggled to compare against enum variants. I however can always
11 compare against integers.
29 if association==DoFAssociation.Vertex:
30 result +=
"VertexData"
31 elif association==DoFAssociation.Cell:
33 elif association==DoFAssociation.Face:
35 elif association==DoFAssociation.Global:
36 result +=
"GlobalData"
44 if association==DoFAssociation.Vertex:
46 elif association==DoFAssociation.Cell:
48 elif association==DoFAssociation.Face:
50 elif association==DoFAssociation.Global:
60 Both the association and the namespace are not to be set directly,
61 but through the operation configure().
63 ## Additional store/load/send/receive arguments
65 - The first entry of this triple is the expression that you want the
67 - The second one is the C++ type of this expression.
68 - The third one is the name that you wanna use in the dof signatures
71 It is the responsibility of the DoF subclass to ensure that the second
72 entry is properly used to initialise the store and load routines.
73 Most define an additional setter for property.
78 association: DoFAssociation
81 Has to be a fit to the C++ naming conventions
84 Sequence of namespaces.
86 additional_load_and_store_arguments: [(String,String,String)]
87 This flag is, by default, an empty list. If you add an entry to this
88 list, each store and load routine will get an additional parameter.
89 Consult documentation above for the semantics of the list entries.
99 def configure(self,namespace,association, subdirectory=""):
101 Typically called by model as soon as you add an object to it
120 What should the data type be called within the data repository,
121 or within action sets. We add a prefix name here.
128 What should the data type be called within the data repository.
132 result +=
"peano4::datamanagement::VertexEnumerator<"
134 result +=
"peano4::datamanagement::FaceEnumerator<"
136 assert False,
"association was {}".format( self.
association )
150 use_dof_association = None
154 You can make Peano's store and load arguments of any DoF depend on other
155 DoFs that you have loaded before. So you can load X and then make Y later
156 on depend on the state of X. For this, you have to add a tuple to
157 Y's additional_load_and_store_arguments. It is a very technical tuple.
158 This routine helps you to construct it for X.
160 use_dof_association: DoFAssociation
161 Set this one to None and the routine will pick up self._association.
162 However, there are cases where we want to construct the string and
163 the association is not yet set properly. In this case, you have to
164 supplement the information manually.
167 if use_dof_association==
None:
170 stack_access_string =
"repositories::DataRepository::_{}Stack.getForPush( repositories::DataRepository::DataKey(_spacetreeId,peano4::grid::PeanoCurve::CallStack))->top()".format(
174 data_type =
"{}::{}".format(
179 return (stack_access_string,data_type,argument_name)
Superclass has to be IntEnum, as I use this one within Jinja2 templates where I struggled to compare ...
additional_load_and_store_arguments(self)
get_full_qualified_type(self)
additional_load_and_store_arguments_for_other_dof(self, argument_name, use_dof_association=None)
You can make Peano's store and load arguments of any DoF depend on other DoFs that you have loaded be...
__init__(self, name)
Both the association and the namespace are not to be set directly, but through the operation configur...
_additional_load_and_store_arguments
get_logical_type_name(self)
What should the data type be called within the data repository, or within action sets.
get_enumeration_type(self)
What should the data type be called within the data repository.
configure(self, namespace, association, subdirectory="")
Typically called by model as soon as you add an object to it.
get_subnamespace_for_association(association)
get_logical_type_name_for_association(association, name)