1 | /*!\file Matestar.c
|
---|
2 | * \brief: implementation of the Matestar object
|
---|
3 | */
|
---|
4 |
|
---|
5 | #ifdef HAVE_CONFIG_H
|
---|
6 | #include <config.h>
|
---|
7 | #else
|
---|
8 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | #include "./Matestar.h"
|
---|
12 | #include "./Materials.h"
|
---|
13 | #include "../Inputs/Input.h"
|
---|
14 | #include "../Inputs/Inputs.h"
|
---|
15 | #include "../Inputs/TriaInput.h"
|
---|
16 | #include "../Inputs/PentaInput.h"
|
---|
17 | #include "../Inputs/ControlInput.h"
|
---|
18 | #include "../Elements/Element.h"
|
---|
19 | #include "../Elements/Tria.h"
|
---|
20 | #include "../Elements/Penta.h"
|
---|
21 | #include "../Params/Parameters.h"
|
---|
22 | #include "../Vertex.h"
|
---|
23 | #include "../Hook.h"
|
---|
24 | #include "../Node.h"
|
---|
25 | #include "../IoModel.h"
|
---|
26 | #include "../../shared/shared.h"
|
---|
27 |
|
---|
28 | /*Matestar constructors and destructor*/
|
---|
29 | Matestar::Matestar(){/*{{{*/
|
---|
30 | this->helement=NULL;
|
---|
31 | this->element=NULL;
|
---|
32 | return;
|
---|
33 | }
|
---|
34 | /*}}}*/
|
---|
35 | Matestar::Matestar(int matestar_mid,int index, IoModel* iomodel){/*{{{*/
|
---|
36 |
|
---|
37 | /*Intermediaries:*/
|
---|
38 | int matestar_eid;
|
---|
39 |
|
---|
40 | /*Initialize id*/
|
---|
41 | this->mid=matestar_mid;
|
---|
42 |
|
---|
43 | /*Hooks: */
|
---|
44 | matestar_eid=index+1;
|
---|
45 | this->helement=new Hook(&matestar_eid,1);
|
---|
46 | this->element=NULL;
|
---|
47 |
|
---|
48 | return;
|
---|
49 | }
|
---|
50 | /*}}}*/
|
---|
51 | Matestar::~Matestar(){/*{{{*/
|
---|
52 | delete helement;
|
---|
53 | return;
|
---|
54 | }
|
---|
55 | /*}}}*/
|
---|
56 |
|
---|
57 | /*Object virtual functions definitions:*/
|
---|
58 | Object* Matestar::copy() {/*{{{*/
|
---|
59 |
|
---|
60 | /*Output*/
|
---|
61 | Matestar* matestar=NULL;
|
---|
62 |
|
---|
63 | /*Initialize output*/
|
---|
64 | matestar=new Matestar();
|
---|
65 |
|
---|
66 | /*copy fields: */
|
---|
67 | matestar->mid=this->mid;
|
---|
68 | matestar->helement=(Hook*)this->helement->copy();
|
---|
69 | matestar->element =(Element*)this->helement->delivers();
|
---|
70 |
|
---|
71 | return matestar;
|
---|
72 | }
|
---|
73 | /*}}}*/
|
---|
74 | Material* Matestar::copy2(Element* element_in) {/*{{{*/
|
---|
75 |
|
---|
76 | /*Output*/
|
---|
77 | Matestar* matestar=NULL;
|
---|
78 |
|
---|
79 | /*Initialize output*/
|
---|
80 | matestar=new Matestar();
|
---|
81 |
|
---|
82 | /*copy fields: */
|
---|
83 | matestar->mid=this->mid;
|
---|
84 | matestar->helement=(Hook*)this->helement->copy();
|
---|
85 | matestar->element =element_in;
|
---|
86 |
|
---|
87 | return matestar;
|
---|
88 | }
|
---|
89 | /*}}}*/
|
---|
90 | void Matestar::DeepEcho(void){/*{{{*/
|
---|
91 |
|
---|
92 | _printf_("Matestar:\n");
|
---|
93 | _printf_(" mid: " << mid << "\n");
|
---|
94 | _printf_(" element:\n");
|
---|
95 | helement->Echo();
|
---|
96 | }
|
---|
97 | /*}}}*/
|
---|
98 | void Matestar::Echo(void){/*{{{*/
|
---|
99 |
|
---|
100 | _printf_("Matestar:\n");
|
---|
101 | _printf_(" mid: " << mid << "\n");
|
---|
102 | _printf_(" element:\n");
|
---|
103 | helement->Echo();
|
---|
104 | }
|
---|
105 | /*}}}*/
|
---|
106 | int Matestar::Id(void){ return mid; }/*{{{*/
|
---|
107 | /*}}}*/
|
---|
108 | void Matestar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
|
---|
109 |
|
---|
110 | if(marshall_direction==MARSHALLING_BACKWARD)helement=new Hook();
|
---|
111 |
|
---|
112 | MARSHALLING_ENUM(MatestarEnum);
|
---|
113 | MARSHALLING(mid);
|
---|
114 | this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
|
---|
115 | this->element=(Element*)this->helement->delivers();
|
---|
116 |
|
---|
117 | }
|
---|
118 | /*}}}*/
|
---|
119 | int Matestar::ObjectEnum(void){/*{{{*/
|
---|
120 |
|
---|
121 | return MatestarEnum;
|
---|
122 |
|
---|
123 | }
|
---|
124 | /*}}}*/
|
---|
125 |
|
---|
126 | /*Matestar management*/
|
---|
127 | void Matestar::Configure(Elements* elementsin){/*{{{*/
|
---|
128 |
|
---|
129 | /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
|
---|
130 | * datasets, using internal ids and offsets hidden in hooks: */
|
---|
131 | helement->configure((DataSet*)elementsin);
|
---|
132 | this->element = (Element*)helement->delivers();
|
---|
133 | }
|
---|
134 | /*}}}*/
|
---|
135 | IssmDouble Matestar::GetA(){/*{{{*/
|
---|
136 | /*
|
---|
137 | * A = 1/B^n
|
---|
138 | */
|
---|
139 |
|
---|
140 | IssmDouble B,n;
|
---|
141 |
|
---|
142 | element->inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
|
---|
143 | n=this->GetN();
|
---|
144 |
|
---|
145 | return pow(B,-n);
|
---|
146 | }
|
---|
147 | /*}}}*/
|
---|
148 | IssmDouble Matestar::GetAbar(){/*{{{*/
|
---|
149 | /*
|
---|
150 | * A = 1/B^n
|
---|
151 | */
|
---|
152 |
|
---|
153 | IssmDouble B,n;
|
---|
154 |
|
---|
155 | element->inputs->GetInputAverage(&B,MaterialsRheologyBbarEnum);
|
---|
156 | n=this->GetN();
|
---|
157 |
|
---|
158 | return pow(B,-n);
|
---|
159 | }
|
---|
160 | /*}}}*/
|
---|
161 | IssmDouble Matestar::GetB(){/*{{{*/
|
---|
162 |
|
---|
163 | /*Output*/
|
---|
164 | IssmDouble B;
|
---|
165 |
|
---|
166 | element->inputs->GetInputAverage(&B,MaterialsRheologyBEnum);
|
---|
167 | return B;
|
---|
168 | }
|
---|
169 | /*}}}*/
|
---|
170 | IssmDouble Matestar::GetBbar(){/*{{{*/
|
---|
171 |
|
---|
172 | /*Output*/
|
---|
173 | IssmDouble Bbar;
|
---|
174 |
|
---|
175 | element->inputs->GetInputAverage(&Bbar,MaterialsRheologyBbarEnum);
|
---|
176 | return Bbar;
|
---|
177 | }
|
---|
178 | /*}}}*/
|
---|
179 | IssmDouble Matestar::GetD(){/*{{{*/
|
---|
180 | _error_("not implemented yet");
|
---|
181 | }
|
---|
182 | /*}}}*/
|
---|
183 | IssmDouble Matestar::GetDbar(){/*{{{*/
|
---|
184 |
|
---|
185 | _error_("not implemented yet");
|
---|
186 | }
|
---|
187 | /*}}}*/
|
---|
188 | IssmDouble Matestar::GetEc(){/*{{{*/
|
---|
189 |
|
---|
190 | /*Output*/
|
---|
191 | IssmDouble Ec;
|
---|
192 |
|
---|
193 | element->inputs->GetInputAverage(&Ec,MaterialsRheologyEcEnum);
|
---|
194 | return Ec;
|
---|
195 | }
|
---|
196 | /*}}}*/
|
---|
197 | IssmDouble Matestar::GetEcbar(){/*{{{*/
|
---|
198 |
|
---|
199 | /*Output*/
|
---|
200 | IssmDouble Ecbar;
|
---|
201 |
|
---|
202 | element->inputs->GetInputAverage(&Ecbar,MaterialsRheologyEcbarEnum);
|
---|
203 | return Ecbar;
|
---|
204 | }
|
---|
205 | /*}}}*/
|
---|
206 | IssmDouble Matestar::GetEs(){/*{{{*/
|
---|
207 |
|
---|
208 | /*Output*/
|
---|
209 | IssmDouble Es;
|
---|
210 |
|
---|
211 | element->inputs->GetInputAverage(&Es,MaterialsRheologyEsEnum);
|
---|
212 | return Es;
|
---|
213 | }
|
---|
214 | /*}}}*/
|
---|
215 | IssmDouble Matestar::GetEsbar(){/*{{{*/
|
---|
216 |
|
---|
217 | /*Output*/
|
---|
218 | IssmDouble Esbar;
|
---|
219 |
|
---|
220 | element->inputs->GetInputAverage(&Esbar,MaterialsRheologyEsbarEnum);
|
---|
221 | return Esbar;
|
---|
222 | }
|
---|
223 | /*}}}*/
|
---|
224 | IssmDouble Matestar::GetN(){/*{{{*/
|
---|
225 |
|
---|
226 | /*Output*/
|
---|
227 | IssmDouble n=3.0;
|
---|
228 | return n;
|
---|
229 | }
|
---|
230 | /*}}}*/
|
---|
231 | void Matestar::GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff){/*{{{*/
|
---|
232 | _error_("not implemented yet");
|
---|
233 | }
|
---|
234 | /*}}}*/
|
---|
235 | void Matestar::GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){/*{{{*/
|
---|
236 | _error_("not implemented yet");
|
---|
237 | }
|
---|
238 | /*}}}*/
|
---|
239 | void Matestar::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){/*{{{*/
|
---|
240 | _error_("not implemented yet");
|
---|
241 | }
|
---|
242 | /*}}}*/
|
---|
243 | void Matestar::GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){/*{{{*/
|
---|
244 | _error_("not implemented yet");
|
---|
245 | }
|
---|
246 | /*}}}*/
|
---|
247 | void Matestar::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){/*{{{*/
|
---|
248 | _error_("not implemented yet");
|
---|
249 | }
|
---|
250 | /*}}}*/
|
---|
251 | IssmDouble Matestar::GetViscosityGeneral(IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz,bool isdepthaveraged){/*{{{*/
|
---|
252 |
|
---|
253 | /*output: */
|
---|
254 | IssmDouble viscosity;
|
---|
255 |
|
---|
256 | /*Intermediaries*/
|
---|
257 | IssmDouble epseff,epsprime_norm;
|
---|
258 | IssmDouble lambdas;
|
---|
259 | IssmDouble vmag,dvmag[3];
|
---|
260 | IssmDouble B,Ec,Es,E,n;
|
---|
261 |
|
---|
262 | /*Calculate velocity magnitude and its derivative*/
|
---|
263 | vmag = sqrt(vx*vx+vy*vy+vz*vz);
|
---|
264 | if(vmag<1e-12){
|
---|
265 | dvmag[0]=0;
|
---|
266 | dvmag[1]=0;
|
---|
267 | dvmag[2]=0;
|
---|
268 | }
|
---|
269 | else{
|
---|
270 | dvmag[0]=1./(2*sqrt(vmag))*(2*vx*dvx[0]+2*vy*dvy[0]+2*vz*dvz[0]);
|
---|
271 | dvmag[1]=1./(2*sqrt(vmag))*(2*vx*dvx[1]+2*vy*dvy[1]+2*vz*dvz[1]);
|
---|
272 | dvmag[2]=1./(2*sqrt(vmag))*(2*vx*dvx[2]+2*vy*dvy[2]+2*vz*dvz[2]);
|
---|
273 | }
|
---|
274 |
|
---|
275 | EstarStrainrateQuantities(&epseff,&epsprime_norm,vx,vy,vz,vmag,dvx,dvy,dvz,&dvmag[0]);
|
---|
276 | lambdas=EstarLambdaS(epseff,epsprime_norm);
|
---|
277 |
|
---|
278 | /*Get B and enhancement*/
|
---|
279 | n=GetN(); _assert_(n>0.);
|
---|
280 | if (isdepthaveraged==0.){
|
---|
281 | B=GetB(); _assert_(B>0.);
|
---|
282 | Ec=GetEc(); _assert_(Ec>=0.);
|
---|
283 | Es=GetEs(); _assert_(Es>=0.);
|
---|
284 | }
|
---|
285 | else{
|
---|
286 | B=GetBbar(); _assert_(B>0.);
|
---|
287 | Ec=GetEcbar(); _assert_(Ec>=0.);
|
---|
288 | Es=GetEsbar(); _assert_(Es>=0.);
|
---|
289 | }
|
---|
290 |
|
---|
291 | /*Get total enhancement factor E(lambdas)*/
|
---|
292 | E = Ec + (Es-Ec)*lambdas*lambdas; _assert_(E>0.);
|
---|
293 |
|
---|
294 | /*Compute viscosity*/
|
---|
295 | /*if no strain rate, return maximum viscosity*/
|
---|
296 | if(epseff==0.){
|
---|
297 | viscosity = 1.e+14/2.;
|
---|
298 | //viscosity = B;
|
---|
299 | //viscosity=2.5*pow(10.,17);
|
---|
300 | }
|
---|
301 | else{
|
---|
302 | viscosity = B/(2.*pow(E,1./n)*pow(epseff,2./n));
|
---|
303 | }
|
---|
304 |
|
---|
305 | /*Assign output pointer*/
|
---|
306 | return viscosity;
|
---|
307 | }
|
---|
308 | /*}}}*/
|
---|
309 | IssmDouble Matestar::GetViscosity_BGeneral(IssmDouble vx,IssmDouble vy,IssmDouble vz,IssmDouble* dvx,IssmDouble* dvy,IssmDouble* dvz,bool isdepthaveraged){/*{{{*/
|
---|
310 |
|
---|
311 | /*Intermediaries*/
|
---|
312 | IssmDouble dmudB;
|
---|
313 | IssmDouble epseff,epsprime_norm;
|
---|
314 | IssmDouble lambdas;
|
---|
315 | IssmDouble vmag,dvmag[3];
|
---|
316 | IssmDouble Ec,Es,E;
|
---|
317 |
|
---|
318 | /*Calculate velocity magnitude and its derivative*/
|
---|
319 | vmag = sqrt(vx*vx+vy*vy+vz*vz);
|
---|
320 | if(vmag<1e-12){
|
---|
321 | dvmag[0]=0;
|
---|
322 | dvmag[1]=0;
|
---|
323 | dvmag[2]=0;
|
---|
324 | }
|
---|
325 | else{
|
---|
326 | dvmag[0]=1./(2*sqrt(vmag))*(2*vx*dvx[0]+2*vy*dvy[0]+2*vz*dvz[0]);
|
---|
327 | dvmag[1]=1./(2*sqrt(vmag))*(2*vx*dvx[1]+2*vy*dvy[1]+2*vz*dvz[1]);
|
---|
328 | dvmag[2]=1./(2*sqrt(vmag))*(2*vx*dvx[2]+2*vy*dvy[2]+2*vz*dvz[2]);
|
---|
329 | }
|
---|
330 |
|
---|
331 | EstarStrainrateQuantities(&epseff,&epsprime_norm,vx,vy,vz,vmag,dvx,dvy,dvz,&dvmag[0]);
|
---|
332 | lambdas=EstarLambdaS(epseff,epsprime_norm);
|
---|
333 |
|
---|
334 | /*Get enhancement*/
|
---|
335 | if (isdepthaveraged==0.){
|
---|
336 | Ec=GetEc(); _assert_(Ec>=0.);
|
---|
337 | Es=GetEs(); _assert_(Es>=0.);
|
---|
338 | }
|
---|
339 | else{
|
---|
340 | Ec=GetEcbar(); _assert_(Ec>=0.);
|
---|
341 | Es=GetEsbar(); _assert_(Es>=0.);
|
---|
342 | }
|
---|
343 |
|
---|
344 | /*Get total enhancement factor E(lambdas)*/
|
---|
345 | E = Ec + (Es-Ec)*lambdas*lambdas; _assert_(E>0.);
|
---|
346 |
|
---|
347 | /*Compute dmudB*/
|
---|
348 | if(epseff==0.) dmudB = 0.;
|
---|
349 | else dmudB = 1./(2.*pow(E,1./3.)*pow(epseff,2./3.));
|
---|
350 |
|
---|
351 | /*Assign output*/
|
---|
352 | return dmudB;
|
---|
353 |
|
---|
354 | }
|
---|
355 | /*}}}*/
|
---|
356 | void Matestar::GetViscosity_B(IssmDouble* pdmudB,IssmDouble eps_eff){/*{{{*/
|
---|
357 | _error_("not implemented yet");
|
---|
358 | }
|
---|
359 | /*}}}*/
|
---|
360 | void Matestar::GetViscosity_D(IssmDouble* pdmudD,IssmDouble eps_eff){/*{{{*/
|
---|
361 | _error_("not implemented yet");
|
---|
362 | }
|
---|
363 | /*}}}*/
|
---|
364 | void Matestar::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){/*{{{*/
|
---|
365 | _error_("not implemented yet");
|
---|
366 | }
|
---|
367 | /*}}}*/
|
---|
368 | void Matestar::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
|
---|
369 | /*Nothing updated yet*/
|
---|
370 | }
|
---|
371 | /*}}}*/
|
---|
372 | void Matestar::InputUpdateFromConstant(int constant, int name){/*{{{*/
|
---|
373 | /*Nothing updated yet*/
|
---|
374 | }
|
---|
375 | /*}}}*/
|
---|
376 | void Matestar::InputUpdateFromConstant(bool constant, int name){/*{{{*/
|
---|
377 | /*Nothing updated yet*/
|
---|
378 | }
|
---|
379 | /*}}}*/
|
---|
380 | void Matestar::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
|
---|
381 | /*Nothing updated yet*/
|
---|
382 | }
|
---|
383 | /*}}}*/
|
---|
384 | void Matestar::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
|
---|
385 |
|
---|
386 | }
|
---|
387 | /*}}}*/
|
---|
388 | void Matestar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
|
---|
389 |
|
---|
390 | }
|
---|
391 | /*}}}*/
|
---|
392 | bool Matestar::IsDamage(){/*{{{*/
|
---|
393 |
|
---|
394 | _error_("not implemented yet");
|
---|
395 | }
|
---|
396 | /*}}}*/
|
---|
397 | void Matestar::ResetHooks(){/*{{{*/
|
---|
398 |
|
---|
399 | this->element=NULL;
|
---|
400 |
|
---|
401 | /*Get Element type*/
|
---|
402 | this->helement->reset();
|
---|
403 |
|
---|
404 | }
|
---|
405 | /*}}}*/
|
---|
406 | void Matestar::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
|
---|
407 |
|
---|
408 | }
|
---|
409 | /*}}}*/
|
---|
410 | void Matestar::ViscosityBFS(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){/*{{{*/
|
---|
411 |
|
---|
412 | /*Intermediaries*/
|
---|
413 | IssmDouble vx,vy,vz;
|
---|
414 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
415 | bool isdepthaveraged=0.;
|
---|
416 |
|
---|
417 | /*Get velocity derivatives in all directions*/
|
---|
418 | _assert_(dim>1);
|
---|
419 | _assert_(vx_input);
|
---|
420 | vx_input->GetInputValue(&vx,gauss);
|
---|
421 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
422 | _assert_(vy_input);
|
---|
423 | vy_input->GetInputValue(&vy,gauss);
|
---|
424 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
425 | if(dim==3){
|
---|
426 | _assert_(vz_input);
|
---|
427 | vz_input->GetInputValue(&vz,gauss);
|
---|
428 | vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
|
---|
429 | }
|
---|
430 | else{
|
---|
431 | vz = 0.;
|
---|
432 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = 0.;
|
---|
433 | }
|
---|
434 |
|
---|
435 | /*Compute dmudB*/
|
---|
436 | *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
437 | }
|
---|
438 | /*}}}*/
|
---|
439 | void Matestar::ViscosityBHO(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
|
---|
440 |
|
---|
441 | /*Intermediaries*/
|
---|
442 | IssmDouble vx,vy,vz;
|
---|
443 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
444 | bool isdepthaveraged=0.;
|
---|
445 |
|
---|
446 | /*Get velocity derivatives in all directions*/
|
---|
447 | _assert_(dim==2 || dim==3);
|
---|
448 | _assert_(vx_input);
|
---|
449 | vx_input->GetInputValue(&vx,gauss);
|
---|
450 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
451 | if(dim==3){
|
---|
452 | _assert_(vy_input);
|
---|
453 | vy_input->GetInputValue(&vy,gauss);
|
---|
454 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
455 | }
|
---|
456 | else{
|
---|
457 | dvx[2] = 0.;
|
---|
458 | vy = 0.;
|
---|
459 | dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
|
---|
460 | }
|
---|
461 | vz = 0.;
|
---|
462 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
|
---|
463 |
|
---|
464 | /*Compute viscosity*/
|
---|
465 | *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
466 | }/*}}}*/
|
---|
467 | void Matestar::ViscosityBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
|
---|
468 | /*Intermediaries*/
|
---|
469 | IssmDouble vx,vy,vz;
|
---|
470 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
471 | bool isdepthaveraged=1.;
|
---|
472 |
|
---|
473 | /*Get velocity derivatives in all directions*/
|
---|
474 | _assert_(dim==1 || dim==2);
|
---|
475 | _assert_(vx_input);
|
---|
476 | vx_input->GetInputValue(&vx,gauss);
|
---|
477 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
478 | if(dim==2){
|
---|
479 | _assert_(vy_input);
|
---|
480 | vy_input->GetInputValue(&vy,gauss);
|
---|
481 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
482 | }
|
---|
483 | else{
|
---|
484 | dvx[1] = 0.;
|
---|
485 | dvx[2] = 0.;
|
---|
486 | vy = 0.;
|
---|
487 | dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
|
---|
488 | }
|
---|
489 | dvx[2] = 0.;
|
---|
490 | dvy[2] = 0.;
|
---|
491 | vz = 0.;
|
---|
492 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
|
---|
493 |
|
---|
494 | /*Compute viscosity*/
|
---|
495 | *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
496 | }/*}}}*/
|
---|
497 | void Matestar::ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){/*{{{*/
|
---|
498 |
|
---|
499 | /*Intermediaries*/
|
---|
500 | IssmDouble vx,vy,vz;
|
---|
501 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
502 | bool isdepthaveraged=0.;
|
---|
503 |
|
---|
504 | /*Get velocity derivatives in all directions*/
|
---|
505 | _assert_(dim>1);
|
---|
506 | _assert_(vx_input);
|
---|
507 | vx_input->GetInputValue(&vx,gauss);
|
---|
508 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
509 | _assert_(vy_input);
|
---|
510 | vy_input->GetInputValue(&vy,gauss);
|
---|
511 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
512 | if(dim==3){
|
---|
513 | _assert_(vz_input);
|
---|
514 | vz_input->GetInputValue(&vz,gauss);
|
---|
515 | vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
|
---|
516 | }
|
---|
517 | else{
|
---|
518 | vz = 0.;
|
---|
519 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = 0.;
|
---|
520 | }
|
---|
521 |
|
---|
522 | /*Compute viscosity*/
|
---|
523 | *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
524 | }
|
---|
525 | /*}}}*/
|
---|
526 | void Matestar::ViscosityFSDerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon){/*{{{*/
|
---|
527 | this->GetViscosityDerivativeEpsSquare(pmu_prime,epsilon);
|
---|
528 | }/*}}}*/
|
---|
529 | void Matestar::ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
|
---|
530 |
|
---|
531 | /*Intermediaries*/
|
---|
532 | IssmDouble vx,vy,vz;
|
---|
533 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
534 | bool isdepthaveraged=0.;
|
---|
535 |
|
---|
536 | /*Get velocity derivatives in all directions*/
|
---|
537 | _assert_(dim==2 || dim==3);
|
---|
538 | _assert_(vx_input);
|
---|
539 | vx_input->GetInputValue(&vx,gauss);
|
---|
540 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
541 | if(dim==3){
|
---|
542 | _assert_(vy_input);
|
---|
543 | vy_input->GetInputValue(&vy,gauss);
|
---|
544 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
545 | }
|
---|
546 | else{
|
---|
547 | dvx[2] = 0.;
|
---|
548 | vy = 0.;
|
---|
549 | dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
|
---|
550 | }
|
---|
551 | vz = 0.;
|
---|
552 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
|
---|
553 |
|
---|
554 | /*Compute viscosity*/
|
---|
555 | *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
556 | }/*}}}*/
|
---|
557 | void Matestar::ViscosityHODerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon){/*{{{*/
|
---|
558 | _error_("not implemented yet");
|
---|
559 | }/*}}}*/
|
---|
560 | void Matestar::ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surface_input){/*{{{*/
|
---|
561 | _error_("not implemented yet");
|
---|
562 | }/*}}}*/
|
---|
563 | void Matestar::ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
|
---|
564 |
|
---|
565 | /*Intermediaries*/
|
---|
566 | IssmDouble vx,vy,vz;
|
---|
567 | IssmDouble dvx[3],dvy[3],dvz[3];
|
---|
568 | bool isdepthaveraged=1.;
|
---|
569 |
|
---|
570 | /*Get velocity derivatives in all directions*/
|
---|
571 | _assert_(dim==1 || dim==2);
|
---|
572 | _assert_(vx_input);
|
---|
573 | vx_input->GetInputValue(&vx,gauss);
|
---|
574 | vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
|
---|
575 | if(dim==2){
|
---|
576 | _assert_(vy_input);
|
---|
577 | vy_input->GetInputValue(&vy,gauss);
|
---|
578 | vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
|
---|
579 | }
|
---|
580 | else{
|
---|
581 | dvx[1] = 0.;
|
---|
582 | dvx[2] = 0.;
|
---|
583 | vy = 0.;
|
---|
584 | dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
|
---|
585 | }
|
---|
586 | dvx[2] = 0.;
|
---|
587 | dvy[2] = 0.;
|
---|
588 | vz = 0.;
|
---|
589 | dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
|
---|
590 |
|
---|
591 | /*Compute viscosity*/
|
---|
592 | *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],isdepthaveraged);
|
---|
593 | }/*}}}*/
|
---|
594 | void Matestar::ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon){/*{{{*/
|
---|
595 | _error_("not implemented yet");
|
---|
596 | }/*}}}*/
|
---|