Peano
Loading...
Searching...
No Matches
peano4.api.datamodel.DoF.DoF Class Reference

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

Inheritance diagram for peano4.api.datamodel.DoF.DoF:
Collaboration diagram for peano4.api.datamodel.DoF.DoF:

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 = []

Detailed Description

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.

Definition at line 56 of file DoF.py.

Constructor & Destructor Documentation

◆ __init__()

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().

Additional store/load/send/receive arguments

  • The first entry of this triple is the expression that you want the observer to pass in.
  • The second one is the C++ type of this expression.
  • 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.

Attributes

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 (

See also
peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag). That is, data are only used, loaded or stored if the selector holds and the compiler has concluded that the data are needed.

Definition at line 82 of file DoF.py.

Member Function Documentation

◆ additional_load_and_store_arguments()

◆ additional_load_and_store_arguments_for_other_dof()

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.

Here is the call graph for this function:

◆ configure()

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.

Here is the call graph for this function:

◆ get_enumeration_type()

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().

Here is the call graph for this function:

◆ get_full_qualified_type()

◆ get_logical_type_name()

◆ subnamespace()

peano4.api.datamodel.DoF.DoF.subnamespace ( self)

Definition at line 219 of file DoF.py.

References subdirectory.

Field Documentation

◆ _additional_load_and_store_arguments

list peano4.api.datamodel.DoF.DoF._additional_load_and_store_arguments = []
protected

◆ association

peano4.api.datamodel.DoF.DoF.association = DoFAssociation.Undef

◆ grid_selector

peano4.api.datamodel.DoF.DoF.grid_selector = None

Definition at line 132 of file DoF.py.

◆ 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().

◆ namespace

◆ subdirectory

◆ temporary_subdirectory


The documentation for this class was generated from the following file:
  • src/peano4/api/datamodel/DoF.py