8 #ifndef __MATERIALUNSATURATEDFLOW_HPP__
9 #define __MATERIALUNSATURATEDFLOW_HPP__
49 void addOptions(po::options_description &o,
const std::string &prefix) {
50 o.add_options()((prefix +
".material_name").c_str(),
52 (prefix +
".ePsilon0").c_str(),
54 (prefix +
".ePsilon1").c_str(),
56 (prefix +
".sCale").c_str(),
57 po::value<double>(&
sCale)->default_value(
sCale))(
58 (prefix +
".thetaS").c_str(),
60 (prefix +
".thetaR").c_str(),
62 (prefix +
".thetaM").c_str(),
64 (prefix +
".alpha").c_str(),
65 po::value<double>(&
alpha)->default_value(
alpha))(
66 (prefix +
".n").c_str(), po::value<double>(&
n)->default_value(
n))(
67 (prefix +
".hS").c_str(), po::value<double>(&
hS)->default_value(
hS))(
68 (prefix +
".Ks").c_str(), po::value<double>(&
Ks)->default_value(
Ks))(
69 (prefix +
".Ah").c_str(), po::value<double>(&
Ah)->default_value(
Ah))(
70 (prefix +
".AhZ").c_str(), po::value<double>(&
AhZ)->default_value(
AhZ))(
71 (prefix +
".AhZZ").c_str(),
72 po::value<double>(&
AhZZ)->default_value(
AhZZ))(
73 (prefix +
".scaleZ").c_str(),
78 PetscPrintf(PETSC_COMM_WORLD,
"Mat name %s-%s block id %d\n",
79 prefix.c_str(),
matName.c_str(),
id);
80 PetscPrintf(PETSC_COMM_WORLD,
"Material name: %s\n",
matName.c_str());
81 PetscPrintf(PETSC_COMM_WORLD,
"thetaS=%6.4g\n",
thetaS);
82 PetscPrintf(PETSC_COMM_WORLD,
"thetaR=%6.4g\n",
thetaR);
83 PetscPrintf(PETSC_COMM_WORLD,
"thetaM=%6.4g\n",
thetaM);
84 PetscPrintf(PETSC_COMM_WORLD,
"alpha=%6.4g\n",
alpha);
85 PetscPrintf(PETSC_COMM_WORLD,
"n=%6.4g\n",
n);
86 PetscPrintf(PETSC_COMM_WORLD,
"hS=%6.4g\n",
hS);
87 PetscPrintf(PETSC_COMM_WORLD,
"Ks=%6.4g\n",
Ks);
88 PetscPrintf(PETSC_COMM_WORLD,
"Ah=%6.4g\n",
Ah);
89 PetscPrintf(PETSC_COMM_WORLD,
"AhZ=%6.4g\n",
AhZ);
90 PetscPrintf(PETSC_COMM_WORLD,
"AhZZ=%6.4g\n",
AhZZ);
91 PetscPrintf(PETSC_COMM_WORLD,
"ePsilon0=%6.4g\n",
ePsilon0);
92 PetscPrintf(PETSC_COMM_WORLD,
"ePsilon1=%6.4g\n",
ePsilon1);
93 PetscPrintf(PETSC_COMM_WORLD,
"sCale=%6.4g\n",
sCale);
94 PetscPrintf(PETSC_COMM_WORLD,
"scaleZ=%6.4g\n",
scaleZ);
97 typedef boost::function<boost::shared_ptr<CommonMaterialData>(
104 static boost::shared_ptr<CommonMaterialData>
106 return boost::shared_ptr<CommonMaterialData>(
new MaterialDarcy(data));
152 template <
typename TYPE>
inline TYPE
funSe(TYPE &theta) {
164 int r = ::function(2 *
blockId + 1, 1, 1, &
h, &
Kr);
167 "ADOL-C function evaluation with error");
185 "ADOL-C function evaluation with error");
197 int r = ::gradient(2 *
blockId + 0, 1, &
h, &
C);
200 "ADOL-C function evaluation with error");
216 "ADOL-C function evaluation with error");
230 "ADOL-C function evaluation with error");
245 "ADOL-C function evaluation with error");
256 static boost::shared_ptr<CommonMaterialData>
258 return boost::shared_ptr<CommonMaterialData>(
274 template <
typename TYPE>
inline TYPE
funTheta(TYPE &
h,
const double m) {
278 template <
typename TYPE>
280 return pow(1 - pow(SeStar, 1 /
m),
m);
284 const double m = 1 - 1 /
n;
289 const double c = funFunSeStar<double>(one,
m);
291 pow((1 - funFunSeStar<adouble>(
aSeStar,
m)) / (1 -
c), 2);
296 trace_on(2 *
blockId + 0,
true);
298 const double m = 1 - 1 /
n;
307 trace_on(2 *
blockId + 1,
true);
316 const std::string &prefix) {
317 const double m = 1 - 1 /
n;
319 for (;
h >= e;
h += s) {
323 PetscPrintf(PETSC_COMM_SELF,
"%s %6.4e %6.4e %6.4e\n", prefix.c_str(),
h,
329 const std::string &prefix) {
331 for (;
h >= e;
h += s) {
334 PetscPrintf(PETSC_COMM_SELF,
"%s %6.4e %6.4e %6.4e\n", prefix.c_str(),
h,
339 void printC(
const double b,
const double e,
double s,
340 const std::string &prefix) {
342 for (;
h >= e;
h += s) {
345 PetscPrintf(PETSC_COMM_SELF,
"%s %6.4e %6.4e\n", prefix.c_str(),
h,
C);
351 static map<std::string, CommonMaterialData::RegisterHook>
364 #endif //__MATERIALUNSATURATEDFLOW_HPP__