Peano 4
Loading...
Searching...
No Matches
swift2::timestepping Namespace Reference

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 >
void leapfrogKickWithGlobalTimeStepSize (const peano4::datamanagement::VertexMarker &marker, Particle &localParticle)
 Kick steps.
 
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 >
void resetMovedParticleMarker (const peano4::datamanagement::VertexMarker &marker, Particle &particle)
 
template<typename Particle >
void resetMovedParticleMarkerWithMasking (const peano4::datamanagement::VertexMarker &marker, Particle &particle)
 Reset moved marker.
 

Function Documentation

◆ computeAdmissibleTimeStepSizeFromGlobalMeshSizeAndMaximumVelocity()

template<typename 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.

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.

Parameters
cflFactorThe constant withint the CFL condition.
initialTimeStepSizeThis value is used if we don't know the mesh size or maximum velocity yet.
maxRelativeGrowthThis 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().

Here is the call graph for this function:

◆ computeCFLTimeStepSizeSPH()

template<typename Particle >
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 22 of file GlobalTimeStepping.cpph.

References assertionMsg.

◆ computeExplicitEulerCromerWithGlobalTimeStepSize()

template<typename Particle >
void swift2::timestepping::computeExplicitEulerCromerWithGlobalTimeStepSize ( const peano4::datamanagement::VertexMarker & marker,
Particle & particle )

Definition at line 20 of file Euler.cpph.

References swift2::kernels::localParticleCanBeUpdatedAndMovedInVertexKernel().

Here is the call graph for this function:

◆ computeExplicitEulerWithGlobalTimeStepSize()

template<typename Particle >
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().

Here is the call graph for this function:

◆ leapfrogDriftWithGlobalTimeStepSize()

template<typename Particle >
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 5 of file Leapfrog.cpph.

References assertion1, tarch::la::isEntryFinite(), and swift2::kernels::localParticleCanBeUpdatedAndMovedInVertexKernel().

Here is the call graph for this function:

◆ leapfrogKickWithGlobalTimeStepSize()

template<typename Particle >
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 21 of file Leapfrog.cpph.

References swift2::kernels::localParticleCanBeUpdatedInVertexKernel().

Here is the call graph for this function:

◆ reset_moved_particle_marker()

template<typename Particle >
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.

Referenced by resetMovedParticleMarker(), and resetMovedParticleMarkerWithMasking().

Here is the caller graph for this function:

◆ resetMovedParticleMarker()

template<typename Particle >
void swift2::timestepping::resetMovedParticleMarker ( const peano4::datamanagement::VertexMarker & marker,
Particle & particle )

Definition at line 25 of file TimeStepping.h.

References swift2::kernels::localParticleCanBeUpdatedInVertexKernel(), and reset_moved_particle_marker().

Here is the call graph for this function:

◆ resetMovedParticleMarkerWithMasking()

template<typename Particle >
void swift2::timestepping::resetMovedParticleMarkerWithMasking ( const peano4::datamanagement::VertexMarker & marker,
Particle & particle )

Reset moved marker.

This is an alternative to resetMovedParticleMarker. We do not check any predicate at all.

Todo
Mladen I think we can skip the if here, but I'm not sure.

Definition at line 43 of file TimeStepping.h.

References reset_moved_particle_marker().

Here is the call graph for this function: