Peano
Loading...
Searching...
No Matches
swift2.particle.tests.testDensityCalculation.testDensityCalculation Class Reference

Test only the density calculation algorithmic step. More...

Inheritance diagram for swift2.particle.tests.testDensityCalculation.testDensityCalculation:
Collaboration diagram for swift2.particle.tests.testDensityCalculation.testDensityCalculation:

Public Member Functions

 __init__ (self, name, dimensions_hydro, cfl_factor, initial_time_step_size, particles_per_cell=5, min_h=0.6, max_h=0.5)
 Initialise the particle.
 
- Public Member Functions inherited from swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius
 set_parameters (self)
 This function translates "global" particle parameters which are constant throughout the simulation (like CFL factor, minimal time step size, viscosity parameters...) into dastgen attributes of the C++ particle class.
 
 alpha_av (self)
 Viscosity parameters of the Minimal SPH model.
 
 alpha_av (self, alpha_av)
 
 beta_av (self)
 
 beta_av (self, beta_av)
 
 get_cpp_namespace_from_project_namespace (self)
 Transform namespace into cpp format.
 
 readme_descriptor (self)
 Create default readme descriptor.
 
- Public Member Functions inherited from swift2.particle.SPHParticle.SPHParticle
 algorithm_steps (self)
 Return algorithm steps: A list of AlgorithmStep objects to be executed in that order for this particle.
 
 initialisation_steps (self)
 Return the list of algorithm steps to be executed during initialisation.
 
 hydro_dimensions (self)
 Forbid users to modify hydro dimensions on-the-fly.
 
 hydro_dimensions (self, hydro_dimensions)
 
 eta_factor (self)
 Set the eta factor used by the SPH kernel to target a certain number of neighbour particles.
 
 eta_factor (self, eta_factor)
 
 h_hydro_min (self)
 Set the limits allowed for the SPH smoothing length.
 
 h_hydro_min (self, h_hydro_min)
 
 h_hydro_max (self)
 
 h_hydro_max (self, h_hydro_max)
 
 h_tolerance (self)
 Tolerance for Newton-Raphson convergence criterion.
 
 h_tolerance (self, h_tolerance)
 
 h_max_iterations (self)
 Max number of iterations to adapt the SPH smoothing length.
 
 h_max_iterations (self, h_max_iterations)
 
 mantissa_size (self)
 Set the mantissa size of doubles and Peano double arrays if we want to use reduced precission via Clang annotations.
 
 mantissa_size (self, mantissa_size)
 
 switch_namespace_of_all_particle_iterators (self, new_namespace, old_namespace="::swift2::kernels::")
 Switch the prefix (namespace) of all particle iterators.
 
- Public Member Functions inherited from peano4.datamodel.DaStGen2.DaStGen2
 configure (self, namespace, association, 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.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)
 

Protected Member Functions

 _setup_algorithm_steps (self)
 Set up the internal list of algorithm steps for this particle.
 
 _setup_initialisation_steps (self)
 Define the algorithm steps to be taken during initialization here.
 
- 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.
 

Protected Attributes

 _algorithm_steps
 
 _initialisation_steps
 
- Protected Attributes inherited from swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius
 _sph_flavour
 
 _alpha_av
 
 _beta_av
 
 _hydro_dimensions
 
 _algorithm_steps
 
 _initialisation_steps
 
 _cfl_factor
 
 _initial_time_step_size
 
- Protected Attributes inherited from swift2.particle.SPHParticle.SPHParticle
 _sph_flavour
 
 _cfl_factor
 
 _initial_time_step_size
 
 _constant_time_step_size
 
 _hydro_dimensions
 
 _eta_factor
 
 _h_max_iterations
 
 _h_hydro_min
 
 _h_hydro_max
 
 _h_tolerance
 
 _swift_project_namespace
 
 _mantissa_size
 
- 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
 

Additional Inherited Members

- Data Fields inherited from swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius
 balsara
 
 rot_v
 
 div_v
 
 v_sig_AV
 
 soundSpeed
 
 algorithm_steps_dict
 
- Data Fields inherited from swift2.particle.SPHParticle.SPHParticle
 mass
 
 velocity
 
 acceleration
 
 density
 
 pressure
 
 smoothL
 
 u
 
 uDot
 
 v_full
 
 u_full
 
 wcount
 
 wcount_dh
 
 f
 
 hDot
 
 rho_dh
 
 sml_iteration_count
 
 sml_iter_left_bound
 
 sml_iter_right_bound
 
 has_no_neighbours
 
 sml_converged
 
 density_neighbourcount
 
 force_neighbourcount
 
- 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
 
 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 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
 

Detailed Description

Test only the density calculation algorithmic step.

Inherit everything from SPHLeapfrogFixedSearchRadius, just modify the algorithm steps.

Definition at line 14 of file testDensityCalculation.py.

Constructor & Destructor Documentation

◆ __init__()

swift2.particle.tests.testDensityCalculation.testDensityCalculation.__init__ ( self,
name,
particles_per_cell,
min_h,
max_h,
constant_time_step_size = 5,
swift_project_namespace = 0.6,
particles_per_cell = 0.5 )

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.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius.

Definition at line 23 of file testDensityCalculation.py.

References swift2.particle.tests.testDensityCalculation.testDensityCalculation.__init__(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps(), swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius._setup_algorithm_steps(), swift2.particle.SPHParticle.SPHParticle._setup_algorithm_steps(), swift2.particle.tests.testDensityCalculation.testDensityCalculation._setup_algorithm_steps(), swift2.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_initialisation_steps(), swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius._setup_initialisation_steps(), swift2.particle.SPHParticle.SPHParticle._setup_initialisation_steps(), and swift2.particle.tests.testDensityCalculation.testDensityCalculation._setup_initialisation_steps().

Referenced by swift2.particle.tests.testDensityCalculation.testDensityCalculation.__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.tests.testDensityCalculation.testDensityCalculation._setup_algorithm_steps ( self)
protected

Set up the internal list of algorithm steps for this particle.

We need to maintain an individual instance of this list for cases where we modify the algorithm steps later on. This can happen for example when adding debugging/dependency checks later on.

The algorithm steps shall be a list of AlgorithmStep objects to be executed in that order.

Definitions of the algorithm steps stored in the algorithm_steps_dict are placed in _setup_algorithm_steps_dict(self). The dict is set up during instantiation of this class.

Reimplemented from swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius.

Definition at line 49 of file testDensityCalculation.py.

References swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius.algorithm_steps_dict.

Referenced by swift2.particle.tests.testDensityCalculation.testDensityCalculation.__init__().

Here is the caller graph for this function:

◆ _setup_initialisation_steps()

swift2.particle.tests.testDensityCalculation.testDensityCalculation._setup_initialisation_steps ( self)
protected

Define the algorithm steps to be taken during initialization here.

This follows the same logic as _setup_algorithm_steps. See documentation there for more info.

Make sure self._setup_algorithm_steps_dict() has been called before.

Reimplemented from swift2.particle.SPHLeapfrogFixedSearchRadius.SPHLeapfrogFixedSearchRadius.

Definition at line 75 of file testDensityCalculation.py.

Referenced by swift2.particle.tests.testDensityCalculation.testDensityCalculation.__init__().

Here is the caller graph for this function:

Field Documentation

◆ _algorithm_steps

◆ _initialisation_steps

swift2.particle.tests.testDensityCalculation.testDensityCalculation._initialisation_steps
protected

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