![]() |
Peano
|
Functions | |
template<typename Particle > | |
void | computeExplicitEulerWithGlobalTimeStepSize (const peano4::datamanagement::VertexMarker &marker, Particle &particle) |
Update a particle with the explicit Euler. | |
template<typename Particle > | |
void | computeExplicitEulerCromerWithGlobalTimeStepSize (const peano4::datamanagement::VertexMarker &marker, Particle &particle) |
template<typename Particle > | |
void | computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity (double cflFactor, double initialTimeStepSize, double maxRelativeGrowth=0.1) |
Determine a total admissible time step size which is determined through the maximum velocity within the mesh and the minimum cell size. | |
template<typename Particle > | |
void | computeCFLTimeStepSizeSPH () |
Determines the maximum global time step size dt allowed by the CLF condition in SPH simulations. | |
template<typename Particle > | |
void | leapfrogDriftWithGlobalTimeStepSize (const peano4::datamanagement::VertexMarker &marker, Particle &localParticle) |
Drift step. | |
template<typename Particle > | |
bool | leapfrogDriftWithGlobalTimeStepSizeUpdateParticlePredicate (const peano4::datamanagement::VertexMarker &marker, const Particle &localParticle) |
template<typename Particle > | |
void | leapfrogKickWithGlobalTimeStepSize (const peano4::datamanagement::VertexMarker &marker, Particle &localParticle) |
Kick steps. | |
template<typename Particle > | |
bool | leapfrogKickWithGlobalTimeStepSizeUpdateParticlePredicate (const peano4::datamanagement::VertexMarker &marker, const Particle &localParticle) |
template<typename Particle > | |
void | reset_moved_particle_marker (Particle &particle) |
Reset the marker of a particle from whatever it has been before to NotMoved. | |
template<typename Particle > | |
bool | resetMovedParticleMarkerUpdateParticlePredicate (const peano4::datamanagement::VertexMarker &marker, const Particle &particle) |
template<typename Particle > | |
void | resetMovedParticleMarker (const peano4::datamanagement::VertexMarker &marker, Particle &particle) |
void swift2::timestepping::computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity | ( | double | cflFactor, |
double | initialTimeStepSize, | ||
double | maxRelativeGrowth = 0.1 ) |
Determine a total admissible time step size which is determined through the maximum velocity within the mesh and the minimum cell size.
It is also subject to a CFL constant obviously. While every species has an admissible time step size, not every species type (time integrator) might use this one.
Ensure you chose your CFL consant in a way such that the particle doesn't travel further than a vertex size if you intend on using assignment checks.
If the maximum velocity in the system is zero, I set the time step size to the initial or default time step size. This happens for example in the very first time step, where we don't know the maximum velocity yet.
The operation overwrites dt.
cflFactor | The constant withint the CFL condition. |
initialTimeStepSize | This value is used if we don't know the mesh size or maximum velocity yet. |
maxRelativeGrowth | This is the relative max growth of the time step size per time step. You can set it to max of double if you want the time step size to jump immediately if it can. |
Definition at line 5 of file GlobalTimeStepping.cpph.
References tarch::la::equals(), peano4::parallel::SpacetreeSet::getGridStatistics(), peano4::parallel::SpacetreeSet::getInstance(), and peano4::grid::GridStatistics::getMinH().
void swift2::timestepping::computeCFLTimeStepSizeSPH | ( | ) |
Determines the maximum global time step size dt allowed by the CLF condition in SPH simulations.
The operation overwrites dt only if adjustTimeStepSize is true.
Definition at line 30 of file GlobalTimeStepping.cpph.
References assert, and assertionMsg.
void swift2::timestepping::computeExplicitEulerCromerWithGlobalTimeStepSize | ( | const peano4::datamanagement::VertexMarker & | marker, |
Particle & | particle ) |
Definition at line 20 of file Euler.cpph.
References swift2::kernels::localParticleCanBeUpdatedAndMovedInVertexKernel().
void swift2::timestepping::computeExplicitEulerWithGlobalTimeStepSize | ( | const peano4::datamanagement::VertexMarker & | marker, |
Particle & | particle ) |
Update a particle with the explicit Euler.
The code should invoke this routine only in touchVertexLastTime(). It should never change the particle position throughout the mesh traversal, as it might introduce inconsistent particle data structure.
We do not update all particles but merely those which are labelled as local. Virtual particles are mere copies from another tree. We should not alter their states or positions. Any neighbour who is in charge of the particle should do this, and we then expect such a rank to send over a new copy.
Definition at line 5 of file Euler.cpph.
References swift2::kernels::localParticleCanBeUpdatedAndMovedInVertexKernel().
void swift2::timestepping::leapfrogDriftWithGlobalTimeStepSize | ( | const peano4::datamanagement::VertexMarker & | marker, |
Particle & | localParticle ) |
Drift step.
In this, we move the particles by a full time-step using:
\( {\bf x}^{n+1} = {\bf x}^{n} + {\bf v}^{n+1/2}{\Delta t} \)
Notice that this operation modifies the particle topology and hence particles must be re-sorted before further operations can be executed.
Definition at line 14 of file Leapfrog.cpph.
References assertion, assertion1, tarch::la::isEntryFinite(), and leapfrogDriftWithGlobalTimeStepSizeUpdateParticlePredicate().
bool swift2::timestepping::leapfrogDriftWithGlobalTimeStepSizeUpdateParticlePredicate | ( | const peano4::datamanagement::VertexMarker & | marker, |
const Particle & | localParticle ) |
Definition at line 5 of file Leapfrog.cpph.
Referenced by leapfrogDriftWithGlobalTimeStepSize().
void swift2::timestepping::leapfrogKickWithGlobalTimeStepSize | ( | const peano4::datamanagement::VertexMarker & | marker, |
Particle & | localParticle ) |
Kick steps.
There are two kick steps in the KDK scheme, in which we update the particle velocity by a half-timestep using:
Kick1: \( {\bf v}^{n+\frac{1}{2}} &= {\bf v}^{n} + {\bf a}^{n}\frac{\Delta * t}{2}\)
Kick2: \( {\bf v}^{n+1} &= {\bf v}^{n+\frac{1}{2}} + {\bf a}^{n+1}\frac{\Delta t}{2} \)
Notice that the last kick in this sequence is implicit if ${\bf a}$ depends on ${\bf v}$ (e.g. due to artificial viscosity terms), which in principle requires extra treatments (see e.g. Price et al. 2017).
The present version of the kick is the vanilla version: Enough for leapfrog for normal ODE integrators, but schemes such as SPH require us to do additional stuff besides the sole kick of the velocities.
Definition at line 38 of file Leapfrog.cpph.
References assertion.
bool swift2::timestepping::leapfrogKickWithGlobalTimeStepSizeUpdateParticlePredicate | ( | const peano4::datamanagement::VertexMarker & | marker, |
const Particle & | localParticle ) |
Definition at line 29 of file Leapfrog.cpph.
void swift2::timestepping::reset_moved_particle_marker | ( | Particle & | particle | ) |
Reset the marker of a particle from whatever it has been before to NotMoved.
This routine should be called in any task graph before a particle's position is actually altered. The name is not brilliant, as you should also call this routine prior to a change of the interaction radius.
Definition at line 3 of file TimeStepping.cpph.
void swift2::timestepping::resetMovedParticleMarker | ( | const peano4::datamanagement::VertexMarker & | marker, |
Particle & | particle ) |
Definition at line 33 of file TimeStepping.h.
References assertion2, and swift2::kernels::localParticleCanBeUpdatedInVertexKernel().
bool swift2::timestepping::resetMovedParticleMarkerUpdateParticlePredicate | ( | const peano4::datamanagement::VertexMarker & | marker, |
const Particle & | particle ) |
Definition at line 25 of file TimeStepping.h.