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


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 = has_nondefault_constructor | |
| str | public_fields = "" |
| str | 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 = full_qualified_name | |
| list | _attributes = [] |
| list | _aspects = [] |
| _embed_attributes_into_data_store = 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. | |
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.
| dastgen2.DataModel.DataModel.__init__ | ( | self, | |
| full_qualified_name, | |||
| has_nondefault_constructor = True, | |||
| embed_attributes_into_data_store = False ) |
Construct the data model.
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.
| full_qualified_name | Full qualified name Please pass in in C++ convention i.e. with :: separating the namespaces. |
Definition at line 16 of file DataModel.py.
|
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 _attributes, and _full_qualified_name.
Referenced by write_header_file(), and write_implementation_file().

|
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 _attributes, _full_qualified_name, and _get_constructor_arguments().
Referenced by write_implementation_file().


|
private |
Definition at line 363 of file DataModel.py.
References _attributes, and _full_qualified_name.
Referenced by write_implementation_file().

|
private |
Definition at line 338 of file DataModel.py.
References _attributes, and _full_qualified_name.
Referenced by write_implementation_file().

|
private |
Definition at line 194 of file DataModel.py.
References _attributes.
Referenced by write_header_file(), and write_implementation_file().

|
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 _attributes.
Referenced by __generate_constructor_definition(), and write_header_file().

| dastgen2.DataModel.DataModel.add_aspect | ( | self, | |
| aspect ) |
Add a new aspect.
This is a pretty simplistic routine:
Definition at line 71 of file DataModel.py.
References _aspects.
| dastgen2.DataModel.DataModel.add_attribute | ( | self, | |
| attribute ) |
Definition at line 51 of file DataModel.py.
References _attributes, and _embed_attributes_into_data_store.
| 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 _attributes, and _embed_attributes_into_data_store.
| dastgen2.DataModel.DataModel.expose_all_attributes_in_header_file | ( | self | ) |
Definition at line 470 of file DataModel.py.
References _attributes.
| dastgen2.DataModel.DataModel.full_qualified_name | ( | self | ) |
Definition at line 476 of file DataModel.py.
References _full_qualified_name.
| dastgen2.DataModel.DataModel.name | ( | self | ) |
Definition at line 481 of file DataModel.py.
References _full_qualified_name.
Referenced by exagrype.api.CCZ4SolverBase.CCZ4SolverBase._insert_constraint_enforcement(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._tasks_of_this_solver(), and exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph().

| dastgen2.DataModel.DataModel.set_full_qualified_name | ( | self, | |
| full_qualified_name ) |
Definition at line 48 of file DataModel.py.
References _full_qualified_name.
| 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 __generate_accessors(), __use_default_copy_constructor(), _aspects, _attributes, _embed_attributes_into_data_store, _full_qualified_name, _get_constructor_arguments(), _Header_Template_With_Data_Store, _Header_Template_Without_Data_Store, additional_includes, and public_fields.

| dastgen2.DataModel.DataModel.write_implementation_file | ( | self, | |
| full_qualified_filename ) |
writes the implementation (.cpp) file for your data model.
Definition at line 427 of file DataModel.py.
References __generate_accessors(), __generate_constructor_definition(), __generate_explicit_copy_constructor(), __generate_toString_definition(), __use_default_copy_constructor(), _aspects, _full_qualified_name, and has_nondefault_constructor.

|
protected |
Definition at line 42 of file DataModel.py.
Referenced by add_aspect(), write_header_file(), and write_implementation_file().
|
protected |
Definition at line 41 of file DataModel.py.
Referenced by __generate_accessors(), __generate_constructor_definition(), __generate_explicit_copy_constructor(), __generate_toString_definition(), __use_default_copy_constructor(), _get_constructor_arguments(), add_attribute(), add_or_replace_attribute(), expose_all_attributes_in_header_file(), and write_header_file().
|
protected |
Definition at line 44 of file DataModel.py.
Referenced by add_attribute(), add_or_replace_attribute(), and write_header_file().
|
protected |
Definition at line 40 of file DataModel.py.
Referenced by __generate_accessors(), __generate_constructor_definition(), __generate_explicit_copy_constructor(), __generate_toString_definition(), full_qualified_name(), name(), set_full_qualified_name(), write_header_file(), and write_implementation_file().
|
staticprotected |
Definition at line 128 of file DataModel.py.
Referenced by write_header_file().
|
staticprotected |
Definition at line 85 of file DataModel.py.
Referenced by write_header_file().
| str dastgen2.DataModel.DataModel.additional_includes = "" |
Definition at line 46 of file DataModel.py.
Referenced by exahype2.api.generators.KernelMicrobenchmarkMain._ExaHyPEKernelBenchmarkMainFileSequence.construct_output(), exahype2.api.generators.KernelMicrobenchmarkMain.KernelMicrobenchmarkMain.construct_output(), 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(), exagrype.api.actionsets.ApplyReconstructionFunctor.ApplyReconstructionFunctor.get_includes(), exagrype.api.actionsets.CopyPatchWithLinearInterpolation.CopyPatchWithLinearInterpolation.get_includes(), 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(), and write_header_file().
| dastgen2.DataModel.DataModel.has_nondefault_constructor = has_nondefault_constructor |
Definition at line 43 of file DataModel.py.
Referenced by write_implementation_file().
| str dastgen2.DataModel.DataModel.public_fields = "" |
Definition at line 45 of file DataModel.py.
Referenced by write_header_file().