RosenbrockMethod.cc 3.7 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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#include "time/RosenbrockMethod.h"

namespace AMDiS {

  void RosenbrockMethod::createData()
  {
    a.resize(stages);
    for (int i = 0; i < stages; i++) {
      a[i].resize(stages);
      for (int j = 0; j < stages; j++)
	a[i][j] = 0.0;
    }

    c.resize(stages);
    for (int i = 0; i < stages; i++) {
      c[i].resize(stages);
      for (int j = 0; j < stages; j++)
	c[i][j] = 0.0;
    }
    
    m1.resize(stages);
    m2.resize(stages);
    for (int i = 0; i < stages; i++) {
      m1[i] = 0.0;
      m2[i] = 0.0;
    }
  }
  

  Ros2::Ros2()
  {
    order = 2;
    stages = 2;
    gamma = 1.707106781186547;

    createData();

    a[1][0] = 5.857864376269050e-01;

    c[0][0] = 5.857864376269050e-01;
    c[1][0] = 1.171572875253810e+00;
    c[1][1] = 5.857864376269050e-01;

    m1[0] = 8.786796564403575e-01;
    m1[1] = 2.928932188134525e-01;

    m2[0] = 5.857864376269050e-01;
  }


  Rowda3::Rowda3()
  {
    order = 3;
    stages = 3;
    gamma = 4.358665215084590e-01;

    createData();
    
    a[1][0] = 1.605996252195329e+00;
    a[2][0] = 1.605996252195329e+00;
    
    c[0][0] =  2.294280360279042e+00;
    c[1][0] = -8.874044410657833e-01;
    c[1][1] =  2.294280360279042e+00;
    c[2][0] = -2.398747971635036e+01;
    c[2][1] = -5.263722371562129e+00;
    c[2][2] =  2.294280360279042e+00;
    
    m1[0] =  2.236727045296590e+00;
    m1[1] =  2.250067730969644e+00;
    m1[2] = -2.092514044390320e-01;
    
    m2[0] = 2.059356167645940e+00;
    m2[1] = 1.694014319346528e-01;
  }


  Ros3p::Ros3p()
  {
    order = 3;
    stages = 3;
    gamma = 7.886751345948129e-01;

    createData();
    
    a[1][0] = 1.267949192431123e+00;
    a[2][0] = 1.267949192431123e+00;
    
    c[0][0] = 1.267949192431123e+00;
    c[1][0] = 1.607695154586739e+00;
    c[1][1] = 1.267949192431123e+00;
    c[2][0] = 3.462101615137755e+00;
    c[2][1] = 1.732050807568877e+00;
    c[2][2] = 1.267949192431123e+00;
    
    m1[0] = 2.0;
    m1[1] = 5.773502691896258e-01;
    m1[2] = 4.226497308103742e-01;
    
    m2[0] = 2.113248654051871e+00;
    m2[1] = 1.0;
    m2[2] = 4.226497308103742e-01;
  }

  
  Rodasp::Rodasp()
  {
    order = 4;
    stages = 6;
    gamma = 2.5e-01;

    createData();

    a[1][0] =  3.0;
    a[2][0] =  1.831036793486759e+00;
    a[2][1] =  4.955183967433795e-01;
    a[3][0] =  2.304376582692669e+00;
    a[3][1] = -5.249275245743001e-02;
    a[3][2] = -1.176798761832782e+00;
    a[4][0] = -7.170454962423025e+00;
    a[4][1] = -4.741636671481786e+00;
    a[4][2] = -1.631002631330971e+01;
    a[4][3] = -1.062004044111401e+00;
    a[5][0] = -7.170454962423025e+00;
    a[5][1] = -4.741636671481785e+00;
    a[5][2] = -1.631002631330971e+01;
    a[5][3] = -1.062004044111401e+00;
    a[5][4] =  1.0;

    c[0][0] =  4.0;
    c[1][0] =  1.200000000000000e+01;
    c[1][1] =  4.0;
    c[2][0] =  8.791795173947035e+00;
    c[2][1] =  2.207865586973518e+00;
    c[2][2] =  4.0;
    c[3][0] = -1.081793056857153e+01;
    c[3][1] = -6.780270611428266e+00;
    c[3][2] = -1.953485944642410e+01;
    c[3][3] =  4.0;
    c[4][0] = -3.419095006749677e+01;
    c[4][1] = -1.549671153725963e+01;
    c[4][2] = -5.474760875964130e+01;
    c[4][3] = -1.416005392148534e+01;
    c[4][4] =  4.0;
    c[5][0] = -3.462605830930533e+01;
    c[5][1] = -1.530084976114473e+01;
    c[5][2] = -5.699955578662667e+01;
    c[5][3] = -1.840807009793095e+01;
    c[5][4] =  5.714285714285717e+00;
    c[5][5] =  4.0;

    m1[0] = -7.170454962423026e+00;
    m1[1] = -4.741636671481786e+00;
    m1[2] = -1.631002631330971e+01;
    m1[3] = -1.062004044111401e+00;
    m1[4] =  1.0;
    m1[5] =  1.0;

    m2[0] = -7.170454962423026e+00;
    m2[1] = -4.741636671481786e+00;
    m2[2] = -1.631002631330971e+01;
    m2[3] = -1.062004044111401e+00;
    m2[4] =  1.0;
  }
}