Peano
Loading...
Searching...
No Matches
FixedSubcyclingTimeSteppingCodeSnippets.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.FixedSubcyclingTimeSteppingCodeSnippets
4
5
6
class
FixedSubcyclingTimeSteppingCodeSnippets
(
exahype2.solvers.FixedSubcyclingTimeSteppingCodeSnippets
):
7
"""
8
9
Code snippet generator for fixed time stepping in the Runge-Kutta schemes
10
11
"""
12
def
__init__
(self, normalised_time_step_size, use_enclave_tasking, remove_accumulation_errors):
13
super( FixedSubcyclingTimeSteppingCodeSnippets, self ).
__init__
(remove_accumulation_errors)
14
15
self.
_normalised_time_step_size
= normalised_time_step_size
16
self.
_use_enclave_tasking
= use_enclave_tasking
17
18
19
def
create_start_time_step_implementation
(self):
20
"""
21
22
The outcome is used before we actually roll over the accumulation variables
23
and other stuff.
24
25
"""
26
predicate =
"""
27
tarch::mpi::Rank::getInstance().isGlobalMaster()
28
and
29
_maxVolumeH>0.0
30
"""
31
32
if
self.
_use_enclave_tasking
:
33
predicate +=
"""and (_solverState == SolverState::Primary or _solverState == SolverState::PrimaryAfterGridInitialisation) """
34
35
return
"""
36
if ("""
+ predicate +
""") {
37
logInfo( "step()", "Solver {{SOLVER_NAME}}:" );
38
logInfo( "step()", "t_{min,global} = " << _minTimeStampThisTimeStep );
39
logInfo( "step()", "t_{max,global} = " << _maxTimeStampThisTimeStep );
40
logInfo( "step()", "t_{min,this-step} = " << _localMinTimeStampThisTimeStep );
41
logInfo( "step()", "t_{max,this-step} = " << _localMaxTimeStampThisTimeStep );
42
if (_minTimeStepSize > _maxTimeStepSize ) {
43
logInfo( "step()", "dt_{min} = <not yet known>" );
44
logInfo( "step()", "dt_{max} = <not yet known>" );
45
}
46
else {
47
logInfo( "step()", "dt_{min} = " << _minTimeStepSizeThisTimeStep );
48
logInfo( "step()", "dt_{max} = " << _maxTimeStepSizeThisTimeStep );
49
}
50
logInfo( "step()", "h_{min} = " << _minVolumeH << " (volume size)");
51
logInfo( "step()", "h_{max} = " << _maxVolumeH << " (volume size)" );
52
logInfo( "step()", "#updates = " << _patchUpdates << " (no of patches)" );
53
}
54
"""
55
56
57
def
create_finish_time_step_implementation
(self):
58
"""
59
60
The superclass takes the admissible cell size and divides it by the
61
maximum eigenvalue. The Finite Volume solvers however operate with
62
patches, i.e. we have to devide by the volume count per axis.
63
64
"""
65
return
"""
66
assertion( _minVolumeH >= 0.0 );
67
assertion( MaxAdmissibleVolumeH > 0.0 );
68
if (_minVolumeH <= MaxAdmissibleVolumeH) {
69
_timeStepSize = """
+ str(self.
_normalised_time_step_size
) +
""" * _minVolumeH / MaxAdmissibleVolumeH;
70
}
71
else {
72
_timeStepSize = 0.0;
73
}
74
"""
exahype2.solvers.FixedSubcyclingTimeSteppingCodeSnippets.FixedSubcyclingTimeSteppingCodeSnippets
Code snippet generator for all subcycling solvers.
Definition
FixedSubcyclingTimeSteppingCodeSnippets.py:6
exahype2.solvers.FixedSubcyclingTimeSteppingCodeSnippets.FixedSubcyclingTimeSteppingCodeSnippets.__init__
__init__(self, remove_accumulation_errors)
Definition
FixedSubcyclingTimeSteppingCodeSnippets.py:13
exahype2.solvers.FixedSubcyclingTimeSteppingCodeSnippets.FixedSubcyclingTimeSteppingCodeSnippets.create_finish_time_step_implementation
create_finish_time_step_implementation(self)
This routine is inserted after we have reduced all global quantities.
Definition
FixedSubcyclingTimeSteppingCodeSnippets.py:85
exahype2.solvers.SolverCodeSnippets.SolverCodeSnippets.create_start_time_step_implementation
create_start_time_step_implementation(self)
Definition
SolverCodeSnippets.py:66
exahype2.solvers.fv.FixedSubcyclingTimeSteppingCodeSnippets.FixedSubcyclingTimeSteppingCodeSnippets._normalised_time_step_size
_normalised_time_step_size
Definition
FixedSubcyclingTimeSteppingCodeSnippets.py:15
exahype2.solvers.fv.FixedSubcyclingTimeSteppingCodeSnippets.FixedSubcyclingTimeSteppingCodeSnippets._use_enclave_tasking
_use_enclave_tasking
Definition
FixedSubcyclingTimeSteppingCodeSnippets.py:16
python
exahype2
solvers
fv
FixedSubcyclingTimeSteppingCodeSnippets.py
Generated on Tue Mar 18 2025 20:03:03 for Peano by
1.10.0