Peano 4
Loading...
Searching...
No Matches
swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius Class Reference

Leapfrog ODE integrator. More...

Inheritance diagram for swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius:
Collaboration diagram for swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius:

Public Member Functions

 __init__ (self, name, cfl_factor, initial_time_step_size, enter_cell_kernel="", touch_particles_of_set_first_time_kernel="", touch_particles_of_set_last_time_kernel="", particles_per_cell=0, min_h=0.005, max_h=0.3)
 Initialise the particle.
 
 touch_particles_of_set_first_time_kernel (self)
 
 touch_particles_of_set_first_time_kernel (self, value)
 
 touch_particles_of_set_last_time_kernel (self)
 
 touch_particles_of_set_last_time_kernel (self, value)
 
 cell_kernel (self)
 
 cell_kernel (self, value)
 
 add_to_reduction (self, value)
 
 algorithm_steps (self)
 Create algorithm steps behind leapfrog.
 
 initialisation_steps (self)
 No particular initialisation required, but we reduce once, so we get the initial stats right before we jump into the time stepping.
 
 readme_descriptor (self)
 Create default readme descriptor.
 
- Public Member Functions inherited from peano4.datamodel.DaStGen2.DaStGen2
 configure (self, namespace, association)
 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.
 

Data Fields

 cfl_factor
 
 initial_time_step_size
 
 velocity
 
 accelerator
 
 enter_cell_kernel
 
 touch_particles_of_set_first_time_kernel
 
 touch_particles_of_set_last_time_kernel
 
- Data Fields inherited from swift2.particle.Particle.Particle
 particles_per_cell
 
 min_h
 
 max_h
 
 name
 
- Data Fields inherited from peano4.toolbox.particles.Particle.Particle
 name
 
- 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
 

Protected Attributes

 _algorithm_steps
 
- Protected Attributes inherited from swift2.particle.Particle.Particle
 _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
 

Private Member Functions

 __setup_algorithm_steps (self)
 Create a repository of algorithmic steps which are then ordered into the actual time stepping sequence.
 

Additional Inherited Members

- Static Public Attributes inherited from swift2.particle.Particle.Particle
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 inherited from swift2.particle.Particle.Particle
 _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.
 

Detailed Description

Leapfrog ODE integrator.

Simple particle with a fixed interaction radius h which moves according to leapfrog KDK scheme. By default, it uses global time stepping, i.e. the combination of maximum velocity and minimal mesh size determines the time step size of the subsequent time step. Besides the default variables x and h, the particle has the following properties:

  • a vector a which is the acceleration;
  • a vector v which is the velocity.

You can add further properties via

   myparticle.data.add_attribute( peano4.dastgen2.Peano4DoubleArray("myFancyArray","Dimensions") )

in your code. Or you can create a subclass which adds additional fields after it has called the baseline constructor.

You will need to add further properties for any SPH project.

Study swift2.particle.ExplicitEulerFixedSearchRadius for further information including all parameter documentation.

Definition at line 13 of file LeapfrogFixedSearchRadius.py.

Constructor & Destructor Documentation

◆ __init__()

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.__init__ ( self,
name,
particles_per_cell,
min_h,
max_h = "",
touch_particles_of_set_first_time_kernel = "",
touch_particles_of_set_last_time_kernel = "",
particles_per_cell = 0,
min_h = 0.005,
max_h = 0.3 )

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:

  • A position which is a double vector with Dimension entries.
  • A search radius which describes the range with which other particles a particle might theoretically interact. The effective interaction might be smaller if a code decides to ignore potential interaction partners, i.e. this is an absolute maximum. The search radius will decide on which resolution level within the tree a particle is held.
  • A MoveState flag. This flag is essential. We use it later to label those particles that have been moved to avoid that we move particles multiple times.
  • A flag that indicates if a particle has been updated within a cell. Consult our code release papers: In short, a particle does not uniquely belong to one cell but can belong to many cells. We nevertheless want to update them only once.
See also
swift2.actionsets.UpdateParticleMarker

Reimplemented from swift2.particle.Particle.Particle.

Definition at line 42 of file LeapfrogFixedSearchRadius.py.

References swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.__init__().

Referenced by swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.__init__().

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

Member Function Documentation

◆ __setup_algorithm_steps()

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.__setup_algorithm_steps ( self)
private

Create a repository of algorithmic steps which are then ordered into the actual time stepping sequence.

Definition at line 108 of file LeapfrogFixedSearchRadius.py.

References swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.cfl_factor, swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.cfl_factor, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.cfl_factor, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest.cfl_factor, swift2.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.initial_time_step_size, swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.initial_time_step_size, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.initial_time_step_size, swift2.particle.tests.DisappearingParticleTest.DisappearingParticleTest.initial_time_step_size, dastgen2.attributes.Attribute.Attribute.name(), exahype2.solvers.aderdg.kernelgenerator.utils.matmulConfig.MatmulConfig.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, and convert::data::Variable.name.

Here is the call graph for this function:

◆ add_to_reduction()

◆ algorithm_steps()

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.algorithm_steps ( self)

Create algorithm steps behind leapfrog.

Leapfrog consists basically of four steps per particle. We first determine the force. Then we update the velocity by half a timestep and move the particle by a full timestep. Then the force is re-computed and the second half of the velocity update is done. Some variations of this KDK form re-arrange the steps executed per timestep to avoid a second force loop.

Reimplemented from swift2.particle.Particle.Particle.

Definition at line 189 of file LeapfrogFixedSearchRadius.py.

References swift2.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius._algorithm_steps, swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._algorithm_steps, swift2.particle.Particle.Particle._algorithm_steps, swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius._algorithm_steps, and swift2.particle.tests.testDensityCalculation.testDensityCalculation._algorithm_steps.

Referenced by swift2.particle.Particle.Particle._add_dependency_checks().

Here is the caller graph for this function:

◆ cell_kernel() [1/2]

◆ cell_kernel() [2/2]

◆ initialisation_steps()

◆ readme_descriptor()

◆ touch_particles_of_set_first_time_kernel() [1/2]

◆ touch_particles_of_set_first_time_kernel() [2/2]

◆ touch_particles_of_set_last_time_kernel() [1/2]

◆ touch_particles_of_set_last_time_kernel() [2/2]

Field Documentation

◆ _algorithm_steps

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._algorithm_steps
protected

Definition at line 120 of file LeapfrogFixedSearchRadius.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.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().

◆ accelerator

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.accelerator

Definition at line 66 of file LeapfrogFixedSearchRadius.py.

◆ cfl_factor

◆ enter_cell_kernel

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.enter_cell_kernel

Definition at line 72 of file LeapfrogFixedSearchRadius.py.

◆ initial_time_step_size

◆ touch_particles_of_set_first_time_kernel

◆ touch_particles_of_set_last_time_kernel

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.touch_particles_of_set_last_time_kernel

◆ velocity

swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius.velocity

Definition at line 65 of file LeapfrogFixedSearchRadius.py.


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