4template <
typename Particle>
7 const double cflFactor,
8 const double initialTimeStepSize,
9 double maxRelativeGrowth
14 const double maxV = Particle::getSpecies().getMaxVelocity();
17 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
19 double oldTimeStepSize = Particle::getSpecies().getMaxTimeStepSize();
20 double newTimeStepSize = std::min(
21 cflFactor * minH / maxV,
22 oldTimeStepSize * (1.0 + maxRelativeGrowth)
24 Particle::getSpecies().setTimeStepSize(newTimeStepSize,
false);
29template <
typename Particle>
36 const double initialTimeStepSize = Particle::getInitialTimeStepSize();
37 const bool adjustTimeStepSize = Particle::getAdjustTimeStepSize();
40 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
42 if (adjustTimeStepSize) {
45 assertionMsg(
false,
"adjustable time step size not implemented yet");
#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