Peano
Loading...
Searching...
No Matches
LocalTimeSteppingCodeSnippets.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 """
8
9 Code snippet generator for fixed time stepping in the Runge-Kutta schemes
10
11 """
12 def __init__(self, time_step_relaxation, use_enclave_tasking):
13 self._time_step_relaxation = time_step_relaxation
14 self._use_enclave_tasking = use_enclave_tasking
15
16
18 return create_start_time_step_implementation_for_adaptive_time_stepping_with_subcycling(use_enclave_tasking)
19
20
22 """
23
24 This routine is inserted after we have reduced all global quantities. These
25 are the quantities with the postfix ThisTimeStep.
26
27 """
28 return """
29 #ifdef Parallel
30 double newMaxEigenvalue = _maxEigenvalue;
31 tarch::mpi::Rank::getInstance().allReduce(
32 &newMaxEigenvalue,
33 &_maxEigenvalue,
34 1,
35 MPI_DOUBLE,
36 MPI_MAX,
37 [&]() -> void { tarch::services::ServiceRepository::getInstance().receiveDanglingMessages(); }
38 );
39 #endif
40
41 if ( _solverState == SolverState::Secondary ) {
42 _maxEigenvalueOfPreviousSweep = _maxEigenvalue;
43 }
44"""
45
Code snippet generator for fixed time stepping in the Runge-Kutta schemes.
create_finish_time_step_implementation(self)
This routine is inserted after we have reduced all global quantities.