Alamo
Sin.H
Go to the documentation of this file.
1#ifndef MODEL_INTERFACE_CRACK_SIN_H
2#define MODEL_INTERFACE_CRACK_SIN_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#include "IO/ParmParse.H"
12
13namespace Model
14{
15namespace Interface
16{
17namespace Crack
18{
19class Sin : public Crack
20{
21public:
22 Sin(){};
23
24 Set::Scalar Gc(Set::Scalar theta) {return Gc0 + 0.5*Gc1*(1.0 - cos(4.0*(theta-theta0))); }
25 Set::Scalar DGc(Set::Scalar theta) { return 2.0*Gc1*sin(4.0*(theta-theta0)); }
26 Set::Scalar DDGc(Set::Scalar theta) { return 8.0*Gc1*cos(4.0*(theta-theta0)); }
27 Set::Scalar Zeta(Set::Scalar /*theta*/) { return zeta; }
28 Set::Scalar Mobility(Set::Scalar /*theta*/) { return mobility; }
30
31private:
32 Set::Scalar zeta = 1.e-2, mobility = 1.e-2;
37
38public:
39 static void Parse(Sin & value, IO::ParmParse & pp)
40 {
41 pp_query("Gc0",value.Gc0); // Min Gc (fracture energy) value
42 pp_query("Gc1",value.Gc1); // Max Gc (fracture energy)value
43 pp_query("theta0",value.theta0); // Angle offset
44 pp_query("zeta",value.zeta); // Regularization
45 pp_query("mobility",value.mobility); // Crack mobiilty
46 pp_query("threshold",value.threshold); // Threshold for kinetics
47
48 std::string gtype = "";
49 std::string wtype = "";
50 pp_query("gtype", gtype); // Type of g function to use {square, multiwell, 4c3, squarep, squarepexp, cubicm}
51 pp_query("wtype", wtype); // Type o w function to use {square, multiwell, multiwell2, 4c3}
52
53 Set::Scalar ductile_exponent = 1.;
54 if(gtype == "squarepexp"|| gtype == "cubicm")
55 // Ductile exponent
56 pp_query("exponent",ductile_exponent);
57
58 std::map<std::string,Model::Interface::Crack::Crack::GType> g_map;
65
66 std::map<std::string,Model::Interface::Crack::Crack::WType> w_map;
71
72 value.SetGType(g_map[gtype]);
73 value.SetWType(w_map[wtype]);
74
75 value.SetDuctileExponent(ductile_exponent);
76 }
77};
78}
79}
80}
81#endif
#define pp_query(...)
Definition ParmParse.H:129
void SetWType(const WType a_type)
Definition Crack.H:161
void SetDuctileExponent(const Set::Scalar m)
Definition Crack.H:171
void SetGType(const GType a_type)
Definition Crack.H:156
static void Parse(Sin &value, IO::ParmParse &pp)
Definition Sin.H:39
Set::Scalar DrivingForceThreshold(Set::Scalar)
Definition Sin.H:29
Set::Scalar threshold
Definition Sin.H:36
Set::Scalar Zeta(Set::Scalar)
Definition Sin.H:27
Set::Scalar DDGc(Set::Scalar theta)
Definition Sin.H:26
Set::Scalar mobility
Definition Sin.H:32
Set::Scalar DGc(Set::Scalar theta)
Definition Sin.H:25
Set::Scalar Gc(Set::Scalar theta)
Definition Sin.H:24
Set::Scalar Mobility(Set::Scalar)
Definition Sin.H:28
amrex::Real Scalar
Definition Base.H:19