Peano
|
Base class for any particle in the project. More...
Data Structures | |
class | SpeciesAspect |
Every generated particle belongs to a species. More... | |
Public Member Functions | |
__init__ (self, name, particles_per_cell, min_h, max_h) | |
Initialise the particle. | |
algorithm_steps (self) | |
Return sequence of algorithm steps that have to be called per time step. | |
initialisation_steps (self) | |
Return sequence of algorithm steps that have to be performed throughout initialisation. | |
readme_descriptor (self) | |
Create default readme descriptor. | |
Public Member Functions inherited from peano4.datamodel.DaStGen2.DaStGen2 | |
configure (self, namespace, association, subdirectory="") | |
I always need the MPI aspect, but I can't add the right one before I don't know whether this DaStGen model is used for vertices, faces or cells. | |
additional_load_and_store_arguments (self) | |
additional_load_and_store_arguments (self, new_arguments) | |
Public Member Functions inherited from peano4.datamodel.DoF.DoF | |
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 | |
particles_per_cell | |
min_h | |
max_h | |
name | |
Data Fields inherited from peano4.toolbox.particles.Particle.Particle | |
name | |
partid | |
Data Fields inherited from peano4.datamodel.DaStGen2.DaStGen2 | |
generator | |
data | |
peano4_mpi_and_storage_aspect | |
Data Fields inherited from peano4.datamodel.DoF.DoF | |
association | |
name | |
namespace | |
subdirectory | |
Static Public Attributes | |
str | DependencyChecks_Attribute_Prefix = "dependencyChecks" |
list | DependencyChecks_Ifdefs = ["PeanoDebug > 0"] |
Static Public Attributes inherited from peano4.datamodel.DaStGen2.DaStGen2 | |
str | readme_package_descriptor |
Protected Member Functions | |
_dependency_checks_modify_steps (self, steplist, step_type_name, peano4_event_enum) | |
Add dependency checks as well as mesh consistency checks to the algorithm steps. | |
_add_dependency_checks (self) | |
Add dependency (particle consistency) checks. | |
Protected Attributes | |
_algorithm_steps | |
_initialisation_steps | |
Protected Attributes inherited from peano4.datamodel.DaStGen2.DaStGen2 | |
_additional_load_and_store_arguments | |
Protected Attributes inherited from peano4.datamodel.DoF.DoF | |
_additional_load_and_store_arguments | |
Base class for any particle in the project.
You usually do not initialise this base class, but you pick one of the subclasses which define which time stepping scheme is realised by a particle. The time stepping scheme defines through which phases or steps each particle runs through per time step, while this generic base class has no steps at all.
The type is a specialisation of Peano's particle as it is provided via the toolbox. In line with the docu there, you can use this particle and add further attributes via
Definition at line 10 of file Particle.py.
swift2.particle.Particle.Particle.__init__ | ( | self, | |
name, | |||
particles_per_cell, | |||
min_h, | |||
max_h ) |
Initialise the particle.
This is the baseclass for a particle, i.e. we only add the absolute minimum of information to a particle. As we inherit from the toolbox particle, we already have some attributes defined. These are the guys which are not explicitly visible from the code snippet below, i.e. they are introduced by the superclass constructor.
Here's an overview of pre-defined attributes that each and every particle hosts:
Reimplemented from peano4.toolbox.particles.Particle.Particle.
Reimplemented in swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize, swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest, swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius, swift2.particle.tests.testDensityCalculation.testDensityCalculation, swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius, swift2.particle.SPHParticle.SPHParticle, and swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.
Definition at line 74 of file Particle.py.
References swift2.particle.Particle.Particle.__init__(), peano4.datamodel.DaStGen2.DaStGen2.data, peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.data, peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.data, peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray.data, convert::data::DataSet.data, convert::data::PatchData.data, exahype2::EnclaveBookkeeping::Entry.data, tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Dimensions, double >.data(), Vec< ITEM, ALLOCATOR >.data(), tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), toolbox::blockstructured::GlobalDatabase::Entry.data, toolbox::particles::memorypool::GlobalContinuousMemoryPool< T >::GlobalMemory.data, and toolbox::particles::TrajectoryDatabase::Entry.data.
Referenced by swift2.particle.Particle.Particle.__init__().
|
protected |
Add dependency (particle consistency) checks.
This routine should be called in the subclass directly after you have befilled self._algorithm_steps and self._initialisation_steps. It is safe to add this stuff to your particle model all the time - the actual checks kick in if and only if you run in non-release modes. However, you might want to call the function only in these cases to ensure that no (empty) C++ code is generated and the compiler can optimise more aggressively.
We first create Enumerations representing each algorithm step defined for the Particle, as well as each sweep stage of any grid traversal.
Then for each defined algorithm step, we add a call to the dependency check functions for each sweep stage (touch vertex first time, cell kernel, touch vertex last time...)
The check consists of 1) marking down which step in the full algorithm a particle has completed in the current simulation step 2) verifying that each step and sweep stage before the one the particle currently finds itself in has been completed.
This is done both for the main algorithm steps as well as for the initialisation steps individually.
Definition at line 482 of file Particle.py.
References swift2.particle.Particle.Particle._dependency_checks_modify_steps(), swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.algorithm_steps(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.algorithm_steps(), swift2.particle.Particle.Particle.algorithm_steps(), swift2.particle.SPHParticle.SPHParticle.algorithm_steps(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest.algorithm_steps(), swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.algorithm_steps(), Vec< ITEM, ALLOCATOR >.data(), peano4.datamodel.DaStGen2.DaStGen2.data, peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.data, peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.data, peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray.data, convert::data::DataSet.data, convert::data::PatchData.data, exahype2::EnclaveBookkeeping::Entry.data, tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), toolbox::blockstructured::GlobalDatabase::Entry.data, toolbox::particles::memorypool::GlobalContinuousMemoryPool< T >::GlobalMemory.data, toolbox::particles::TrajectoryDatabase::Entry.data, and swift2.particle.Particle.Particle.DependencyChecks_Attribute_Prefix.
|
protected |
Add dependency checks as well as mesh consistency checks to the algorithm steps.
This function actually modifies the AlgorithmSteps to contain the debug dependency checks. Is called by self._add_dependency_checks() and uses the validation routines from swift2::dependencychecks.
The routine is used to either add checks for the init phase or the actual time stepping. Which one is meant is identified through step_type_name. You can obviously call the routine twice: once for init and once for the time stepping. Later on, you might want to add further steps.
Besides the name of interest, we also require a list of algorithmic steps through which the code runs through.
If the user does not define bespoke default settings, this routine adds default ones. These are set through instances of swift::dependencychecks::Invariant.
First, the particle is added two counters which count up how often a particle is touched or masked out.
Steplist | list list of AlgorithmStep objects to work on |
step_type_name | str name of type of steps we're dealing with. Either AlgorithmStep or InitStep. |
peano4_event_enum | list list of enums of peano4 events within a single mesh traversal (e.g. touch vertex first time, cell kernel, ...) |
Definition at line 188 of file Particle.py.
References exahype2::EnclaveBookkeeping::Entry.data, tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< Dimensions, int >.data(), Vec< ITEM, ALLOCATOR >.data(), peano4.datamodel.DaStGen2.DaStGen2.data, peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.data, peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.data, peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray.data, convert::data::DataSet.data, convert::data::PatchData.data, tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< TwoPowerD, int >.data(), toolbox::blockstructured::GlobalDatabase::Entry.data, toolbox::particles::memorypool::GlobalContinuousMemoryPool< T >::GlobalMemory.data, toolbox::particles::TrajectoryDatabase::Entry.data, swift2.particle.Particle.Particle.DependencyChecks_Attribute_Prefix, and swift2.particle.Particle.Particle.DependencyChecks_Ifdefs.
Referenced by swift2.particle.Particle.Particle._add_dependency_checks().
swift2.particle.Particle.Particle.algorithm_steps | ( | self | ) |
Return sequence of algorithm steps that have to be called per time step.
Reimplemented in swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius, swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius, swift2.particle.SPHParticle.SPHParticle, swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest, and swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.
Definition at line 132 of file Particle.py.
Referenced by swift2.particle.Particle.Particle._add_dependency_checks().
swift2.particle.Particle.Particle.initialisation_steps | ( | self | ) |
Return sequence of algorithm steps that have to be performed throughout initialisation.
Reimplemented in swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius, swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius, swift2.particle.SPHParticle.SPHParticle, swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest, and swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.
Definition at line 142 of file Particle.py.
swift2.particle.Particle.Particle.readme_descriptor | ( | self | ) |
Create default readme descriptor.
You might want to overwrite this for your particular particle species to get more detailed info the the README.md file generated by Peano.
Reimplemented from peano4.datamodel.DaStGen2.DaStGen2.
Reimplemented in swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius, swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius, swift2.particle.SPHParticle.SPHParticle, and swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.
Definition at line 152 of file Particle.py.
References peano4.datamodel.DaStGen2.DaStGen2.data, peano4.datamodel.DaStGenToLegacyTool.DaStGenToLegacyTool.data, peano4.datamodel.DynamicArrayOverPrimitivesToStdVector.DynamicArrayOverPrimitivesToStdVector.data, peano4.datamodel.PatchToDoubleArray.PatchToDoubleArray.data, convert::data::DataSet.data, convert::data::PatchData.data, exahype2::EnclaveBookkeeping::Entry.data, tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< Dimensions, int >.data(), tarch::la::Vector< Size, Scalar >.data(), Vec< ITEM, ALLOCATOR >.data(), tarch::la::DynamicMatrix.data(), tarch::la::Matrix< Rows, Cols, Scalar >.data(), tarch::la::Vector< TwoTimesD, int >.data(), tarch::la::Vector< TwoPowerD, int >.data(), tarch::la::Vector< Dimensions, double >.data(), tarch::la::Vector< Size, Scalar >.data(), tarch::la::Vector< DimensionsTimesTwo, int >.data(), tarch::la::Vector< Dimensions, int >.data(), toolbox::blockstructured::GlobalDatabase::Entry.data, toolbox::particles::memorypool::GlobalContinuousMemoryPool< T >::GlobalMemory.data, toolbox::particles::TrajectoryDatabase::Entry.data, peano4.visualisation.filters.ExtractMeshResolution.ExtractMeshResolution.max_h, swift2.particle.Particle.Particle.max_h, solvers.api.CollocatedDLinearDiscretisationWithPointJacobi.CollocatedDLinearDiscretisationWithPointJacobi.max_h, solvers.api.Solver.Solver.max_h, api.solvers.Solver.Solver.max_h, peano4.visualisation.filters.ExtractMeshResolution.ExtractMeshResolution.min_h, swift2.particle.Particle.Particle.min_h, solvers.api.CollocatedDLinearDiscretisationWithPointJacobi.CollocatedDLinearDiscretisationWithPointJacobi.min_h, solvers.api.Solver.Solver.min_h, api.solvers.Solver.Solver.min_h, dastgen2.attributes.Attribute.Attribute.name(), exahype2.solvers.aderdg.kernels.Gemms.Gemms.name, exahype2.solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.name(), exahype2.solvers.fv.FV.FV.name(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.name(), peano4.datamodel.DoF.DoF.name, peano4.solversteps.Step.Step.name, peano4.solversteps.UserActionSet.UserActionSet.name, peano4.toolbox.particles.Particle.Particle.name, swift2.particle.AlgorithmStep.AlgorithmStep.name, swift2.particle.Particle.Particle.name, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest.name, swift2.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.name, convert::data::Variable.name, solvers.api.Solver.Solver.name(), api.solvers.Solver.Solver.name(), and swift2.particle.Particle.Particle.particles_per_cell.
|
protected |
Definition at line 537 of file Particle.py.
Referenced by swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius._setup_algorithm_steps(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.add_to_reduction(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.add_to_reduction(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.algorithm_steps(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.algorithm_steps(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.cell_kernel(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.cell_kernel(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.cell_kernel(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.cell_kernel(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.initialisation_steps(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.initialisation_steps(), swift2.particle.SPHParticle.SPHParticle.switch_namespace_of_all_particle_iterators(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.touch_particles_of_set_first_time_kernel(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.touch_particles_of_set_first_time_kernel(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.touch_particles_of_set_first_time_kernel(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.touch_particles_of_set_first_time_kernel(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.touch_particles_of_set_last_time_kernel(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.touch_particles_of_set_last_time_kernel(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.touch_particles_of_set_last_time_kernel(), and swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.touch_particles_of_set_last_time_kernel().
|
protected |
Definition at line 545 of file Particle.py.
Referenced by swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius._setup_initialisation_steps().
|
static |
Definition at line 185 of file Particle.py.
Referenced by swift2.particle.Particle.Particle._add_dependency_checks(), and swift2.particle.Particle.Particle._dependency_checks_modify_steps().
|
static |
Definition at line 186 of file Particle.py.
Referenced by swift2.particle.Particle.Particle._dependency_checks_modify_steps().
swift2.particle.Particle.Particle.max_h |
Definition at line 127 of file Particle.py.
Referenced by solvers.api.Solver.Solver.__str__(), api.solvers.CollocatedLowOrderDiscretisation.AssemblePetscMatrix.get_constructor_body(), api.solvers.DiscontinuousGalerkinDiscretisation.AssemblePetscMatrix.get_constructor_body(), swift2.particle.Particle.Particle.readme_descriptor(), and peano4.visualisation.filters.ExtractMeshResolution.ExtractMeshResolution.render().
swift2.particle.Particle.Particle.min_h |
Definition at line 126 of file Particle.py.
Referenced by solvers.api.Solver.Solver.__str__(), swift2.particle.Particle.Particle.readme_descriptor(), and peano4.visualisation.filters.ExtractMeshResolution.ExtractMeshResolution.render().
swift2.particle.Particle.Particle.name |
Definition at line 333 of file Particle.py.
Referenced by exahype2.solvers.aderdg.kernels.Gemms.Gemms.__repr__(), swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.__setup_algorithm_steps(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.__setup_algorithm_steps(), swift2.particle.AlgorithmStep.AlgorithmStep.__str__(), peano4.datamodel.DoF.DoF.additional_load_and_store_arguments_for_other_dof(), swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), swift2.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), peano4.solversteps.UserActionSet.UserActionSet.get_action_set_name(), peano4.datamodel.DoF.DoF.get_full_qualified_type(), peano4.datamodel.DoF.DoF.get_logical_type_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), and swift2.particle.Particle.Particle.readme_descriptor().
swift2.particle.Particle.Particle.particles_per_cell |
Definition at line 125 of file Particle.py.
Referenced by swift2.particle.Particle.Particle.readme_descriptor().