Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Private Attributes
Matestar Class Reference

#include <Matestar.h>

Inheritance diagram for Matestar:
Material Object

Public Member Functions

 Matestar ()
 
 Matestar (int mid, int i, IoModel *iomodel)
 
 ~Matestar ()
 
Objectcopy ()
 
void DeepEcho ()
 
void Echo ()
 
int Id ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum ()
 
void Configure (Elements *elements)
 
Materialcopy2 (Element *element)
 
void GetViscosity (IssmDouble *pviscosity, IssmDouble eps_eff, Gauss *gauss)
 
void GetViscosityBar (IssmDouble *pviscosity, IssmDouble eps_eff, Gauss *gauss)
 
void GetViscosityComplement (IssmDouble *pviscosity_complement, IssmDouble *pepsilon, Gauss *gauss)
 
void GetViscosityDComplement (IssmDouble *, IssmDouble *, Gauss *gauss)
 
void GetViscosityDerivativeEpsSquare (IssmDouble *pmu_prime, IssmDouble *pepsilon, Gauss *gauss)
 
void GetViscosity_B (IssmDouble *pviscosity, IssmDouble eps_eff, Gauss *gauss)
 
void GetViscosity_D (IssmDouble *pviscosity, IssmDouble eps_eff, Gauss *gauss)
 
void GetViscosity2dDerivativeEpsSquare (IssmDouble *pmu_prime, IssmDouble *pepsilon, Gauss *gauss)
 
IssmDouble GetA (Gauss *gauss)
 
IssmDouble GetAbar (Gauss *gauss)
 
IssmDouble GetB (Gauss *gauss)
 
IssmDouble GetBbar (Gauss *gauss)
 
IssmDouble GetD (Gauss *gauss)
 
IssmDouble GetDbar (Gauss *gauss)
 
IssmDouble GetEc (Gauss *gauss)
 
IssmDouble GetEcbar (Gauss *gauss)
 
IssmDouble GetEs (Gauss *gauss)
 
IssmDouble GetEsbar (Gauss *gauss)
 
IssmDouble GetN ()
 
bool IsDamage ()
 
bool IsEnhanced ()
 
void ResetHooks ()
 
void SetCurrentConfiguration (Elements *elements, Loads *loads, Nodes *nodes, Vertices *vertices, Materials *materials, Parameters *parameters)
 
void ViscosityFSDerivativeEpsSquare (IssmDouble *pmu_prime, IssmDouble *epsilon, Gauss *gauss)
 
void ViscosityHODerivativeEpsSquare (IssmDouble *pmu_prime, IssmDouble *epsilon, Gauss *gauss)
 
void ViscositySSADerivativeEpsSquare (IssmDouble *pmu_prime, IssmDouble *epsilon, Gauss *gauss)
 
void ViscosityFS (IssmDouble *pviscosity, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, Input2 *vz_input)
 
void ViscosityHO (IssmDouble *pviscosity, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input)
 
void ViscosityL1L2 (IssmDouble *pviscosity, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, Input2 *surf)
 
void ViscositySSA (IssmDouble *pviscosity, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input)
 
void ViscosityBFS (IssmDouble *pmudB, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, Input2 *vz_input, IssmDouble eps_eff)
 
void ViscosityBHO (IssmDouble *pmudB, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, IssmDouble eps_eff)
 
void ViscosityBSSA (IssmDouble *pmudB, int dim, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, IssmDouble eps_eff)
 
IssmDouble GetViscosityGeneral (IssmDouble vx, IssmDouble vy, IssmDouble vz, IssmDouble *dvx, IssmDouble *dvy, IssmDouble *dvz, IssmDouble eps_eff, bool isdepthaveraged, Gauss *gauss)
 
IssmDouble GetViscosity_BGeneral (IssmDouble vx, IssmDouble vy, IssmDouble vz, IssmDouble *dvx, IssmDouble *dvy, IssmDouble *dvz, IssmDouble eps_eff, bool isdepthaveraged, Gauss *gauss)
 
- Public Member Functions inherited from Material
virtual ~Material ()
 
- Public Member Functions inherited from Object
virtual ~Object ()
 

Private Attributes

int mid
 
Hookhelement
 
Elementelement
 
int rheology_law
 

Detailed Description

Definition at line 24 of file Matestar.h.

Constructor & Destructor Documentation

◆ Matestar() [1/2]

Matestar::Matestar ( )

Definition at line 24 of file Matestar.cpp.

24  {/*{{{*/
25  this->helement=NULL;
26  this->element=NULL;
27  return;
28 }

◆ Matestar() [2/2]

Matestar::Matestar ( int  mid,
int  i,
IoModel iomodel 
)

Definition at line 30 of file Matestar.cpp.

30  {/*{{{*/
31 
32  /*Intermediaries:*/
33  int matestar_eid;
34 
35  /*Initialize id*/
36  this->mid=matestar_mid;
37 
38  /*Hooks: */
39  matestar_eid=index+1;
40  this->helement=new Hook(&matestar_eid,1);
41  this->element=NULL;
42 
43  return;
44 }

◆ ~Matestar()

Matestar::~Matestar ( )

Definition at line 46 of file Matestar.cpp.

46  {/*{{{*/
47  delete helement;
48  return;
49 }

Member Function Documentation

◆ copy()

Object * Matestar::copy ( void  )
virtual

Implements Object.

Definition at line 53 of file Matestar.cpp.

53  {/*{{{*/
54 
55  /*Output*/
56  Matestar* matestar=NULL;
57 
58  /*Initialize output*/
59  matestar=new Matestar();
60 
61  /*copy fields: */
62  matestar->mid=this->mid;
63  matestar->helement=(Hook*)this->helement->copy();
64  matestar->element =(Element*)this->helement->delivers();
65 
66  return matestar;
67 }

◆ DeepEcho()

void Matestar::DeepEcho ( void  )
virtual

Implements Object.

Definition at line 85 of file Matestar.cpp.

85  {/*{{{*/
86 
87  _printf_("Matestar:\n");
88  _printf_(" mid: " << mid << "\n");
89  _printf_(" element:\n");
90  helement->Echo();
91 }

◆ Echo()

void Matestar::Echo ( void  )
virtual

Implements Object.

Definition at line 93 of file Matestar.cpp.

93  {/*{{{*/
94 
95  _printf_("Matestar:\n");
96  _printf_(" mid: " << mid << "\n");
97  _printf_(" element:\n");
98  helement->Echo();
99 }

◆ Id()

int Matestar::Id ( void  )
virtual

Implements Object.

Definition at line 101 of file Matestar.cpp.

101 { return mid; }/*{{{*/

◆ Marshall()

void Matestar::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
virtual

Implements Object.

Definition at line 103 of file Matestar.cpp.

103  { /*{{{*/
104 
105  if(marshall_direction==MARSHALLING_BACKWARD)helement=new Hook();
106 
108  MARSHALLING(mid);
109  this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
110  this->element=(Element*)this->helement->delivers();
111 
112 }

◆ ObjectEnum()

int Matestar::ObjectEnum ( void  )
virtual

Implements Object.

Definition at line 114 of file Matestar.cpp.

114  {/*{{{*/
115 
116  return MatestarEnum;
117 
118 }

◆ Configure()

void Matestar::Configure ( Elements elements)
virtual

Implements Material.

Definition at line 122 of file Matestar.cpp.

122  {/*{{{*/
123 
124  /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
125  * datasets, using internal ids and offsets hidden in hooks: */
126  helement->configure((DataSet*)elementsin);
127  this->element = (Element*)helement->delivers();
128 }

◆ copy2()

Material * Matestar::copy2 ( Element element)
virtual

Implements Material.

Definition at line 69 of file Matestar.cpp.

69  {/*{{{*/
70 
71  /*Output*/
72  Matestar* matestar=NULL;
73 
74  /*Initialize output*/
75  matestar=new Matestar();
76 
77  /*copy fields: */
78  matestar->mid=this->mid;
79  matestar->helement=(Hook*)this->helement->copy();
80  matestar->element =element_in;
81 
82  return matestar;
83 }

◆ GetViscosity()

void Matestar::GetViscosity ( IssmDouble pviscosity,
IssmDouble  eps_eff,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 228 of file Matestar.cpp.

228  {/*{{{*/
229  _error_("not implemented yet");
230 }

◆ GetViscosityBar()

void Matestar::GetViscosityBar ( IssmDouble pviscosity,
IssmDouble  eps_eff,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 232 of file Matestar.cpp.

232  {/*{{{*/
233  _error_("not implemented yet");
234 }

◆ GetViscosityComplement()

void Matestar::GetViscosityComplement ( IssmDouble pviscosity_complement,
IssmDouble pepsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 236 of file Matestar.cpp.

236  {/*{{{*/
237  _error_("not implemented yet");
238 }

◆ GetViscosityDComplement()

void Matestar::GetViscosityDComplement ( IssmDouble pviscosity_complement,
IssmDouble epsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 240 of file Matestar.cpp.

240  {/*{{{*/
241  _error_("not implemented yet");
242 }

◆ GetViscosityDerivativeEpsSquare()

void Matestar::GetViscosityDerivativeEpsSquare ( IssmDouble pmu_prime,
IssmDouble pepsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 244 of file Matestar.cpp.

244  {/*{{{*/
245  _error_("not implemented yet");
246 }

◆ GetViscosity_B()

void Matestar::GetViscosity_B ( IssmDouble pviscosity,
IssmDouble  eps_eff,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 355 of file Matestar.cpp.

355  {/*{{{*/
356  _error_("not implemented yet");
357 }

◆ GetViscosity_D()

void Matestar::GetViscosity_D ( IssmDouble pviscosity,
IssmDouble  eps_eff,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 359 of file Matestar.cpp.

359  {/*{{{*/
360  _error_("not implemented yet");
361 }

◆ GetViscosity2dDerivativeEpsSquare()

void Matestar::GetViscosity2dDerivativeEpsSquare ( IssmDouble pmu_prime,
IssmDouble pepsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 363 of file Matestar.cpp.

363  {/*{{{*/
364  _error_("not implemented yet");
365 }

◆ GetA()

IssmDouble Matestar::GetA ( Gauss gauss)
virtual

Implements Material.

Definition at line 130 of file Matestar.cpp.

130  {/*{{{*/
131  /*
132  * A = 1/B^n
133  */
134 
135  IssmDouble B=this->GetB(gauss);
136  IssmDouble n=this->GetN();
137 
138  return pow(B,-n);
139 }

◆ GetAbar()

IssmDouble Matestar::GetAbar ( Gauss gauss)
virtual

Implements Material.

Definition at line 141 of file Matestar.cpp.

141  {/*{{{*/
142  /*
143  * A = 1/B^n
144  */
145 
146  IssmDouble B=this->GetBbar(gauss);
147  IssmDouble n=this->GetN();
148 
149  return pow(B,-n);
150 }

◆ GetB()

IssmDouble Matestar::GetB ( Gauss gauss)
virtual

Implements Material.

Definition at line 152 of file Matestar.cpp.

152  {/*{{{*/
153 
154  /*Output*/
155  IssmDouble B;
156 
157  Input2* B_input = element->GetInput2(MaterialsRheologyBEnum); _assert_(B_input);
158  B_input->GetInputValue(&B,gauss);
159  return B;
160 }

◆ GetBbar()

IssmDouble Matestar::GetBbar ( Gauss gauss)
virtual

Implements Material.

Definition at line 162 of file Matestar.cpp.

162  {/*{{{*/
163 
164  /*Output*/
165  IssmDouble Bbar;
166 
168  B_input->GetInputValue(&Bbar,gauss);
169  return Bbar;
170 }

◆ GetD()

IssmDouble Matestar::GetD ( Gauss gauss)
virtual

Implements Material.

Definition at line 172 of file Matestar.cpp.

172  {/*{{{*/
173  _error_("not implemented yet");
174 }

◆ GetDbar()

IssmDouble Matestar::GetDbar ( Gauss gauss)
virtual

Implements Material.

Definition at line 176 of file Matestar.cpp.

176  {/*{{{*/
177 
178  _error_("not implemented yet");
179 }

◆ GetEc()

IssmDouble Matestar::GetEc ( Gauss gauss)

Definition at line 181 of file Matestar.cpp.

181  {/*{{{*/
182 
183  /*Output*/
184  IssmDouble Ec;
185 
186  Input2* Ec_input = element->GetInput2(MaterialsRheologyEcEnum); _assert_(Ec_input);
187  Ec_input->GetInputValue(&Ec,gauss);
188  return Ec;
189 }

◆ GetEcbar()

IssmDouble Matestar::GetEcbar ( Gauss gauss)

Definition at line 191 of file Matestar.cpp.

191  {/*{{{*/
192 
193  /*Output*/
194  IssmDouble Ecbar;
195 
196  Input2* Ecbar_input = element->GetInput2(MaterialsRheologyEcbarEnum); _assert_(Ecbar_input);
197  Ecbar_input->GetInputValue(&Ecbar,gauss);
198  return Ecbar;
199 }

◆ GetEs()

IssmDouble Matestar::GetEs ( Gauss gauss)

Definition at line 201 of file Matestar.cpp.

201  {/*{{{*/
202 
203  /*Output*/
204  IssmDouble Es;
205 
206  Input2* Es_input = element->GetInput2(MaterialsRheologyEsEnum); _assert_(Es_input);
207  Es_input->GetInputValue(&Es,gauss);
208  return Es;
209 }

◆ GetEsbar()

IssmDouble Matestar::GetEsbar ( Gauss gauss)

Definition at line 211 of file Matestar.cpp.

211  {/*{{{*/
212 
213  /*Output*/
214  IssmDouble Esbar;
215 
216  Input2* Esbar_input = element->GetInput2(MaterialsRheologyEsbarEnum); _assert_(Esbar_input);
217  Esbar_input->GetInputValue(&Esbar,gauss);
218  return Esbar;
219 }

◆ GetN()

IssmDouble Matestar::GetN ( )
virtual

Implements Material.

Definition at line 221 of file Matestar.cpp.

221  {/*{{{*/
222 
223  /*Output*/
224  IssmDouble n=3.0;
225  return n;
226 }

◆ IsDamage()

bool Matestar::IsDamage ( )
virtual

Implements Material.

Definition at line 367 of file Matestar.cpp.

367  {/*{{{*/
368 
369  _error_("not implemented yet");
370 }

◆ IsEnhanced()

bool Matestar::IsEnhanced ( )
inlinevirtual

Implements Material.

Definition at line 69 of file Matestar.h.

69 {_error_("not supported");};

◆ ResetHooks()

void Matestar::ResetHooks ( )
virtual

Implements Material.

Definition at line 372 of file Matestar.cpp.

372  {/*{{{*/
373 
374  this->element=NULL;
375 
376  /*Get Element type*/
377  this->helement->reset();
378 
379 }

◆ SetCurrentConfiguration()

void Matestar::SetCurrentConfiguration ( Elements elements,
Loads loads,
Nodes nodes,
Vertices vertices,
Materials materials,
Parameters parameters 
)

Definition at line 381 of file Matestar.cpp.

381  {/*{{{*/
382 
383 }

◆ ViscosityFSDerivativeEpsSquare()

void Matestar::ViscosityFSDerivativeEpsSquare ( IssmDouble pmu_prime,
IssmDouble epsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 385 of file Matestar.cpp.

385  {/*{{{*/
386  this->GetViscosityDerivativeEpsSquare(pmu_prime,epsilon,gauss);
387 }/*}}}*/

◆ ViscosityHODerivativeEpsSquare()

void Matestar::ViscosityHODerivativeEpsSquare ( IssmDouble pmu_prime,
IssmDouble epsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 388 of file Matestar.cpp.

388  {/*{{{*/
389  _error_("not implemented yet");
390 }/*}}}*/

◆ ViscositySSADerivativeEpsSquare()

void Matestar::ViscositySSADerivativeEpsSquare ( IssmDouble pmu_prime,
IssmDouble epsilon,
Gauss gauss 
)
virtual

Implements Material.

Definition at line 391 of file Matestar.cpp.

391  {/*{{{*/
392  _error_("not implemented yet");
393 }/*}}}*/

◆ ViscosityFS()

void Matestar::ViscosityFS ( IssmDouble pviscosity,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input,
Input2 vz_input 
)
virtual

Implements Material.

Definition at line 482 of file Matestar.cpp.

482  {/*{{{*/
483 
484  /*Intermediaries*/
485  IssmDouble vx,vy,vz;
486  IssmDouble dvx[3],dvy[3],dvz[3];
487  IssmDouble epsilon3d[6]; /* epsilon=[exx,eyy,ezz,exy,exz,eyz];*/
488  IssmDouble epsilon2d[3]; /* epsilon=[exx,eyy,exy];*/
489  IssmDouble eps_eff,eps0=1.e-27;
490  bool isdepthaveraged=0.;
491 
492  /*Get velocity derivatives in all directions*/
493  _assert_(dim>1);
494  _assert_(vx_input);
495  vx_input->GetInputValue(&vx,gauss);
496  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
497  _assert_(vy_input);
498  vy_input->GetInputValue(&vy,gauss);
499  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
500  if(dim==3){
501  _assert_(vz_input);
502  vz_input->GetInputValue(&vz,gauss);
503  vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
504  }
505  else{
506  vz = 0.;
507  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = 0.;
508  }
509 
510  if(dim==3){
511  /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
512  element->StrainRateFS(&epsilon3d[0],xyz_list,gauss,vx_input,vy_input,vz_input);
513  eps_eff = sqrt(epsilon3d[0]*epsilon3d[0] + epsilon3d[1]*epsilon3d[1] + epsilon3d[3]*epsilon3d[3] + epsilon3d[4]*epsilon3d[4] + epsilon3d[5]*epsilon3d[5] + epsilon3d[0]*epsilon3d[1]+eps0*eps0);
514  }
515  else{
516  /* eps_eff^2 = 1/2 ( exx^2 + eyy^2 + 2*exy^2 )*/
517  element->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
518  eps_eff = 1./sqrt(2.)*sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + 2.*epsilon2d[2]*epsilon2d[2]);
519  }
520 
521  /*Compute viscosity*/
522  *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
523 }

◆ ViscosityHO()

void Matestar::ViscosityHO ( IssmDouble pviscosity,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input 
)
virtual

Implements Material.

Definition at line 525 of file Matestar.cpp.

525  {/*{{{*/
526 
527  /*Intermediaries*/
528  IssmDouble vx,vy,vz;
529  IssmDouble dvx[3],dvy[3],dvz[3];
530  IssmDouble epsilon3d[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
531  IssmDouble epsilon2d[5]; /* epsilon=[exx,exy];*/
532  IssmDouble eps_eff;
533  bool isdepthaveraged=0.;
534 
535  if(dim==3){
536  /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
537  element->StrainRateHO(&epsilon3d[0],xyz_list,gauss,vx_input,vy_input);
538  eps_eff = sqrt(epsilon3d[0]*epsilon3d[0] + epsilon3d[1]*epsilon3d[1] + epsilon3d[2]*epsilon3d[2] + epsilon3d[3]*epsilon3d[3] + epsilon3d[4]*epsilon3d[4] + epsilon3d[0]*epsilon3d[1]);
539  }
540  else{
541  /* eps_eff^2 = 1/2 (2*exx^2 + 2*exy^2 ) (since eps_zz = - eps_xx)*/
542  element->StrainRateHO2dvertical(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
543  eps_eff = 1./sqrt(2.)*sqrt(2*epsilon2d[0]*epsilon2d[0] + 2*epsilon2d[1]*epsilon2d[1]);
544  }
545 
546  /*Get velocity derivatives in all directions*/
547  _assert_(dim==2 || dim==3);
548  _assert_(vx_input);
549  vx_input->GetInputValue(&vx,gauss);
550  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
551  if(dim==3){
552  _assert_(vy_input);
553  vy_input->GetInputValue(&vy,gauss);
554  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
555  }
556  else{
557  dvx[2] = 0.;
558  vy = 0.;
559  dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
560  }
561  vz = 0.;
562  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
563 
564  /*Compute viscosity*/
565  *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
566 }/*}}}*/

◆ ViscosityL1L2()

void Matestar::ViscosityL1L2 ( IssmDouble pviscosity,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input,
Input2 surf 
)
virtual

Implements Material.

Definition at line 567 of file Matestar.cpp.

567  {/*{{{*/
568  _error_("not implemented yet");
569 }/*}}}*/

◆ ViscositySSA()

void Matestar::ViscositySSA ( IssmDouble pviscosity,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input 
)
virtual

Implements Material.

Definition at line 570 of file Matestar.cpp.

570  {/*{{{*/
571 
572  /*Intermediaries*/
573  IssmDouble vx,vy,vz;
574  IssmDouble dvx[3],dvy[3],dvz[3];
575  IssmDouble epsilon2d[3];/* epsilon=[exx,eyy,exy]; */
576  IssmDouble epsilon1d; /* epsilon=[exx]; */
577  IssmDouble eps_eff;
578  bool isdepthaveraged=1.;
579 
580  /*Get velocity derivatives in all directions*/
581  _assert_(dim==1 || dim==2);
582  _assert_(vx_input);
583  vx_input->GetInputValue(&vx,gauss);
584  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
585  if(dim==2){
586  _assert_(vy_input);
587  vy_input->GetInputValue(&vy,gauss);
588  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
589  }
590  else{
591  dvx[1] = 0.;
592  dvx[2] = 0.;
593  vy = 0.;
594  dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
595  }
596  dvx[2] = 0.;
597  dvy[2] = 0.;
598  vz = 0.;
599  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
600 
601  if(dim==2){
602  /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy*/
603  element->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
604  eps_eff = sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + epsilon2d[2]*epsilon2d[2] + epsilon2d[0]*epsilon2d[1]);
605  }
606  else{
607  /* eps_eff^2 = exx^2*/
608  element->StrainRateSSA1d(&epsilon1d,xyz_list,gauss,vx_input);
609  eps_eff = fabs(epsilon1d);
610  }
611 
612  /*Compute viscosity*/
613  *pviscosity=GetViscosityGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
614 }/*}}}*/

◆ ViscosityBFS()

void Matestar::ViscosityBFS ( IssmDouble pmudB,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input,
Input2 vz_input,
IssmDouble  eps_eff 
)
virtual

Implements Material.

Definition at line 395 of file Matestar.cpp.

395  {/*{{{*/
396 
397  /*Intermediaries*/
398  IssmDouble vx,vy,vz;
399  IssmDouble dvx[3],dvy[3],dvz[3];
400  bool isdepthaveraged=0.;
401 
402  /*Get velocity derivatives in all directions*/
403  _assert_(dim>1);
404  _assert_(vx_input);
405  vx_input->GetInputValue(&vx,gauss);
406  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
407  _assert_(vy_input);
408  vy_input->GetInputValue(&vy,gauss);
409  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
410  if(dim==3){
411  _assert_(vz_input);
412  vz_input->GetInputValue(&vz,gauss);
413  vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
414  }
415  else{
416  vz = 0.;
417  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = 0.;
418  }
419 
420  /*Compute dmudB*/
421  *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
422 }

◆ ViscosityBHO()

void Matestar::ViscosityBHO ( IssmDouble pmudB,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input,
IssmDouble  eps_eff 
)
virtual

Implements Material.

Definition at line 424 of file Matestar.cpp.

424  {/*{{{*/
425 
426  /*Intermediaries*/
427  IssmDouble vx,vy,vz;
428  IssmDouble dvx[3],dvy[3],dvz[3];
429  bool isdepthaveraged=0.;
430 
431  /*Get velocity derivatives in all directions*/
432  _assert_(dim==2 || dim==3);
433  _assert_(vx_input);
434  vx_input->GetInputValue(&vx,gauss);
435  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
436  if(dim==3){
437  _assert_(vy_input);
438  vy_input->GetInputValue(&vy,gauss);
439  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
440  }
441  else{
442  dvx[2] = 0.;
443  vy = 0.;
444  dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
445  }
446  vz = 0.;
447  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
448 
449  /*Compute viscosity*/
450  *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
451 }/*}}}*/

◆ ViscosityBSSA()

void Matestar::ViscosityBSSA ( IssmDouble pmudB,
int  dim,
IssmDouble xyz_list,
Gauss gauss,
Input2 vx_input,
Input2 vy_input,
IssmDouble  eps_eff 
)
virtual

Implements Material.

Definition at line 452 of file Matestar.cpp.

452  {/*{{{*/
453  /*Intermediaries*/
454  IssmDouble vx,vy,vz;
455  IssmDouble dvx[3],dvy[3],dvz[3];
456  bool isdepthaveraged=1.;
457 
458  /*Get velocity derivatives in all directions*/
459  _assert_(dim==1 || dim==2);
460  _assert_(vx_input);
461  vx_input->GetInputValue(&vx,gauss);
462  vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
463  if(dim==2){
464  _assert_(vy_input);
465  vy_input->GetInputValue(&vy,gauss);
466  vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
467  }
468  else{
469  dvx[1] = 0.;
470  dvx[2] = 0.;
471  vy = 0.;
472  dvy[0] = 0.; dvy[1] = 0.; dvy[2] = 0.;
473  }
474  dvx[2] = 0.;
475  dvy[2] = 0.;
476  vz = 0.;
477  dvz[0] = 0.; dvz[1] = 0.; dvz[2] = -dvx[0]-dvy[1];
478 
479  /*Compute viscosity*/
480  *pdmudB=GetViscosity_BGeneral(vx,vy,vz,&dvx[0],&dvy[0],&dvz[0],eps_eff,isdepthaveraged,gauss);
481 }/*}}}*/

◆ GetViscosityGeneral()

IssmDouble Matestar::GetViscosityGeneral ( IssmDouble  vx,
IssmDouble  vy,
IssmDouble  vz,
IssmDouble dvx,
IssmDouble dvy,
IssmDouble dvz,
IssmDouble  eps_eff,
bool  isdepthaveraged,
Gauss gauss 
)

Definition at line 248 of file Matestar.cpp.

248  {/*{{{*/
249 
250  /*output: */
251  IssmDouble viscosity;
252 
253  /*Intermediaries*/
254  IssmDouble epsprime_norm;
255  IssmDouble lambdas;
256  IssmDouble vmag,dvmag[3];
257  IssmDouble B,Ec,Es,E,n;
258 
259  /*Calculate velocity magnitude and its derivative*/
260  vmag = sqrt(vx*vx+vy*vy+vz*vz);
261  if(vmag<1e-12){
262  dvmag[0]=0;
263  dvmag[1]=0;
264  dvmag[2]=0;
265  }
266  else{
267  dvmag[0]=1./(2*sqrt(vmag))*(2*vx*dvx[0]+2*vy*dvy[0]+2*vz*dvz[0]);
268  dvmag[1]=1./(2*sqrt(vmag))*(2*vx*dvx[1]+2*vy*dvy[1]+2*vz*dvz[1]);
269  dvmag[2]=1./(2*sqrt(vmag))*(2*vx*dvx[2]+2*vy*dvy[2]+2*vz*dvz[2]);
270  }
271 
272  EstarStrainrateQuantities(&epsprime_norm,vx,vy,vz,vmag,dvx,dvy,dvz,&dvmag[0]);
273  lambdas=EstarLambdaS(eps_eff,epsprime_norm);
274 
275  /*Get B and enhancement*/
276  n=GetN(); _assert_(n>0.);
277  if (isdepthaveraged==0.){
278  B=GetB(gauss); _assert_(B>0.);
279  Ec=GetEc(gauss); _assert_(Ec>=0.); Es=GetEs(gauss); _assert_(Es>=0.);
280  }
281  else{
282  B=GetBbar(gauss); _assert_(B>0.);
283  Ec=GetEcbar(gauss); _assert_(Ec>=0.);
284  Es=GetEsbar(gauss); _assert_(Es>=0.);
285  }
286 
287  /*Get total enhancement factor E(lambdas)*/
288  E = Ec + (Es-Ec)*lambdas*lambdas; _assert_(E>0.);
289 
290  /*Compute viscosity*/
291  /*if no strain rate, return maximum viscosity*/
292  if(eps_eff==0.){
293  viscosity = 1.e+14/2.;
294  //viscosity = B;
295  //viscosity=2.5*pow(10.,17);
296  }
297  else{
298  viscosity = B/(2.*pow(E,1./n)*pow(eps_eff,2./n));
299  }
300 
301  /*Checks in debugging mode*/
302  if(viscosity<=0) _error_("Negative viscosity");
303 
304  /*Assign output pointer*/
305  return viscosity;
306 }

◆ GetViscosity_BGeneral()

IssmDouble Matestar::GetViscosity_BGeneral ( IssmDouble  vx,
IssmDouble  vy,
IssmDouble  vz,
IssmDouble dvx,
IssmDouble dvy,
IssmDouble dvz,
IssmDouble  eps_eff,
bool  isdepthaveraged,
Gauss gauss 
)

Definition at line 308 of file Matestar.cpp.

308  {/*{{{*/
309 
310  /*Intermediaries*/
311  IssmDouble dmudB;
312  IssmDouble epsprime_norm;
313  IssmDouble lambdas;
314  IssmDouble vmag,dvmag[3];
315  IssmDouble Ec,Es,E;
316 
317  /*Calculate velocity magnitude and its derivative*/
318  vmag = sqrt(vx*vx+vy*vy+vz*vz);
319  if(vmag<1e-12){
320  dvmag[0]=0;
321  dvmag[1]=0;
322  dvmag[2]=0;
323  }
324  else{
325  dvmag[0]=1./(2*sqrt(vmag))*(2*vx*dvx[0]+2*vy*dvy[0]+2*vz*dvz[0]);
326  dvmag[1]=1./(2*sqrt(vmag))*(2*vx*dvx[1]+2*vy*dvy[1]+2*vz*dvz[1]);
327  dvmag[2]=1./(2*sqrt(vmag))*(2*vx*dvx[2]+2*vy*dvy[2]+2*vz*dvz[2]);
328  }
329 
330  EstarStrainrateQuantities(&epsprime_norm,vx,vy,vz,vmag,dvx,dvy,dvz,&dvmag[0]);
331  lambdas=EstarLambdaS(eps_eff,epsprime_norm);
332 
333  /*Get enhancement*/
334  if (isdepthaveraged==0.){
335  Ec=GetEc(gauss); _assert_(Ec>=0.);
336  Es=GetEs(gauss); _assert_(Es>=0.);
337  }
338  else{
339  Ec=GetEcbar(gauss); _assert_(Ec>=0.);
340  Es=GetEsbar(gauss); _assert_(Es>=0.);
341  }
342 
343  /*Get total enhancement factor E(lambdas)*/
344  E = Ec + (Es-Ec)*lambdas*lambdas; _assert_(E>0.);
345 
346  /*Compute dmudB*/
347  if(eps_eff==0.) dmudB = 0.;
348  else dmudB = 1./(2.*pow(E,1./3.)*pow(eps_eff,2./3.));
349 
350  /*Assign output*/
351  return dmudB;
352 
353 }

Field Documentation

◆ mid

int Matestar::mid
private

Definition at line 27 of file Matestar.h.

◆ helement

Hook* Matestar::helement
private

Definition at line 28 of file Matestar.h.

◆ element

Element* Matestar::element
private

Definition at line 29 of file Matestar.h.

◆ rheology_law

int Matestar::rheology_law
private

Definition at line 30 of file Matestar.h.


The documentation for this class was generated from the following files:
EstarLambdaS
IssmDouble EstarLambdaS(IssmDouble epseff, IssmDouble epsprime_norm)
Definition: EstarComponents.cpp:118
_assert_
#define _assert_(ignore)
Definition: exceptions.h:37
IssmDouble
double IssmDouble
Definition: types.h:37
MaterialsRheologyEsbarEnum
@ MaterialsRheologyEsbarEnum
Definition: EnumDefinitions.h:650
Matestar::GetViscosityGeneral
IssmDouble GetViscosityGeneral(IssmDouble vx, IssmDouble vy, IssmDouble vz, IssmDouble *dvx, IssmDouble *dvy, IssmDouble *dvz, IssmDouble eps_eff, bool isdepthaveraged, Gauss *gauss)
Definition: Matestar.cpp:248
MaterialsRheologyEcEnum
@ MaterialsRheologyEcEnum
Definition: EnumDefinitions.h:647
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
MARSHALLING_ENUM
#define MARSHALLING_ENUM(EN)
Definition: Marshalling.h:14
Matestar::GetEcbar
IssmDouble GetEcbar(Gauss *gauss)
Definition: Matestar.cpp:191
Matestar::GetEc
IssmDouble GetEc(Gauss *gauss)
Definition: Matestar.cpp:181
EstarStrainrateQuantities
void EstarStrainrateQuantities(IssmDouble *pepsprime_norm, IssmDouble vx, IssmDouble vy, IssmDouble vz, IssmDouble vmag, IssmDouble *dvx, IssmDouble *dvy, IssmDouble *dvz, IssmDouble *dvmag)
Definition: EstarComponents.cpp:5
Element::StrainRateFS
void StrainRateFS(IssmDouble *epsilon, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input, Input2 *vz_input)
Definition: Element.cpp:4055
Matestar
Definition: Matestar.h:24
Matestar::Matestar
Matestar()
Definition: Matestar.cpp:24
Hook::reset
void reset(void)
Definition: Hook.cpp:211
Matestar::GetBbar
IssmDouble GetBbar(Gauss *gauss)
Definition: Matestar.cpp:162
Input2::GetInputDerivativeValue
virtual void GetInputDerivativeValue(IssmDouble *derivativevalues, IssmDouble *xyz_list, Gauss *gauss)
Definition: Input2.h:37
MaterialsRheologyBbarEnum
@ MaterialsRheologyBbarEnum
Definition: EnumDefinitions.h:644
Element::GetInput2
virtual Input2 * GetInput2(int inputenum)=0
Element
Definition: Element.h:41
Matestar::mid
int mid
Definition: Matestar.h:27
Hook::delivers
Object * delivers(void)
Definition: Hook.cpp:191
Matestar::GetB
IssmDouble GetB(Gauss *gauss)
Definition: Matestar.cpp:152
Matestar::GetEs
IssmDouble GetEs(Gauss *gauss)
Definition: Matestar.cpp:201
MatestarEnum
@ MatestarEnum
Definition: EnumDefinitions.h:1168
Hook
Definition: Hook.h:16
Hook::configure
void configure(DataSet *dataset)
Definition: Hook.cpp:145
Matestar::GetViscosity_BGeneral
IssmDouble GetViscosity_BGeneral(IssmDouble vx, IssmDouble vy, IssmDouble vz, IssmDouble *dvx, IssmDouble *dvy, IssmDouble *dvz, IssmDouble eps_eff, bool isdepthaveraged, Gauss *gauss)
Definition: Matestar.cpp:308
MARSHALLING
#define MARSHALLING(FIELD)
Definition: Marshalling.h:29
Element::StrainRateSSA1d
void StrainRateSSA1d(IssmDouble *epsilon, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input)
Definition: Element.cpp:4157
MaterialsRheologyEsEnum
@ MaterialsRheologyEsEnum
Definition: EnumDefinitions.h:649
Matestar::GetViscosityDerivativeEpsSquare
void GetViscosityDerivativeEpsSquare(IssmDouble *pmu_prime, IssmDouble *pepsilon, Gauss *gauss)
Definition: Matestar.cpp:244
Hook::copy
Object * copy(void)
Definition: Hook.cpp:61
Input2
Definition: Input2.h:18
MARSHALLING_BACKWARD
@ MARSHALLING_BACKWARD
Definition: Marshalling.h:10
Matestar::GetN
IssmDouble GetN()
Definition: Matestar.cpp:221
Element::StrainRateHO
void StrainRateHO(IssmDouble *epsilon, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input)
Definition: Element.cpp:4084
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
Matestar::helement
Hook * helement
Definition: Matestar.h:28
MaterialsRheologyBEnum
@ MaterialsRheologyBEnum
Definition: EnumDefinitions.h:643
Hook::Echo
void Echo(void)
Definition: Hook.cpp:104
Element::StrainRateSSA
void StrainRateSSA(IssmDouble *epsilon, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input)
Definition: Element.cpp:4138
Input2::GetInputValue
virtual void GetInputValue(IssmDouble *pvalue, Gauss *gauss)
Definition: Input2.h:38
MaterialsRheologyEcbarEnum
@ MaterialsRheologyEcbarEnum
Definition: EnumDefinitions.h:648
Element::StrainRateHO2dvertical
void StrainRateHO2dvertical(IssmDouble *epsilon, IssmDouble *xyz_list, Gauss *gauss, Input2 *vx_input, Input2 *vy_input)
Definition: Element.cpp:4114
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
Matestar::element
Element * element
Definition: Matestar.h:29
Matestar::GetEsbar
IssmDouble GetEsbar(Gauss *gauss)
Definition: Matestar.cpp:211
Hook::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: Hook.cpp:122