-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtimeIntegrator.hpp
More file actions
66 lines (47 loc) · 1.93 KB
/
timeIntegrator.hpp
File metadata and controls
66 lines (47 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// ***********************************************************************************
// Idefix MHD astrophysical code
// Copyright(C) Geoffroy R. J. Lesur <[email protected]>
// and other code contributors
// Licensed under CeCILL 2.1 License, see COPYING for more information
// ***********************************************************************************
#ifndef TIMEINTEGRATOR_HPP_
#define TIMEINTEGRATOR_HPP_
#include "idefix.hpp"
#include "dataBlock.hpp"
#include "rkl.hpp"
class TimeIntegrator {
public:
int64_t GetNCycles(); // Get current number of cycles
// Constructor from input and given datablock
TimeIntegrator(Input &, DataBlock &);
// Do one integration cycle
void Cycle(DataBlock &);
// check whether we have reached the maximum runtime
bool CheckForMaxRuntime();
void ShowLog(DataBlock &); //< Display progress log
void ShowConfig(); //< Show configuration of time integrator
bool isSilent{false}; // Whether the integration should proceed silently
private:
double ComputeBalance(); // Compute the compute balance between MPI processes
// Whether we have RKL
bool haveRKL{false};
int nstages;
// Weights of time integrator
real w0[2];
real wc[2];
int checkNanPeriodicity{1};
bool haveFixedDt = false;
real fixedDt;
real cfl; // CFL number
real cflMaxVar; // Max CFL variation number
real maxdivB{0}; // Maximum allowed divB
int64_t ncycles; // # of cycles
double computeLastLog; // Timer for actual computeTime
double lastLog; // time for the last log (s)
double lastMpiLog; // time for the last MPI log (s)
double lastSGLog; // time for the last SelfGravity log (s)
double maxRuntime; // Maximum runtime requested (disabled when negative)
int64_t cyclePeriod; // # of cycles between two logs
Kokkos::Timer timer; // Internal timer of the integrator
};
#endif // TIMEINTEGRATOR_HPP_