14 const double maxEigenvalue = kernels::{{SOLVER_NAME}}::maxScaledEigenvalue(
15 repositories::{{SOLVER_INSTANCE}},
23 repositories::{{SOLVER_INSTANCE}}.setMaxEigenvalue(maxEigenvalue);
25 // This is a value set for stats reasons. We'll ignore it later as we
26 // ask for a new valid time step size from getAdmissibleTimeStepSize().
27 //const double newTimeStepSize = 0.0;
28 const double newTimeStepSize = repositories::{{SOLVER_INSTANCE}}.getMinCellSize(false) > 0.0 ?
29 repositories::{{SOLVER_INSTANCE}}.getAdmissibleTimeStepSize() * marker.h()(0) / repositories::{{SOLVER_INSTANCE}}.getMinCellSize(false) :
36 tarch::mpi::Rank::getInstance().isGlobalMaster()
40 isFirstGridSweepOfTimeStep()
42 logInfo("startTimeStep(...)", "Solver {{SOLVER_NAME}}:");
43 logInfo("startTimeStep(...)", "t = " << _minTimeStamp);
44 logInfo("startTimeStep(...)", "dt = " << getAdmissibleTimeStepSize());
45 logInfo("startTimeStep(...)", "h_{min} = " << _minCellH);
46 logInfo("startTimeStep(...)", "h_{max} = " << _maxCellH);
47 logInfo("startTimeStep(...)", "lambda_{max} = " << _maxEigenvalue);
50 if (isFirstGridSweepOfTimeStep()) {
57 This routine is inserted after we have reduced all global quantities. These
58 are the quantities with the postfix ThisTimeStep.
62 AdaptiveTimeSteppingCodeSnippets, self
66 isLastGridSweepOfTimeStep()
68 tarch::la::greater(_maxEigenvalue, 0.0)
70 const double minCellSize = _minCellHThisTimeStep;
71 // The max eigenvalue here is already the sum of the eigenvalues in each direction scaled with the volume size in that direction.
72 _admissibleTimeStepSize = std::min(MinTerminalTime - _minTimeStampThisTimeStep, CFL * PNPM / _maxEigenvalue);
73 if (std::isnan(_admissibleTimeStepSize) or std::isinf(_admissibleTimeStepSize)) {
74 ::tarch::triggerNonCriticalAssertion(__FILE__, __LINE__, "_admissibleTimeStepSize > 0", "invalid (NaN of inf) time step size: " + std::to_string(_admissibleTimeStepSize));
76 if (tarch::la::smallerEquals(_admissibleTimeStepSize, 0.0, 1e-10)) {
77 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 (h=" << minCellSize << ")");
Code snippet generator for all fixed time stepping solvers.
create_finish_time_step_implementation(self)
This routine is inserted after we have reduced all global quantities.
create_compute_new_time_step_size()
Very similar to create_compute_time_step_size(), this routine should return a code snippet which crea...
create_start_time_step_implementation(self)