Peano
Loading...
Searching...
No Matches
dastgen2.DataModel.DataModel Class Reference

Represents on DaStGen2 object, i.e. More...

Inheritance diagram for dastgen2.DataModel.DataModel:
Collaboration diagram for dastgen2.DataModel.DataModel:

Public Member Functions

 __init__ (self, full_qualified_name, has_nondefault_constructor=True, embed_attributes_into_data_store=False)
 Construct the data model.
 
 set_full_qualified_name (self, full_qualified_name)
 
 add_attribute (self, attribute)
 
 add_or_replace_attribute (self, attribute)
 Check first whether attribute already exists.
 
 add_aspect (self, aspect)
 Add a new aspect.
 
 write_header_file (self, full_qualified_filename)
 writes the header file for your data model.
 
 write_implementation_file (self, full_qualified_filename)
 writes the implementation (.cpp) file for your data model.
 
 expose_all_attributes_in_header_file (self)
 
 full_qualified_name (self)
 
 name (self)
 

Data Fields

 has_nondefault_constructor
 
 public_fields
 
 additional_includes
 

Protected Member Functions

 _get_constructor_arguments (self)
 Generates the list of constructor arguments needed to fully instantiate an object of the class the datamodel generates.
 

Protected Attributes

 _full_qualified_name
 
 _attributes
 
 _aspects
 
 _embed_attributes_into_data_store
 

Static Protected Attributes

str _Header_Template_Without_Data_Store
 
str _Header_Template_With_Data_Store
 

Private Member Functions

 __use_default_copy_constructor (self)
 
 __generate_constructor_definition (self, output)
 In this generation business, I faced multiple issues with initialisation lists: where are comma if some fields are not defined, which fields can I copy directly, and which ones do I have to copy manually, and so forth.
 
 __generate_toString_definition (self, output)
 
 __generate_explicit_copy_constructor (self, output)
 
 __generate_accessors (self, output, is_cpp_file)
 Generate getter/setter functions.
 

Detailed Description

Represents on DaStGen2 object, i.e.

one data model

A data model has attributes and it is tied to aspects which inject some technical behaviour that is cross-cutting.

Definition at line 8 of file DataModel.py.

Constructor & Destructor Documentation

◆ __init__()

dastgen2.DataModel.DataModel.__init__ (   self,
  full_qualified_name,
  has_nondefault_constructor = True,
  embed_attributes_into_data_store = False 
)

Construct the data model.

Attributes

public_fields: C++ string This will be used to add public fields to the class, and each attribute can feed into this string. However, you can also modify it yourself.

Arguments

Parameters
full_qualified_nameFull qualified name Please pass in in C++ convention i.e. with :: separating the namespaces.

Definition at line 16 of file DataModel.py.

Member Function Documentation

◆ __generate_accessors()

dastgen2.DataModel.DataModel.__generate_accessors (   self,
  output,
  is_cpp_file 
)
private

Generate getter/setter functions.

Generate all the setters and getters and use get_methods() to construct them for the individual attributes.

output: File object File object that will be written to.

is_cpp_file: Boolean. True if the output is intended to be the .cpp file. False if it's the header file.

Definition at line 391 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes, and dastgen2.DataModel.DataModel._full_qualified_name.

Referenced by dastgen2.DataModel.DataModel.write_header_file(), and dastgen2.DataModel.DataModel.write_implementation_file().

Here is the caller graph for this function:

◆ __generate_constructor_definition()

dastgen2.DataModel.DataModel.__generate_constructor_definition (   self,
  output 
)
private

In this generation business, I faced multiple issues with initialisation lists: where are comma if some fields are not defined, which fields can I copy directly, and which ones do I have to copy manually, and so forth.

Definition at line 297 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes, dastgen2.DataModel.DataModel._full_qualified_name, and dastgen2.DataModel.DataModel._get_constructor_arguments().

Referenced by dastgen2.DataModel.DataModel.write_implementation_file().

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

◆ __generate_explicit_copy_constructor()

dastgen2.DataModel.DataModel.__generate_explicit_copy_constructor (   self,
  output 
)
private

Definition at line 363 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes, and dastgen2.DataModel.DataModel._full_qualified_name.

Referenced by dastgen2.DataModel.DataModel.write_implementation_file().

Here is the caller graph for this function:

◆ __generate_toString_definition()

dastgen2.DataModel.DataModel.__generate_toString_definition (   self,
  output 
)
private

Definition at line 338 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes, and dastgen2.DataModel.DataModel._full_qualified_name.

Referenced by dastgen2.DataModel.DataModel.write_implementation_file().

Here is the caller graph for this function:

◆ __use_default_copy_constructor()

dastgen2.DataModel.DataModel.__use_default_copy_constructor (   self)
private

Definition at line 194 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes.

Referenced by dastgen2.DataModel.DataModel.write_header_file(), and dastgen2.DataModel.DataModel.write_implementation_file().

Here is the caller graph for this function:

◆ _get_constructor_arguments()

dastgen2.DataModel.DataModel._get_constructor_arguments (   self)
protected

Generates the list of constructor arguments needed to fully instantiate an object of the class the datamodel generates.

Definition at line 171 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes.

Referenced by dastgen2.DataModel.DataModel.__generate_constructor_definition(), and dastgen2.DataModel.DataModel.write_header_file().

Here is the caller graph for this function:

◆ add_aspect()

dastgen2.DataModel.DataModel.add_aspect (   self,
  aspect 
)

Add a new aspect.

This is a pretty simplistic routine:

  1. Inform the aspect object about the model by invoking set_model()
  2. Add the aspect to the list of used aspects

Definition at line 71 of file DataModel.py.

References dastgen2.DataModel.DataModel._aspects.

◆ add_attribute()

dastgen2.DataModel.DataModel.add_attribute (   self,
  attribute 
)

◆ add_or_replace_attribute()

dastgen2.DataModel.DataModel.add_or_replace_attribute (   self,
  attribute 
)

Check first whether attribute already exists.

If it does, replace it.

Definition at line 55 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes, and dastgen2.DataModel.DataModel._embed_attributes_into_data_store.

◆ expose_all_attributes_in_header_file()

dastgen2.DataModel.DataModel.expose_all_attributes_in_header_file (   self)

Definition at line 470 of file DataModel.py.

References dastgen2.DataModel.DataModel._attributes.

◆ full_qualified_name()

dastgen2.DataModel.DataModel.full_qualified_name (   self)

Definition at line 476 of file DataModel.py.

References dastgen2.DataModel.DataModel._full_qualified_name.

◆ name()

dastgen2.DataModel.DataModel.name (   self)

Definition at line 481 of file DataModel.py.

References dastgen2.DataModel.DataModel._full_qualified_name.

Referenced by 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.AlgorithmStep.AlgorithmStep.__str__(), exahype2.api.Solver.Solver.Plotter._add_time_interval_bookkeeping_to_solver(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4Solver.CCZ4Solver._tasks_of_this_solver(), peano4.api.datamodel.DoF.DoF.additional_load_and_store_arguments_for_other_dof(), exaparty.api.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), 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(), peano4.api.datamodel.DoF.DoF.get_full_qualified_type(), peano4.api.datamodel.DoF.DoF.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().

Here is the caller graph for this function:

◆ set_full_qualified_name()

dastgen2.DataModel.DataModel.set_full_qualified_name (   self,
  full_qualified_name 
)

Definition at line 48 of file DataModel.py.

References dastgen2.DataModel.DataModel._full_qualified_name.

◆ write_header_file()

dastgen2.DataModel.DataModel.write_header_file (   self,
  full_qualified_filename 
)

writes the header file for your data model.

Definition at line 202 of file DataModel.py.

References dastgen2.DataModel.DataModel.__generate_accessors(), dastgen2.DataModel.DataModel.__use_default_copy_constructor(), dastgen2.DataModel.DataModel._aspects, dastgen2.DataModel.DataModel._attributes, dastgen2.DataModel.DataModel._embed_attributes_into_data_store, dastgen2.DataModel.DataModel._full_qualified_name, dastgen2.DataModel.DataModel._get_constructor_arguments(), dastgen2.DataModel.DataModel._Header_Template_With_Data_Store, dastgen2.DataModel.DataModel._Header_Template_Without_Data_Store, dastgen2.DataModel.DataModel.additional_includes, exahype2.api.fv.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.additional_includes, exahype2.api.Project.Project.additional_includes(), exahype2.api.rkfd4.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.additional_includes, peano4.api.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.additional_includes, peano4.api.toolbox.multigrid.MatrixFreeJacobi.MatrixFreeJacobi.additional_includes, peano4.api.toolbox.multigrid.vertexbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.additional_includes, peano4.api.toolbox.particles.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.additional_includes, peano4.api.toolbox.particles.InsertParticlesByCoordinates.InsertParticlesByCoordinates.additional_includes, peano4.api.toolbox.particles.InsertRandomParticlesIntoUnrefinedCells.InsertRandomParticlesIntoUnrefinedCells.additional_includes, peano4.api.toolbox.particles.PlotParticlesInVTKFormat.PlotParticlesInVTKFormat.additional_includes, peano4.api.toolbox.PlotCellDataInPeanoBlockFormat.PlotCellDataInPeanoBlockFormat.additional_includes, peano4.api.toolbox.PlotGridInPeanoBlockFormat.PlotGridInPeanoBlockFormat.additional_includes, peano4.api.toolbox.PlotVertexDataInPeanoBlockFormat.PlotVertexDataInPeanoBlockFormat.additional_includes, api.ApplyPointWiselyToPatch.ApplyPointWiselyToPatch.additional_includes, api.DynamicAMR.DynamicAMR.additional_includes, api.InterpolateAndRestrictCells.InterpolateAndRestrictCells.additional_includes, api.InterpolateHangingFaces.InterpolateHangingFaces.additional_includes, api.PlotPatchesInPeanoBlockFormat.PlotPatchesInPeanoBlockFormat.additional_includes, api.PlotPatchesOverFacesInPeanoBlockFormat.PlotPatchesOverFacesInPeanoBlockFormat.additional_includes, api.ProjectPatchOntoFaces.ProjectPatchOntoFaces.additional_includes, api.ProjectPatchWithHaloOntoFaces.ProjectPatchWithHaloOntoFaces.additional_includes, api.ReconstructPatchWithHalo.ReconstructPatchWithHalo.additional_includes, api.RestrictHangingFaces.RestrictHangingFaces.additional_includes, and dastgen2.DataModel.DataModel.public_fields.

Here is the call graph for this function:

◆ write_implementation_file()

Field Documentation

◆ _aspects

◆ _attributes

◆ _embed_attributes_into_data_store

dastgen2.DataModel.DataModel._embed_attributes_into_data_store
protected

◆ _full_qualified_name

◆ _Header_Template_With_Data_Store

str dastgen2.DataModel.DataModel._Header_Template_With_Data_Store
staticprotected

Definition at line 128 of file DataModel.py.

Referenced by dastgen2.DataModel.DataModel.write_header_file().

◆ _Header_Template_Without_Data_Store

str dastgen2.DataModel.DataModel._Header_Template_Without_Data_Store
staticprotected

Definition at line 85 of file DataModel.py.

Referenced by dastgen2.DataModel.DataModel.write_header_file().

◆ additional_includes

dastgen2.DataModel.DataModel.additional_includes

Definition at line 46 of file DataModel.py.

Referenced by exahype2.api.fv.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.get_includes(), exahype2.api.rkfd4.actionsets.RollOverUpdatedFace.RollOverUpdatedFace.get_includes(), peano4.api.toolbox.multigrid.cellbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_includes(), peano4.api.toolbox.multigrid.MatrixFreeJacobi.MatrixFreeJacobi.get_includes(), peano4.api.toolbox.multigrid.vertexbased.ScalarJacobiWithRediscretisation.ScalarJacobiWithRediscretisation.get_includes(), peano4.api.toolbox.particles.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.InsertParticlesAlongCartesianLayoutIntoUnrefinedCells.get_includes(), peano4.api.toolbox.particles.InsertParticlesByCoordinates.InsertParticlesByCoordinates.get_includes(), peano4.api.toolbox.particles.InsertRandomParticlesIntoUnrefinedCells.InsertRandomParticlesIntoUnrefinedCells.get_includes(), peano4.api.toolbox.particles.PlotParticlesInVTKFormat.PlotParticlesInVTKFormat.get_includes(), peano4.api.toolbox.PlotCellDataInPeanoBlockFormat.PlotCellDataInPeanoBlockFormat.get_includes(), peano4.api.toolbox.PlotGridInPeanoBlockFormat.PlotGridInPeanoBlockFormat.get_includes(), peano4.api.toolbox.PlotVertexDataInPeanoBlockFormat.PlotVertexDataInPeanoBlockFormat.get_includes(), api.ApplyPointWiselyToPatch.ApplyPointWiselyToPatch.get_includes(), api.DynamicAMR.DynamicAMR.get_includes(), api.InterpolateAndRestrictCells.InterpolateAndRestrictCells.get_includes(), api.InterpolateHangingFaces.InterpolateHangingFaces.get_includes(), api.PlotPatchesInPeanoBlockFormat.PlotPatchesInPeanoBlockFormat.get_includes(), api.PlotPatchesOverFacesInPeanoBlockFormat.PlotPatchesOverFacesInPeanoBlockFormat.get_includes(), api.ProjectPatchOntoFaces.ProjectPatchOntoFaces.get_includes(), api.ProjectPatchWithHaloOntoFaces.ProjectPatchWithHaloOntoFaces.get_includes(), api.ReconstructPatchWithHalo.ReconstructPatchWithHalo.get_includes(), api.RestrictHangingFaces.RestrictHangingFaces.get_includes(), and dastgen2.DataModel.DataModel.write_header_file().

◆ has_nondefault_constructor

dastgen2.DataModel.DataModel.has_nondefault_constructor

Definition at line 43 of file DataModel.py.

Referenced by dastgen2.DataModel.DataModel.write_implementation_file().

◆ public_fields

dastgen2.DataModel.DataModel.public_fields

Definition at line 45 of file DataModel.py.

Referenced by dastgen2.DataModel.DataModel.write_header_file().


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