RosenbrockAdaptInstationary.h 3.22 KB
Newer Older
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
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  TU Dresden                                                            ==
// ==                                                                        ==
// ==  Institut für Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
// ==                                                                        ==
// ============================================================================

/** \file RosenbrockAdaptInstationary.h */

#ifndef AMDIS_ROSENBROCKADAPTINSTATIONARY_H
#define AMDIS_ROSENBROCKADAPTINSTATIONARY_H

#include "AMDiS_fwd.h"
#include "time/RosenbrockStationary.h"
27
#include "time/RosenbrockMethod.h"
28
#include "AdaptInstationary.h"
29
#include "CreatorMap.h"
30
31
32
33
34
35
36
37
38
39
40

namespace AMDiS {

  class RosenbrockAdaptInstationary : public AdaptInstationary
  {
  public:
    RosenbrockAdaptInstationary(std::string name, 
				RosenbrockStationary *problemStat,
				AdaptInfo *info,
				ProblemTimeInterface *problemInstat,
				AdaptInfo *initialInfo,
41
				time_t initialTimestamp = 0);
42

43
    /// Runs the Rosenbrock loop until one timestep is accepted.
44
45
46
    void oneTimestep();

  protected:
47
    /// Pointer to the Rosenbrock method that should be used.
48
    RosenbrockMethod *rosenbrockMethod;
49

50
    /// Pointer to the stationary problem;
51
52
    RosenbrockStationary *rosenbrockStat;

53
54
    /// Indicates, if this is the very first timestep.
    bool firstTimestep;
55

56
57
58
59
60
61
62
63
64
65
    /// If true, the last timestep was rejected.
    bool lastTimestepRejected;


    /// If true, more than one of the last timesteps were rejected.
    bool succRejection;

    /// If greater than 0, than for the first given number of timesteps the timestep
    /// will be not changed and is set to the very first one.
    int fixFirstTimesteps;
66
67
    
    /// Timestep of the last accepted time iteration.
68
69
    double tauAcc;

70
    /// Error estimation of the last accepted time iteration.
71
72
    double estAcc;

73
    /// Timestep of the last rejected time iteration.
74
75
    double tauRej;

76
    /// Error estimation of the last rejected time iteration.
77
    double estRej;
78

79
80
81
82
83
    /// Current timestep.
    double tau;

    /// The value is 1.0 / (tau * gamma), where gamma is a value of the used 
    /// Rosenbrock method.
84
    double tauGamma;
85
86
87
88
89
  };
 
}

#endif // AMDIS_ROSENBROCKADAPTINSTATIONARY_H