Peano
Loading...
Searching...
No Matches
GlobalTimeStepping.cpph
Go to the documentation of this file.
2
3
4template <typename Particle>
7 const double cflFactor,
8 const double initialTimeStepSize,
9 double maxRelativeGrowth
10 ) {
13 .getMinH()(0);
14 const double maxV = Particle::getSpecies().getMaxVelocity();
15
16 if (tarch::la::equals(maxV, 0.0)) {
17 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
18 } else {
19 double oldTimeStepSize = Particle::getSpecies().getMaxTimeStepSize();
20 double newTimeStepSize = std::min(
21 cflFactor * minH / maxV,
22 oldTimeStepSize * (1.0 + maxRelativeGrowth)
23 );
24 Particle::getSpecies().setTimeStepSize(newTimeStepSize, false);
25 }
26}
27
28
29template <typename Particle>
31
32 assert(false);
33 // Don't use this.
34 // TODO mladen: delete this once other timestepping is done.
35
36 const double initialTimeStepSize = Particle::getInitialTimeStepSize();
37 const bool adjustTimeStepSize = Particle::getAdjustTimeStepSize();
38
39 /* Set initial time step size */
40 Particle::getSpecies().setTimeStepSize(initialTimeStepSize);
41
42 if (adjustTimeStepSize) {
43 // @TODO implement the CFL time step for SPH. IT depends not on V but on the
44 // signal velocity.
45 assertionMsg(false, "adjustable time step size not implemented yet");
46 }
47}
#define assertionMsg(expr, message)
#define assert(...)
Definition LinuxAMD.h:28
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