v0.14.0
Public Member Functions | Public Attributes | List of all members
MixTransport::MaterialWithAutomaticDifferentiation Struct Referenceabstract

#include <tutorials/cor-0to1/src/MaterialUnsaturatedFlow.hpp>

Inheritance diagram for MixTransport::MaterialWithAutomaticDifferentiation:
[legend]
Collaboration diagram for MixTransport::MaterialWithAutomaticDifferentiation:
[legend]

Public Member Functions

 MaterialWithAutomaticDifferentiation (const CommonMaterialData &data)
 
template<typename TYPE >
TYPE funSe (TYPE &theta)
 
virtual void recordTheta ()=0
 
virtual void recordKr ()=0
 
MoFEMErrorCode calK ()
 
MoFEMErrorCode calDiffK ()
 
MoFEMErrorCode calC ()
 
MoFEMErrorCode calDiffC ()
 
MoFEMErrorCode calTheta ()
 
MoFEMErrorCode calSe ()
 
- Public Member Functions inherited from MixTransport::CommonMaterialData
 CommonMaterialData ()
 
double initialPcEval () const
 Initialize head. More...
 
void addOptions (po::options_description &o, const std::string &prefix)
 
void printMatParameters (const int id, const std::string &prefix) const
 
- Public Member Functions inherited from MixTransport::GenericMaterial
virtual ~GenericMaterial ()
 

Public Attributes

double Kr
 
double diffKr
 
- Public Attributes inherited from MixTransport::CommonMaterialData
int blockId
 Block Id. More...
 
std::string matName
 material name More...
 
double Ks
 Saturated hydraulic conductivity [m/day]. More...
 
double hS
 minimum capillary height [m] More...
 
double thetaS
 saturated water content More...
 
double thetaR
 residual water contents More...
 
double thetaM
 model parameter More...
 
double alpha
 model parameter More...
 
double n
 model parameter More...
 
double Ah
 Initial hydraulic head coefficient. More...
 
double AhZ
 Initial hydraulic head coefficient. More...
 
double AhZZ
 Initial hydraulic head coefficient. More...
 
- Public Attributes inherited from MixTransport::GenericMaterial
double sCale
 Scale time dependent eq. More...
 
double h
 hydraulic head More...
 
double h_t
 rate of hydraulic head More...
 
double K
 Hydraulic conductivity [L/s]. More...
 
double diffK
 Derivative of hydraulic conductivity [L/s * L^2/F]. More...
 
double C
 Capacity [S^2/L^2]. More...
 
double diffC
 Derivative of capacity [S^2/L^2 * L^2/F ]. More...
 
double tHeta
 Water content. More...
 
double Se
 Effective saturation. More...
 
Range tEts
 Elements with this material. More...
 
double x
 
double y
 
double z
 in meters (L) More...
 

Additional Inherited Members

- Public Types inherited from MixTransport::CommonMaterialData
typedef boost::function< boost::shared_ptr< CommonMaterialData > const CommonMaterialData &data)> RegisterHook
 
- Static Public Attributes inherited from MixTransport::GenericMaterial
static double ePsilon0 = 0
 Regularization parameter. More...
 
static double ePsilon1 = 0
 Regularization parameter. More...
 
static double scaleZ = 1
 Scale z direction. More...
 

Detailed Description

Definition at line 148 of file MaterialUnsaturatedFlow.hpp.

Constructor & Destructor Documentation

◆ MaterialWithAutomaticDifferentiation()

MixTransport::MaterialWithAutomaticDifferentiation::MaterialWithAutomaticDifferentiation ( const CommonMaterialData data)
inline

Definition at line 149 of file MaterialUnsaturatedFlow.hpp.

150  : CommonMaterialData(data) {}

Member Function Documentation

◆ calC()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calC ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 194 of file MaterialUnsaturatedFlow.hpp.

194  {
196  if (h < hS) {
197  int r = ::gradient(2 * blockId + 0, 1, &h, &C);
198  if (r < 0) {
199  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
200  "ADOL-C function evaluation with error");
201  }
202  } else {
203  C = 0;
204  }
205  C += ePsilon1;
207  }

◆ calDiffC()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calDiffC ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 209 of file MaterialUnsaturatedFlow.hpp.

209  {
211  if (h < hS) {
212  double v = 1;
213  int r = ::hess_vec(2 * blockId + 0, 1, &h, &v, &diffC);
214  if (r < 0) {
215  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
216  "ADOL-C function evaluation with error");
217  }
218  } else {
219  diffC = 0;
220  }
222  }

◆ calDiffK()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calDiffK ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 178 of file MaterialUnsaturatedFlow.hpp.

178  {
180  if (h < hS) {
181  diffK = 0;
182  int r = ::gradient(2 * blockId + 1, 1, &h, &diffKr);
183  if (r < 0) {
184  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
185  "ADOL-C function evaluation with error");
186  }
187  diffK = Ks * diffKr;
188  } else {
189  diffK = 0;
190  }
192  };

◆ calK()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calK ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 161 of file MaterialUnsaturatedFlow.hpp.

161  {
163  if (h < hS) {
164  int r = ::function(2 * blockId + 1, 1, 1, &h, &Kr);
165  if (r < 0) {
166  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
167  "ADOL-C function evaluation with error");
168  }
169  K = Ks * Kr;
170  } else {
171  K = Ks;
172  }
173  K += Ks * ePsilon0;
175  };

◆ calSe()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calSe ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 238 of file MaterialUnsaturatedFlow.hpp.

238  {
240  if (h < hS) {
241  int r = ::function(2 * blockId + 0, 1, 1, &h, &tHeta);
242  Se = funSe(tHeta);
243  if (r < 0) {
244  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
245  "ADOL-C function evaluation with error");
246  }
247  } else {
248  tHeta = thetaS;
249  }
251  }

◆ calTheta()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calTheta ( )
inlinevirtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 224 of file MaterialUnsaturatedFlow.hpp.

224  {
226  if (h < hS) {
227  int r = ::function(2 * blockId + 0, 1, 1, &h, &tHeta);
228  if (r < 0) {
229  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
230  "ADOL-C function evaluation with error");
231  }
232  } else {
233  tHeta = thetaS;
234  }
236  }

◆ funSe()

template<typename TYPE >
TYPE MixTransport::MaterialWithAutomaticDifferentiation::funSe ( TYPE &  theta)
inline

Definition at line 152 of file MaterialUnsaturatedFlow.hpp.

152  {
153  return (theta - thetaR) / (thetaS - thetaR);
154  }

◆ recordKr()

virtual void MixTransport::MaterialWithAutomaticDifferentiation::recordKr ( )
pure virtual

◆ recordTheta()

virtual void MixTransport::MaterialWithAutomaticDifferentiation::recordTheta ( )
pure virtual

Member Data Documentation

◆ diffKr

double MixTransport::MaterialWithAutomaticDifferentiation::diffKr

Definition at line 175 of file MaterialUnsaturatedFlow.hpp.

◆ Kr

double MixTransport::MaterialWithAutomaticDifferentiation::Kr

Definition at line 160 of file MaterialUnsaturatedFlow.hpp.


The documentation for this struct was generated from the following file:
MixTransport::GenericMaterial::ePsilon0
static double ePsilon0
Regularization parameter.
Definition: UnsaturatedFlow.hpp:26
MixTransport::GenericMaterial::diffK
double diffK
Derivative of hydraulic conductivity [L/s * L^2/F].
Definition: UnsaturatedFlow.hpp:36
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MixTransport::CommonMaterialData::CommonMaterialData
CommonMaterialData()
Definition: MaterialUnsaturatedFlow.hpp:15
MixTransport::GenericMaterial::diffC
double diffC
Derivative of capacity [S^2/L^2 * L^2/F ].
Definition: UnsaturatedFlow.hpp:38
MixTransport::CommonMaterialData::hS
double hS
minimum capillary height [m]
Definition: MaterialUnsaturatedFlow.hpp:35
MixTransport::GenericMaterial::C
double C
Capacity [S^2/L^2].
Definition: UnsaturatedFlow.hpp:37
sdf.r
int r
Definition: sdf.py:8
MixTransport::CommonMaterialData::thetaR
double thetaR
residual water contents
Definition: MaterialUnsaturatedFlow.hpp:37
MixTransport::GenericMaterial::K
double K
Hydraulic conductivity [L/s].
Definition: UnsaturatedFlow.hpp:35
MixTransport::GenericMaterial::ePsilon1
static double ePsilon1
Regularization parameter.
Definition: UnsaturatedFlow.hpp:27
MixTransport::CommonMaterialData::Ks
double Ks
Saturated hydraulic conductivity [m/day].
Definition: MaterialUnsaturatedFlow.hpp:34
MixTransport::GenericMaterial::h
double h
hydraulic head
Definition: UnsaturatedFlow.hpp:32
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MixTransport::CommonMaterialData::blockId
int blockId
Block Id.
Definition: MaterialUnsaturatedFlow.hpp:31
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
MixTransport::GenericMaterial::tHeta
double tHeta
Water content.
Definition: UnsaturatedFlow.hpp:39
MixTransport::MaterialWithAutomaticDifferentiation::funSe
TYPE funSe(TYPE &theta)
Definition: MaterialUnsaturatedFlow.hpp:152
MixTransport::MaterialWithAutomaticDifferentiation::diffKr
double diffKr
Definition: MaterialUnsaturatedFlow.hpp:175
MixTransport::CommonMaterialData::thetaS
double thetaS
saturated water content
Definition: MaterialUnsaturatedFlow.hpp:36
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MixTransport::MaterialWithAutomaticDifferentiation::Kr
double Kr
Definition: MaterialUnsaturatedFlow.hpp:160
MixTransport::GenericMaterial::Se
double Se
Effective saturation.
Definition: UnsaturatedFlow.hpp:40