Line data Source code
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 : 12 : namespace Model 13 : { 14 : namespace Interface 15 : { 16 : namespace Crack 17 : { 18 : class Constant : public Crack 19 : { 20 : public: 21 0 : Constant(){}; 22 : 23 0 : Set::Scalar Gc (Set::Scalar /*theta*/) { return _Gc; } 24 0 : Set::Scalar DGc (Set::Scalar /*theta*/) { return 0.0; } 25 0 : Set::Scalar DDGc (Set::Scalar /*theta*/) { return 0.0; } 26 0 : Set::Scalar Zeta(Set::Scalar /*theta*/) { return zeta; } 27 0 : Set::Scalar Mobility (Set::Scalar /*theta*/) {return mobility;} 28 0 : Set::Scalar DrivingForceThreshold (Set::Scalar /*theta*/) {return threshold;} 29 : private: 30 : Set::Scalar _Gc = 1.0, zeta = 1.e-2, mobility = 1.e-2, threshold = 0.0; 31 : 32 : public: 33 0 : static void Parse(Constant & value, IO::ParmParse & pp) 34 : { 35 0 : pp_query("G_c",value._Gc); // Fracture energy 36 0 : pp_query("zeta",value.zeta); // Lengthscale regularization 37 0 : pp_query("mobility",value.mobility); // Mobility (speed) 38 0 : pp_query("threshold", value.threshold); // Threshold 39 : 40 0 : std::string gtype = ""; 41 0 : std::string wtype = ""; 42 0 : pp_query("gtype", gtype); // Type of g function to use {square, multiwell, 4c3, squarep, squarepexp, cubicm} 43 0 : pp_query("wtype", wtype); // Type o w function to use {square, multiwell, multiwell2, 4c3} 44 : 45 0 : Set::Scalar ductile_exponent = 1.; 46 0 : if(gtype == "squarepexp"|| gtype == "cubicm") pp_query("exponent",ductile_exponent); 47 : 48 0 : std::map<std::string,Model::Interface::Crack::Crack::GType> g_map; 49 0 : g_map["square"] = Model::Interface::Crack::Crack::GType::GSQUARE; 50 0 : g_map["multiwell"] = Model::Interface::Crack::Crack::GType::GMULTIWELL; 51 0 : g_map["4c3"] = Model::Interface::Crack::Crack::GType::GPHI4C3; 52 0 : g_map["squarep"] = Model::Interface::Crack::Crack::GType::GSQUAREP; 53 0 : g_map["squarepexp"] = Model::Interface::Crack::Crack::GType::GSQUAREPM; 54 0 : g_map["cubicm"] = Model::Interface::Crack::Crack::GType::GCUBICM; 55 : 56 0 : std::map<std::string,Model::Interface::Crack::Crack::WType> w_map; 57 0 : w_map["square"] = Model::Interface::Crack::Crack::WType::WSQUARE; 58 0 : w_map["multiwell"] = Model::Interface::Crack::Crack::WType::WMULTIWELL; 59 0 : w_map["multiwell2"] = Model::Interface::Crack::Crack::WType::WMULTIWELL2; 60 0 : w_map["4c3"] = Model::Interface::Crack::Crack::WType::WPHI4C3; 61 : 62 0 : value.SetGType(g_map[gtype]); 63 0 : value.SetWType(w_map[wtype]); 64 : 65 0 : value.SetDuctileExponent(ductile_exponent); 66 0 : } 67 : }; 68 : } 69 : } 70 : } 71 : #endif