Debian Codegraph @

add_ons/albertasystems/Elast/Common/elast_problem.cc

raw
1 #ifndef _elast_problem_
2 #define _elast_problem_ 1
3 #include <alberta.h>
4 #include <alberta_util.h>
5 #include "newalberta.hh"
6 #include "prototype_fem_elfunc.hh"
7 #include "fem_elfunc.hh"
8 #include "operator_parts.hh"
9 #include "elast.hh"
10 #include "elast_problem.hh"
11
12 const PROB_DATA_DIFF* /*const*/ (prob_datas_elast)[DIM*DIM];
13 //nix allokiert bis jetzt!
14
15 const_full_mat::const_full_mat(REAL* coeffs): constmat(0.0)
16 {int i,j;
17 for (i=0; i< DIM; i++)
18 for (j=0; j< DIM; j++)
19 mat[i][j] = coeffs[i*DIM+j];
20 }
21
22 /*d dfpoly/ d phi1, dfpoly>0 auf dem Gibbschen Simplex,modelliert Wachstum von phi_1 (Perlit)
23 falls delta G:= G_1 - G_2 <0 */
24 //ist Funktionalableitung von -(phi1-phi2)^3/3 +phi1 - phi2
25 //Driving Force Polynom f. die wachsende Phase
26 #if 0
27 REAL ddfpoly(REAL phi1, REAL phi2)
28 {
29 REAL val = - pow(phi1 - phi2, 2.0) + 1;
30 return(val);
31 }
32 #endif
33 static REAL gu_D_ou(const REAL_D x, REAL t)
34 {
35 return(0.01*x[1]);
36 }
37
38 static REAL gu_D_lr(const REAL_D x, REAL t)
39 {
40 return(0.0);
41 }
42
43 static REAL gu_N_0(const REAL_D x, REAL t, S_CHAR bound)
44 {
45
46 return(0.0);
47 }
48 #if 0
49 Unsinn
50 static REAL gu_N_ou(const REAL_D x, REAL t, S_CHAR bound)
51 {
52
53 return(0.0);
54 }
55 #endif
56
57
58 #if 0
59 //Symmetr. Matrizen: Zeile p , pp, ap, aa, a
60 //das muss dann effektiv positiv definit werden
61 //mal gucken. Ist vielleicht ueberfluessig
62 #endif
63
64
65
66
67 /* REAL mu;
68 REAL lambda;
69 REAL mu_lambda_scale;
70
71 REAL rho;
72 */
73
74 //Sieben Instanzen fuer prob_data der isotropen Antwortmatrix., reichen fuer ein Problem, in dem 2 Phasen vorkommen
75 //mit rhs u. ggf mit ex_sols befuellen.
76 //Austenit-Diag
77 PROB_DATA_DIFF prob_data_s11 =
78 {
79 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
80 nil //massfunc
81 , 0 //constflag
82 ,{ 0.6882, 1.0724, 1.0E11, /* my, lambda, mu_lambda_scale*/
83 7659.0, /* rho */
84 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
85 },
86 nil/*dw_rhs_aa*/,
87 nil, gu_D_lr, gu_N_0, // ex_sol
88 nil, nil /* ph_ex, grd_ph_ex */
89 };
90
91 PROB_DATA_DIFF prob_data_s22 =
92 {
93 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
94 nil //massfunc
95 , 0 //constflag
96 ,{ 0.6882, 1.0724, 1.0E11, /* my, lambda, mu_lambda_scale*/
97 7659.0, /* rho */
98 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
99 },
100 nil/*dw_rhs_aa*/,
101 nil, gu_D_ou, nil/*gu_N_ou*/, // Dehnung in y-Richtung auf Rand vorgegeben
102 nil, nil /* ph_ex, grd_ph_ex */
103 };
104
105 PROB_DATA_DIFF prob_data_s33 =
106 {
107 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
108 nil //massfunc
109 , 0 //constflag
110 ,{ 0.6882, 1.0724, 1.0E11, /* my, lambda, mu_lambda_scale*/
111 7659.0, /* rho */
112 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
113 },
114 nil, //Nebendiagonal-Prob_Data hat keine eigene RHS,
115 nil, gu_D_lr, gu_N_0, /*keine exakte Loesung u hom. Neumann- Randdaten(
116 <=> kein Beitrag. Sinngemaess was andres als gDph_0, gNph_0, aber gleiche Werte erforderlich.).*/
117 nil, nil /* ph_ex, grd_ph_ex */
118 };
119
120 PROB_DATA_DIFF prob_data_s12 =
121 {
122 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
123 nil //massfunc
124 , 0 //constflag
125 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
126 },
127 nil, //Nebendiagonal-Prob_Data hat keine eigene RHS,
128 nil, nil, nil,
129 nil, nil
130 };
131
132 PROB_DATA_DIFF prob_data_s13 =
133 {
134 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
135 nil //massfunc
136 , 0 //constflag
137 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
138 },
139 nil, //Nebendiagonal-Prob_Data hat keine eigene RHS,
140 nil, nil, nil,
141 nil, nil /* ph_ex, grd_ph_ex */
142 };
143
144 PROB_DATA_DIFF prob_data_s23 =
145 {
146 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
147 nil //massfunc
148 , 0 //constflag
149 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
150 },
151 nil,
152 nil , nil, nil,
153 nil, nil /* ph_ex, grd_ph_ex */
154 };
155 //Perlit-Perlit Kopplung
156 PROB_DATA_DIFF prob_data_s21 =
157 {
158 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
159 nil //massfunc
160 , 0 //constflag
161 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
162 },
163 nil,
164 nil , nil, nil,
165 nil, nil /* ph_ex, grd_ph_ex */
166 };
167 PROB_DATA_DIFF prob_data_s31 =
168 {
169 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
170 nil //massfunc
171 , 0 //constflag
172 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
173 },
174 nil,
175 nil , nil, nil,
176 nil, nil /* ph_ex, grd_ph_ex */
177 };
178 PROB_DATA_DIFF prob_data_s32 =
179 {
180 nil, nil, /* diffkoeff(=alpha), order0 werden ueberschrieben!!*/
181 nil //massfunc
182 , 0 //constflag
183 ,{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
184 },
185 nil/*dw_rhs_pp*/,
186 nil , nil, nil,//ph1_0= 1 - ph0_0//klappte mit ph10_0
187 nil, nil /* ph_ex, grd_ph_ex */
188 };
189
190
191 void init_problem_standard_steel()
192 {
193 FUNCNAME("init_problem_standard_steel");
194 // int i,j;
195 REAL scale = 1; //prob_data_s11.physconstants[MU_LAMBDA_SCALE];
196 REAL lambda = prob_data_s11.physconstants[LAMBDA]*scale;
197 REAL mu = prob_data_s11.physconstants[MU]*scale;
198 REAL response_block[DIM*DIM];
199 // prob_data_s11.f_sources = new rhs_th_ph_rho(0, -beta_ap[4]);//(0, beta_ap[4]);eigentl. doch ok?
200 // prob_data_s22.f_sources = new dw_rhs_2ph_general(1, beta_ap[4]);//(1, -beta_ap[4]);
201
202
203
204 REAL lambdaplus2mu = lambda + 2.0*mu ;
205
206 //Blockmatrizen der Antwortfkt berechnen
207 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
208 response_block[0] = lambdaplus2mu;
209 response_block[DIM+1] = mu;
210 if (DIM==3) response_block[2*DIM+2] = mu;
211
212 prob_data_s11.diffmat = new const_full_mat(response_block);
213
214 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
215 response_block[0] = mu;
216 response_block[DIM+1] = lambdaplus2mu;
217 if (DIM==3) response_block[2*DIM+2] = mu;
218 prob_data_s22.diffmat = new const_full_mat(response_block);
219 if (DIM==3)
220 {
221 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
222 response_block[0] = mu;
223 response_block[DIM+1] = mu;
224 response_block[2*DIM+2] = lambdaplus2mu;
225 prob_data_s33.diffmat = new const_full_mat(response_block);
226 }
227 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
228 response_block[1] = lambda;
229 response_block[DIM] = mu;
230 prob_data_s12.diffmat = new const_full_mat(response_block);
231 //notwendig??
232 response_block[1] = mu;
233 response_block[DIM] = lambda;
234 prob_data_s21.diffmat = new const_full_mat(response_block);
235 if (DIM==3)
236 {
237 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
238 response_block[2] = lambda;
239 response_block[2*DIM] = mu;
240 prob_data_s13.diffmat = new const_full_mat(response_block);
241 //notwendig??
242 response_block[2] = mu;
243 response_block[2*DIM] = lambda;
244 prob_data_s31.diffmat = new const_full_mat(response_block);
245
246 memset(&response_block, 0, sizeof(REAL[DIM*DIM]));
247 response_block[2*DIM -1]= lambda;
248 response_block[2*DIM+1] = mu;
249 prob_data_s23.diffmat = new const_full_mat(response_block);
250 //notwendig??
251 response_block[2*DIM -1] = mu;
252 response_block[2*DIM+1] = lambda;
253 prob_data_s32.diffmat = new const_full_mat(response_block);
254 }
255 prob_data_s11.flags = prob_data_s22.flags = prob_data_s33.flags
256 = prob_data_s21.flags = prob_data_s32.flags = prob_data_s31.flags
257 = prob_data_s12.flags = prob_data_s13.flags = prob_data_s23.flags =DIFFMAT_PW_CONST | DIFFMAT_FULL;
258 // prob_data..flags= DIFFMAT_PW_CONST;
259 }
260
261 /*berechnet den Index eines Elementes einer als Vektor abgespeicherten Symmetrischen Matrix
262 z.B
263 0 1 2 3
264 4 5 6
265 7 8
266 9
267 */
268 #endif