RosenbrockStationary.h 2.69 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
27
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  TU Dresden                                                            ==
// ==                                                                        ==
// ==  Institut fr Wissenschaftliches Rechnen                               ==
// ==  Zellescher Weg 12-14                                                  ==
// ==  01069 Dresden                                                         ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  https://gforge.zih.tu-dresden.de/projects/amdis/                      ==
// ==                                                                        ==
// ============================================================================

/** \file RosenbrockStationary.h */

#ifndef AMDIS_ROSENBROCKSTATIONARY_H
#define AMDIS_ROSENBROCKSTATIONARY_H

#include "AMDiS_fwd.h"
#include "ProblemVec.h"
#include "SystemVector.h"
28
#include "time/RosenbrockMethod.h"
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

namespace AMDiS {

  class RosenbrockStationary : public ProblemVec
  {
  public:
    RosenbrockStationary(std::string name)
      : ProblemVec(name),
	first(true)
    {}

    DOFVector<double>* getStageSolution(int i)
    {
      return stageSolution->getDOFVector(i);
    }

    DOFVector<double>* getUnVec(int i)
    {
      return unVec->getDOFVector(i);
    }

    DOFVector<double>* getPhiSum()
    {
      return phiSum;
    }

    void setTauPtr(double *ptr)
    {
      tauPtr = ptr;
    }

    void acceptTimestep();

    void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
			   bool asmMatrix, bool asmVector);

    void solve(AdaptInfo *adaptInfo, bool fixedMatrix);

67
68
69
70
71
72
    void setRosenbrockMethod(RosenbrockMethod *method)
    {
      rm = method;
      init();
    }

73
  protected:
74
75
76
77
    void init();

  protected:
    RosenbrockMethod *rm;
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

    SystemVector *stageSolution, *unVec, *newUn, *tmp, *lowSol;

    std::vector<SystemVector*> stageSolutions;

    DOFVector<double> *phiSum, *tmpDof;

    double *tauPtr;

    bool first;
  };

}

#endif // AMDIS_ROSENBROCKSTATIONARY_H