Alamo
Constant.H
Go to the documentation of this file.
1#ifndef MODEL_INTERFACE_CRACK_CONSTANT_H
2#define MODEL_INTERFACE_CRACK_CONSTANT_H
3
4#include <iostream>
5#include <fstream>
6
7#include "AMReX.H"
8#include "Crack.H"
9#include "Set/Set.H"
10#include "Util/Util.H"
11
12namespace Model
13{
14namespace Interface
15{
16namespace Crack
17{
18class Constant : public Crack
19{
20public:
22
23 Set::Scalar Gc (Set::Scalar /*theta*/) { return _Gc; }
24 Set::Scalar DGc (Set::Scalar /*theta*/) { return 0.0; }
25 Set::Scalar DDGc (Set::Scalar /*theta*/) { return 0.0; }
26 Set::Scalar Zeta(Set::Scalar /*theta*/) { return zeta; }
29private:
30 Set::Scalar _Gc = 1.0, zeta = 1.e-2, mobility = 1.e-2, threshold = 0.0;
31
32public:
33 static void Parse(Constant & value, IO::ParmParse & pp)
34 {
35 pp_query("G_c",value._Gc); // Fracture energy
36 pp_query("zeta",value.zeta); // Lengthscale regularization
37 pp_query("mobility",value.mobility); // Mobility (speed)
38 pp_query("threshold", value.threshold); // Threshold
39
40 std::string gtype = "";
41 std::string wtype = "";
42 pp_query("gtype", gtype); // Type of g function to use {square, multiwell, 4c3, squarep, squarepexp, cubicm}
43 pp_query("wtype", wtype); // Type o w function to use {square, multiwell, multiwell2, 4c3}
44
45 Set::Scalar ductile_exponent = 1.;
46 if(gtype == "squarepexp"|| gtype == "cubicm") pp_query("exponent",ductile_exponent);
47
48 std::map<std::string,Model::Interface::Crack::Crack::GType> g_map;
55
56 std::map<std::string,Model::Interface::Crack::Crack::WType> w_map;
61
62 value.SetGType(g_map[gtype]);
63 value.SetWType(w_map[wtype]);
64
65 value.SetDuctileExponent(ductile_exponent);
66 }
67};
68}
69}
70}
71#endif
#define pp_query(...)
Definition ParmParse.H:106
Set::Scalar Mobility(Set::Scalar)
Definition Constant.H:27
Set::Scalar Gc(Set::Scalar)
Definition Constant.H:23
Set::Scalar DGc(Set::Scalar)
Definition Constant.H:24
Set::Scalar Zeta(Set::Scalar)
Definition Constant.H:26
Set::Scalar DDGc(Set::Scalar)
Definition Constant.H:25
static void Parse(Constant &value, IO::ParmParse &pp)
Definition Constant.H:33
Set::Scalar DrivingForceThreshold(Set::Scalar)
Definition Constant.H:28
void SetWType(const WType a_type)
Definition Crack.H:105
void SetDuctileExponent(const Set::Scalar m)
Definition Crack.H:110
void SetGType(const GType a_type)
Definition Crack.H:100
amrex::Real Scalar
Definition Base.H:19