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
3
import
exahype2.solvers.FixedTimeSteppingCodeSnippets
4
5
6
class
FixedTimeSteppingCodeSnippets
(
exahype2.solvers.FixedTimeSteppingCodeSnippets
):
7
def
__init__(self, normalised_time_step_size):
8
self.
_normalised_time_step_size
= normalised_time_step_size
9
10
def
create_start_time_step_implementation(self):
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
31
def
create_finish_time_step_implementation(self):
32
return
(
33
"""
34
if (isLastGridSweepOfTimeStep()) {
35
assertion(_minCellH >= 0.0);
36
assertion(MaxAdmissibleCellH > 0.0);
37
if (_minCellH <= MaxAdmissibleCellH) {
38
_timeStepSize = """
39
+ str(self.
_normalised_time_step_size
)
40
+
""" * _minCellH / MaxAdmissibleCellH;
41
} else {
42
_timeStepSize = 0.0;
43
}
44
}
45
"""
46
)
exahype2.solvers.FixedTimeSteppingCodeSnippets.FixedTimeSteppingCodeSnippets
Code snippet generator for all fixed time stepping solvers.
Definition
FixedTimeSteppingCodeSnippets.py:6
exahype2.solvers.aderdg.FixedTimeSteppingCodeSnippets.FixedTimeSteppingCodeSnippets
Definition
FixedTimeSteppingCodeSnippets.py:6
exahype2.solvers.aderdg.FixedTimeSteppingCodeSnippets.FixedTimeSteppingCodeSnippets._normalised_time_step_size
_normalised_time_step_size
Definition
FixedTimeSteppingCodeSnippets.py:8
python
exahype2
solvers
aderdg
FixedTimeSteppingCodeSnippets.py
Generated on
for Peano by
1.14.0