|
Peano
|
Base class for any degree of freedom object. More...


Public Member Functions | |
| __init__ (self, name) | |
| Create a degree of freedom object. | |
| configure (self, namespace, association, subdirectory="", temporary_subdirectory="") | |
| Typically called by model as soon as you add an object to it. | |
| get_full_qualified_type (self) | |
| 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. | |
| additional_load_and_store_arguments (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 before. | |
| subnamespace (self) | |
Data Fields | |
| association = DoFAssociation.Undef | |
| name = name | |
| list | namespace = [] |
| grid_selector = None | |
| subdirectory = subdirectory | |
| temporary_subdirectory = temporary_subdirectory | |
Protected Attributes | |
| list | _additional_load_and_store_arguments = [] |
Base class for any degree of freedom object.
Any degree of freedom object in Peano is derived from DoF. There are different subclasses of this type which are actually used in most implementations. The most popular one is peano4.api.datamodel.DaStGen2 which encodes a DoF implementation which is based upon plain C++ objects created through DaStGen2. However, there are also other data models such as bespoke patch data represented through peano4.api.datamodel.Patch.
Every DoF in Peano has a name and a unique association with a mesh entity which is held in association. There are some further properties tied to each DoF such as a position x and a mesh width h, but we leave it to subclasses to provide those guys.
Please consult the tutorials on assigning data to a mesh and masking out data storage on some instructions where this class is actually used in code.
| peano4.api.datamodel.DoF.DoF.__init__ | ( | self, | |
| name ) |
Create a degree of freedom object.
Both the association and the namespace are not to be set directly, but through the operation configure().
The third one is the name that you wanna use in the dof signatures for this argument.
It is the responsibility of the DoF subclass to ensure that the second entry is properly used to initialise the store and load routines. Most define an additional setter for property.
association: DoFAssociation
name: String Has to be a fit to the C++ naming conventions
namespace: [String] Sequence of namespaces.
additional_load_and_store_arguments: [(String,String,String)] This flag is, by default, an empty list. If you add an entry to this list, each store and load routine will get an additional parameter. Consult documentation above for the semantics of the list entries.
grid_selector: peano4.api.toolbox.GridSelector or None None by default. If set, the task graph compiler restricts the storage of this DoF to the mesh entities selected: The selector's guard is AND-combined with each of the use/load/store predicates the compiler derives (
| peano4.api.datamodel.DoF.DoF.additional_load_and_store_arguments | ( | self | ) |
Reimplemented in peano4.api.datamodel.DaStGen2.DaStGen2, peano4.api.datamodel.DaStGen2.DaStGen2, peano4.api.datamodel.Patch.Patch, and peano4.api.datamodel.Patch.Patch.
Definition at line 180 of file DoF.py.
References peano4.api.datamodel.DaStGen2.DaStGen2._additional_load_and_store_arguments, and _additional_load_and_store_arguments.
| peano4.api.datamodel.DoF.DoF.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 before.
So you can load X and then make Y later on depend on the state of X. For this, you have to add a tuple to Y's additional_load_and_store_arguments. It is a very technical tuple. This routine helps you to construct it for X.
use_dof_association: DoFAssociation Set this one to None and the routine will pick up self._association. However, there are cases where we want to construct the string and the association is not yet set properly. In this case, you have to supplement the information manually.
Definition at line 184 of file DoF.py.
References association, peano4.api.datamodel.DoF.get_logical_type_name_for_association(), peano4.api.datamodel.DoF.get_subnamespace_for_association(), convert::data::Variable.name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling.name, exagrype.api.FOSOSolver.FOSOSolver.name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling.name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling.name, exahype2.api.dslhype2.AbstractSyntaxTree.Argument.name, exahype2.api.dslhype2.AbstractSyntaxTree.Function.name, exahype2.api.dslhype2.AbstractSyntaxTree.FunctionCall.name, exahype2.api.dslhype2.Expressions.Variable.name, exahype2.api.dslhype2.Types.TFunction.name, exahype2.api.dslhype2.Types.TStruct.name, exahype2.api.PDETerm.PDETerm.name, exahype2.api.Solver.Solver.Plotter.name, exaparty.api.particle.AlgorithmStep.AlgorithmStep.name, and name.

| peano4.api.datamodel.DoF.DoF.configure | ( | self, | |
| namespace, | |||
| association, | |||
| subdirectory = "", | |||
| temporary_subdirectory = "" ) |
Typically called by model as soon as you add an object to it.
Reimplemented in peano4.api.datamodel.DaStGen2.DaStGen2.
Definition at line 135 of file DoF.py.
References association, peano4.api.datamodel.DoF.get_subnamespace_for_association(), exahype2.api.dslhype2.AbstractSyntaxTree.Function.namespace, and namespace.

| peano4.api.datamodel.DoF.DoF.get_enumeration_type | ( | self | ) |
What should the data type be called within the data repository.
Definition at line 163 of file DoF.py.
References association, and get_full_qualified_type().

| peano4.api.datamodel.DoF.DoF.get_full_qualified_type | ( | self | ) |
Definition at line 146 of file DoF.py.
References convert::data::Variable.name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling.name, exagrype.api.FOSOSolver.FOSOSolver.name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling.name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling.name, exahype2.api.dslhype2.AbstractSyntaxTree.Argument.name, exahype2.api.dslhype2.AbstractSyntaxTree.Function.name, exahype2.api.dslhype2.AbstractSyntaxTree.FunctionCall.name, exahype2.api.dslhype2.Expressions.Variable.name, exahype2.api.dslhype2.Types.TFunction.name, exahype2.api.dslhype2.Types.TStruct.name, exahype2.api.PDETerm.PDETerm.name, exahype2.api.Solver.Solver.Plotter.name, exaparty.api.particle.AlgorithmStep.AlgorithmStep.name, name, exahype2.api.dslhype2.AbstractSyntaxTree.Function.namespace, and namespace.
Referenced by get_enumeration_type().

| peano4.api.datamodel.DoF.DoF.get_logical_type_name | ( | self | ) |
What should the data type be called within the data repository, or within action sets.
We add a prefix name here.
Definition at line 155 of file DoF.py.
References association, peano4.api.datamodel.DoF.get_logical_type_name_for_association(), convert::data::Variable.name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling.name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling.name, exagrype.api.FOSOSolver.FOSOSolver.name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling.name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling.name, exahype2.api.dslhype2.AbstractSyntaxTree.Argument.name, exahype2.api.dslhype2.AbstractSyntaxTree.Function.name, exahype2.api.dslhype2.AbstractSyntaxTree.FunctionCall.name, exahype2.api.dslhype2.Expressions.Variable.name, exahype2.api.dslhype2.Types.TFunction.name, exahype2.api.dslhype2.Types.TStruct.name, exahype2.api.PDETerm.PDETerm.name, exahype2.api.Solver.Solver.Plotter.name, exaparty.api.particle.AlgorithmStep.AlgorithmStep.name, and name.

| peano4.api.datamodel.DoF.DoF.subnamespace | ( | self | ) |
Definition at line 219 of file DoF.py.
References subdirectory.
|
protected |
Definition at line 131 of file DoF.py.
Referenced by additional_load_and_store_arguments(), and peano4.api.datamodel.Patch.Patch.additional_load_and_store_arguments().
| peano4.api.datamodel.DoF.DoF.association = DoFAssociation.Undef |
Definition at line 128 of file DoF.py.
Referenced by additional_load_and_store_arguments_for_other_dof(), configure(), get_enumeration_type(), and get_logical_type_name().
| peano4.api.datamodel.DoF.DoF.name = name |
Definition at line 129 of file DoF.py.
Referenced by solvers.aderdg.kernels.Gemms.Gemms.__init__(), solvers.aderdg.kernels.Gemms.Gemms.__repr__(), test_derive_load_store_compute_flag._FakeSubmodel.__repr__(), test_propagate_use_statements._FakeSubmodel.__repr__(), exaparty.api.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.__setup_algorithm_steps(), exaparty.api.particle.Particle.Particle._dependency_checks_modify_steps(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._insert_constraint_enforcement(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._tasks_of_this_solver(), additional_load_and_store_arguments_for_other_dof(), exaparty.api.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), exaparty.api.particle.tests.DisappearingParticleTest.DisappearingParticleTest.algorithm_steps(), exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.algorithm_steps(), exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph(), peano4.api.solversteps.UserActionSet.UserActionSet.get_action_set_name(), peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.get_action_set_name(), test_fuse_steps._FakeActionSet.get_action_set_name(), get_full_qualified_type(), get_logical_type_name(), peano4.api.solversteps.Step.Step.get_observer_class_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), and exaparty.api.particle.Particle.Particle.readme_descriptor().
| list peano4.api.datamodel.DoF.DoF.namespace = [] |
Definition at line 130 of file DoF.py.
Referenced by peano4.api.output.Observer.Observer.__generate_header(), peano4.api.output.ActionSet.ActionSet.__get_full_qualified_class_name(), peano4.api.datamodel.Model.Model.add_cell(), peano4.api.datamodel.Model.Model.add_face(), peano4.api.datamodel.Model.Model.add_global_object(), peano4.api.Project.Project.add_subproject(), peano4.api.datamodel.Model.Model.add_vertex(), configure(), and get_full_qualified_type().
| peano4.api.datamodel.DoF.DoF.subdirectory = subdirectory |
Definition at line 142 of file DoF.py.
Referenced by peano4.api.output.ActionSet.ActionSet.__generate_header(), peano4.api.output.Observer.Observer.__generate_header(), peano4.api.datamodel.Model.Model.add_cell(), peano4.api.datamodel.Model.Model.add_face(), peano4.api.datamodel.Model.Model.add_global_object(), peano4.api.datamodel.Model.Model.add_vertex(), peano4.api.output.ActionSet.ActionSet.generate(), peano4.api.output.InvokeExternalTool.InvokeExternalTool.generate(), peano4.api.output.Jinja2TemplatedHeaderFile.Jinja2TemplatedHeaderFile.generate(), peano4.api.output.Jinja2TemplatedHeaderImplementationFilePair.Jinja2TemplatedHeaderImplementationFilePair.generate(), peano4.api.output.Jinja2TemplateStringHeaderImplementationFilePair.Jinja2TemplateStringHeaderImplementationFilePair.generate(), peano4.api.output.Observer.Observer.generate(), peano4.api.output.TemplatedHeaderFile.TemplatedHeaderFile.generate(), peano4.api.output.TemplatedHeaderImplementationFilePair.TemplatedHeaderImplementationFilePair.generate(), peano4.api.Project.Project.generate(), peano4.api.output.ActionSet.ActionSet.get_cpp_file_name(), peano4.api.output.Observer.Observer.get_cpp_file_name(), and subnamespace().
| peano4.api.datamodel.DoF.DoF.temporary_subdirectory = temporary_subdirectory |