3import exahype2.solvers.AdaptiveTimeSteppingCodeSnippets
7 Code snippet generator for fixed time stepping in the Runge-Kutta schemes
15 tarch::mpi::Rank::getInstance().isGlobalMaster()
17 _maxCellHThisTimeStep>0.0
19 isFirstGridSweepOfTimeStep()
21 logInfo( "startTimeStep()", "Solver {{SOLVER_NAME}}:" );
22 logInfo( "startTimeStep()", "t = " << _minTimeStampThisTimeStep );
23 logInfo( "startTimeStep()", "dt = " << getAdmissibleTimeStepSize() );
24 logInfo( "startTimeStep()", "h_{min} = " << _minCellHThisTimeStep );
25 logInfo( "startTimeStep()", "h_{max} = " << _maxCellHThisTimeStep );
26 logInfo( "startTimeStep()", "lambda_{max} = " << _maxEigenvalue );
29 if (isFirstGridSweepOfTimeStep()) {
36 The superclass takes the admissible cell size and divides it by the
37 maximum eigenvalue. The Finite Volume solvers however operate with
38 patches, i.e. we have to devide by the volume count per axis.
42 isLastGridSweepOfTimeStep()
44 tarch::la::greater(_maxEigenvalue, 0.0 )
46 const double waveSpeedDamping = 1.0 / _maxEigenvalue;
47 constexpr double CockburnShuDamping = 1.0 / (2.0*{{RK_ORDER}}-1.0);
48 constexpr double meshDamping = {{DG_ORDER}}==0 ? 1.0 : 1.0 / ({{DG_ORDER}} * {{DG_ORDER}});
49 _admissibleTimeStepSize = """ + str(self.
_time_step_relaxation) +
""" * _minCellHThisTimeStep * waveSpeedDamping * CockburnShuDamping * meshDamping;
50 if ( std::isnan(_admissibleTimeStepSize) or std::isinf(_admissibleTimeStepSize) ) {
51 ::tarch::triggerNonCriticalAssertion( __FILE__, __LINE__, "_admissibleTimeStepSize>0", "invalid (NaN of inf) time step size: " + std::to_string(_admissibleTimeStepSize) );
53 if (tarch::la::smallerEquals(_admissibleTimeStepSize,0.0,1e-10) ) {
54 logWarning( "finishTimeStep(...)", "degenerated time step size of " << std::to_string(_admissibleTimeStepSize) << ". Problem might be extremely stiff (and can't be solved) or there could be a bug in the eigenvalue computation" );
Code snippet generator for fixed time stepping in the Runge-Kutta schemes.
create_finish_time_step_implementation(self)
The superclass takes the admissible cell size and divides it by the maximum eigenvalue.
__init__(self, time_step_relaxation)
create_start_time_step_implementation(self)