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

Default superclass for any data model in Peano which is stored within the grid. More...

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

Public Member Functions

 __init__ (self, name)
 Construct a DaStGen2 object.
 configure (self, namespace, association, subdirectory="", temporary_subdirectory="")
 Configure output.
 additional_load_and_store_arguments (self)
 additional_load_and_store_arguments (self, new_arguments)
 hosts_smart_pointer_attribute (self)
 Does class host a smart pointer attribute.
Public Member Functions inherited from peano4.api.datamodel.DoF.DoF
 __init__ (self, name)
 Create a degree of freedom object.
 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_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

 generator = None
 data = dastgen2.DataModel(name)
 peano4_mpi_and_storage_aspect = peano4.api.dastgen2.MPIAndStorageAspect(peano4.api.datamodel.DoFAssociation.Undef)
Data Fields inherited from peano4.api.datamodel.DoF.DoF
 association = DoFAssociation.Undef
 name = name
list namespace = []
 grid_selector = None
 subdirectory = subdirectory
 temporary_subdirectory = temporary_subdirectory

Static Public Attributes

str readme_descriptor
str readme_package_descriptor

Additional Inherited Members

Protected Attributes inherited from peano4.api.datamodel.DoF.DoF
list _additional_load_and_store_arguments = []

Detailed Description

Default superclass for any data model in Peano which is stored within the grid.

A DaStGen2 data type generator. To add fields to this object, just use the DaStGen2 instance data of this field, i.e. data.add_attribute().

By default, we add x and h to the attributes. The DataModel object also can host aspects, i.e. classes which inject technical code snippets into each and every instance. By default, we add peano4.api.dastgen2.MPIAndStorageAspect and dastgen2.aspect.MPI, but yuo might want to add further ones.

The actual dump into a C++ file is not done by the DaStGen2 object. Instead, we hold a generator object which does this translation. In that sense, the DaStGen2 object is almost an empty wrapper which tailors the underlying data model, but adds no further specific behaviour.

There are two code generations: The default one, and then one that we have to employ if the underlying data object hosts a smart pointer.

Attributes

data: dastgen2.DataModel Add elements to this guy to enrich your data model.

peano4_mpi_and_storage_aspect: peano4.api.dastgen2.MPIAndStorageAspect This aspect adds the Peano-specific MPI routines to the data type, i.e. routines used for boundary and re-balancing exchange. Modify this one if you want to control certain data exchange or merge patterns.

Data storage

I can control when to store data through the peano4_mpi_and_storage_aspect.

MPI

If you want to add your own MPI merge implementation, you have to alter the attribute peano4_mpi_and_storage_aspect.

Arguments

name: String Name (unqualified)

Definition at line 189 of file DaStGen2.py.

Constructor & Destructor Documentation

◆ __init__()

peano4.api.datamodel.DaStGen2.DaStGen2.__init__ ( self,
name )

Construct a DaStGen2 object.

We hold the data model and a dedicated data generator. By default, the data model is augmented with geometric debug information. Every Peano data object has an MPI aspect, i.e. can, in principle, be sent and received through MPI.

By default, each Peano dat model also realises the MPIAndStorageAspect which requires special treatment:

MPI and storage aspect

Normally, we just hold all the aspects in a long list and generate them one by one. The MPI and storage aspect is a little bit different: If we add the Peano-specific one, we still want later to modify parts of it. That is, we would have to run through all the aspects one by one, pick out the MPI and storage one, and then alter this one. So what we do instead is that we hold it as a dedicated attribute and also add it to the list.

Definition at line 289 of file DaStGen2.py.

References __init__().

Referenced by __init__().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ additional_load_and_store_arguments() [1/2]

peano4.api.datamodel.DaStGen2.DaStGen2.additional_load_and_store_arguments ( self)

Reimplemented from peano4.api.datamodel.DoF.DoF.

Definition at line 354 of file DaStGen2.py.

References _additional_load_and_store_arguments.

◆ additional_load_and_store_arguments() [2/2]

peano4.api.datamodel.DaStGen2.DaStGen2.additional_load_and_store_arguments ( self,
new_arguments )

Reimplemented from peano4.api.datamodel.DoF.DoF.

Definition at line 359 of file DaStGen2.py.

References peano4_mpi_and_storage_aspect.

◆ configure()

peano4.api.datamodel.DaStGen2.DaStGen2.configure ( self,
namespace,
association,
subdirectory = "",
temporary_subdirectory = "" )

Configure output.

Configuring an output means setting the right output directory and taking into account whether we are associated to a vertex, face or cell.

I always need the MPI aspect, but I can't add the right one in the constructor, as I don't know whether this DaStGen model is used for vertices, faces or cells. Such context however is important to generate the correct merge routines with the correct signature. Therefore, I hook into this routine.

Reimplemented from peano4.api.datamodel.DoF.DoF.

Definition at line 328 of file DaStGen2.py.

References configure(), peano4.api.datamodel.DaStGen.DaStGen.generator, generator, hosts_smart_pointer_attribute(), and peano4_mpi_and_storage_aspect.

Referenced by configure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hosts_smart_pointer_attribute()

peano4.api.datamodel.DaStGen2.DaStGen2.hosts_smart_pointer_attribute ( self)

Does class host a smart pointer attribute.

The context is important when we pick the data generator, as objects with a smart poiner have to be handled differently compared to plain objects.

Definition at line 368 of file DaStGen2.py.

References convert::data::PatchData.data, and data.

Referenced by configure().

Here is the caller graph for this function:

Field Documentation

◆ data

peano4.api.datamodel.DaStGen2.DaStGen2.data = dastgen2.DataModel(name)

Definition at line 317 of file DaStGen2.py.

Referenced by peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.__generate_dastgen_input_file(), peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.__get_file_name(), peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.__get_full_qualified_file_name(), exaparty.api.particle.Particle.Particle.__init__(), exaparty.api.particle.Particle.Particle._add_dependency_checks(), exaparty.api.particle.Particle.Particle._dependency_checks_modify_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_boolean_array_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_boolean_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_double_array_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_double_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_enum_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_integer_array_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_integer_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_peano_double_array_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_peano_integer_array_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_string_attributes(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle._generate_user_defined_attributes(), peano4.api.datamodel.PatchToDoubleArray.PatchToDoubleArray._get_dictionary_for_output(), peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.construct_output(), peano4.api.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.construct_output(), peano4.api.datamodel.PatchToDoubleArray.PatchToDoubleArray.construct_output(), peano4.api.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap.construct_output(), peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer.construct_output(), peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.get_header_file_include(), peano4.api.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.get_header_file_include(), peano4.api.datamodel.PatchToDoubleArray.PatchToDoubleArray.get_header_file_include(), peano4.api.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap.get_header_file_include(), peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer.get_header_file_include(), peano4.api.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.get_stack_container(), peano4.api.datamodel.PatchToDoubleArray.PatchToDoubleArray.get_stack_container(), peano4.api.datamodel.PatchToDoubleArrayOnHeap.PatchToDoubleArrayOnHeap.get_stack_container(), peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer.PatchToDoubleArrayWithSmartPointer.get_stack_container(), hosts_smart_pointer_attribute(), exaparty.api.particle.Particle.Particle.readme_descriptor(), exaparty.api.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius.set_parameters(), exaparty.api.particle.SPHParticle.SPHParticle.set_parameters(), and exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.set_parameters().

◆ generator

◆ peano4_mpi_and_storage_aspect

peano4.api.datamodel.DaStGen2.DaStGen2.peano4_mpi_and_storage_aspect = peano4.api.dastgen2.MPIAndStorageAspect(peano4.api.datamodel.DoFAssociation.Undef)

Definition at line 322 of file DaStGen2.py.

Referenced by additional_load_and_store_arguments(), and configure().

◆ readme_descriptor

◆ readme_package_descriptor

str peano4.api.datamodel.DaStGen2.DaStGen2.readme_package_descriptor
static

Definition at line 249 of file DaStGen2.py.


The documentation for this class was generated from the following file: