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