Peano
Loading...
Searching...
No Matches
FixedTimeSteppingCodeSnippets.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
4
5
7 def __init__(self, normalised_time_step_size):
8 self._normalised_time_step_size = normalised_time_step_size
9
11 """
12 The outcome is used before we actually roll over the accumulation variables
13 and other stuff.
14 """
15 return """
16 if (
17 tarch::mpi::Rank::getInstance().isGlobalMaster()
18 and
19 _maxCellH > 0.0
20 and
21 isFirstGridSweepOfTimeStep()
22 ) {
23 logInfo("startTimeStep(...)", "Solver {{SOLVER_NAME}}:" );
24 logInfo("startTimeStep(...)", "t = " << _minTimeStampThisTimeStep);
25 logInfo("startTimeStep(...)", "dt = " << getTimeStepSize());
26 logInfo("startTimeStep(...)", "h_{min} = " << _minCellH);
27 logInfo("startTimeStep(...)", "h_{max} = " << _maxCellH);
28 }
29"""
30
32 return (
33 """
34 if (isLastGridSweepOfTimeStep()) {
35 assertion(_minCellH >= 0.0);
36 assertion(MaxAdmissibleCellH > 0.0);
37 if (_minCellH <= MaxAdmissibleCellH) {
38 _timeStepSize = """
40 + """ * _minCellH / MaxAdmissibleCellH;
41 } else {
42 _timeStepSize = 0.0;
43 }
44 }
45"""
46 )
create_start_time_step_implementation(self)
The outcome is used before we actually roll over the accumulation variables and other stuff.