TURTLE
Loading...
Searching...
No Matches
Public Member Functions | Protected Types
abstract_particle_rhs Class Referenceabstract

#include <abstract_particle_rhs.hpp>

Inheritance diagram for abstract_particle_rhs:
Inheritance graph
[legend]

Public Member Functions

virtual ~abstract_particle_rhs () noexcept(false)
 
virtual int getStateSize () const =0
 
virtual int operator() (double t, abstract_particle_set &pset, particle_rnumber *result, std::vector< std::unique_ptr< abstract_particle_set::particle_rnumber[]> > &additional_data)=0
 
virtual int imposeModelConstraints (abstract_particle_set &pset) const =0
 

Protected Types

using particle_rnumber = abstract_particle_set::particle_rnumber
 

Detailed Description

Particle model definition, i.e. provides right-hand-side of ODEs

This abstract class prescribes the way that particle models shall be implemented in TurTLE. Children of this class must implement a "function call" operator, where the right-hand-side of the corresponding ODE shall be computed, as well as an "imposeModelConstraints" method where miscellaneous properties can be enforced as needed (an example would be orientation vectors being reset to unit lenght).

Member Typedef Documentation

◆ particle_rnumber

Constructor & Destructor Documentation

◆ ~abstract_particle_rhs()

virtual abstract_particle_rhs::~abstract_particle_rhs ( )
inlinevirtual

Member Function Documentation

◆ getStateSize()

virtual int abstract_particle_rhs::getStateSize ( ) const
pure virtual

◆ imposeModelConstraints()

virtual int abstract_particle_rhs::imposeModelConstraints ( abstract_particle_set & pset) const
pure virtual

Enforce model constraints on a set of particles

Note: This is meant to be used as a safe-guard against growth of small errors. As an example, shaped particles for which orientation must be tracked through time may slowly develop non-unit-sized orientation vectors. This method will change the particle states such that any such constraints are respected.

Implemented in deformation_tensor_rhs< rnumber, be, tt >, and tracer_rhs< rnumber, be, tt >.

◆ operator()()

virtual int abstract_particle_rhs::operator() ( double t,
abstract_particle_set & pset,
particle_rnumber * result,
std::vector< std::unique_ptr< abstract_particle_set::particle_rnumber[]> > & additional_data )
pure virtual

Compute right-hand-side of the ODE

Notes

  1. This method may shuffle particle data in-memory, but it may not redistribute particles between MPI processes. The additional_data parameter allows for other particle data to be shuffled in the same fashion. In particular, you may use additional_data when computing substeps for Runge Kutta methods to keep the different temporary arrays in the same order. Please see implementation of the Heun method for an example.

For completeness: shuffling of data will at least take place during the computation of particle-to-particle interaction terms.

  1. This method may not modify the current state of the particles. I cannot mark the parameter abstract_particle_set &pset as const because the arrays may need to be shuffled, but separate parts of the code rely on the fact that this method does not change the state of the particle set. If your particle model has strict constraints that affect the computation of the right-hand side, you must ensure that those constraints are respected within this method without modifying the current particle state. Otherwise the ODE may not be integrated correctly.

Implemented in tracer_with_collision_counter_rhs< rnumber, be, tt >, deformation_tensor_rhs< rnumber, be, tt >, and tracer_rhs< rnumber, be, tt >.


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