Peano 4
Loading...
Searching...
No Matches
GlobalTimeStepping.cpph
Go to the documentation of this file.
2
3
4template <typename Particle>
6 const double cflFactor, const double initialTimeStepSize, double maxRelativeGrowth
7) {
9 const double maxV = Particle::getSpecies().getMaxVelocity();
10
11 if (tarch::la::equals(maxV, 0.0)) {
12 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
13 } else {
14 double oldTimeStepSize = Particle::getSpecies().getMaxTimeStepSize();
15 double newTimeStepSize = std::min(cflFactor * minH / maxV, oldTimeStepSize * (1.0 + maxRelativeGrowth));
16 Particle::getSpecies().setTimeStepSize(newTimeStepSize, false);
17 }
18}
19
20
21template <typename Particle>
23
24 const double cflFactor = Particle::getCfl();
25 const double initialTimeStepSize = Particle::getInitialTimeStepSize();
26 const bool adjustTimeStepSize = Particle::getAdjustTimeStepSize();
27
28 /* Set initial time step size */
29 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
30
31 if (adjustTimeStepSize) {
32 // @TODO implement the CFL time step for SPH. IT depends not on V but on the signal velocity.
33 assertionMsg(false, "adjustable time step size not implemented yet");
34 }
35}
#define assertionMsg(expr, message)
peano4::grid::GridStatistics getGridStatistics() const
Return statistics object for primary spacetree.
static SpacetreeSet & getInstance()
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 t...
void computeCFLTimeStepSizeSPH()
Determines the maximum global time step size dt allowed by the CLF condition in SPH simulations.
bool equals(const Matrix< Rows, Cols, Scalar > &lhs, const Matrix< Rows, Cols, Scalar > &rhs, const Scalar &tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares to matrices on equality by means of a numerical accuracy.
tarch::la::Vector< Dimensions, double > getMinH() const