-
Notifications
You must be signed in to change notification settings - Fork 8
/
FractureArgs.C
94 lines (83 loc) · 2.58 KB
/
FractureArgs.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// $Id$
//==============================================================================
//!
//! \file FractureArgs.C
//!
//! \date Jan 11 2018
//!
//! \author Knut Morten Okstad / SINTEF
//!
//! \brief Preparsing of input files for the FractureDynamics application.
//!
//==============================================================================
#include "FractureArgs.h"
#include "Utilities.h"
#include "tinyxml2.h"
FractureArgs::FractureArgs () : SIMargsBase("fracturedynamics")
{
inpfile = nullptr;
integrator = coupling = 1;
poroEl = expPhase = false;
stopT = -1.0;
}
bool FractureArgs::parseArg (const char* argv)
{
if (!strcmp(argv,"-nocrack"))
coupling = 0;
else if (!strcmp(argv,"-semiimplicit"))
coupling = 2;
else if (!strcmp(argv,"-lstatic"))
integrator = 0;
else if (!strcmp(argv,"-GA"))
integrator = 2;
else if (!strcmp(argv,"-qstatic"))
integrator = 3;
else if (!strcmp(argv,"-Miehe"))
integrator = coupling = 3;
else if (!strcmp(argv,"-HHT"))
integrator = 4;
else if (!strcmp(argv,"-oldHHT"))
integrator = 5;
else if (!strncmp(argv,"-poro",5))
poroEl = true;
else if (!strncmp(argv,"-explcr",7))
expPhase = true;
else if (!strncmp(argv,"-noadap",7))
adap = false;
else
return this->SIMargsBase::parseArg(argv);
return true;
}
void FractureArgs::parseFile (const char* argv, int& iarg)
{
inpfile = const_cast<char*>(argv);
if (strcasestr(inpfile,".xinp"))
if (this->readXML(inpfile,false))
iarg = 0; // start over and let command-line options override input file
}
bool FractureArgs::parse (const tinyxml2::XMLElement* elem)
{
if (!strcasecmp(elem->Value(),"fracturedynamics")) {
utl::getAttribute(elem,"timeintegrator",integrator);
utl::getAttribute(elem,"coupling",coupling);
const tinyxml2::XMLElement* child = elem->FirstChildElement();
for (; child; child = child->NextSiblingElement())
if (!strcasecmp(child->Value(),"semiimplicit"))
coupling = 2;
else if (!strcasecmp(child->Value(),"generalizedalpha"))
integrator = 2;
else if (!strcasecmp(child->Value(),"quasistatic"))
integrator = 3;
else if (!strcasecmp(child->Value(),"miehe"))
integrator = coupling = 3;
else if (!strcasecmp(child->Value(),"hht"))
integrator = 4;
else if (!strcasecmp(child->Value(),"hilberhughestaylor"))
integrator = 4;
else if (!strcasecmp(child->Value(),"poroelastic"))
poroEl = true;
else if (!strcasecmp(child->Value(),"explicitphase"))
expPhase = true;
}
return this->SIMargsBase::parse(elem);
}