11 #include "libmesh/utility.h" 19 params.
addParam<
unsigned int>(
"num_slip_sys_props",
21 "Number of slip system specific properties provided in the file " 22 "containing slip system normals and directions");
23 params.
addParam<std::vector<Real>>(
"flowprops",
"Parameters used in slip rate equations");
25 "Name of the file containing the slip system");
27 "slip_sys_flow_prop_file_name",
29 "Name of the file containing the values of slip rate equation parameters");
31 "num_slip_sys_flowrate_props",
33 "Number of flow rate properties for a slip system");
34 params.
addParam<
Real>(
"slip_incr_tol", 2e-2,
"Maximum allowable slip in an increment");
36 "Crystal plasticity slip rate class. Override the virtual functions in your class");
42 _num_slip_sys_props(getParam<unsigned
int>(
"num_slip_sys_props")),
43 _flowprops(getParam<
std::vector<
Real>>(
"flowprops")),
44 _slip_sys_file_name(getParam<FileName>(
"slip_sys_file_name")),
45 _slip_sys_flow_prop_file_name(getParam<FileName>(
"slip_sys_flow_prop_file_name")),
46 _num_slip_sys_flowrate_props(getParam<unsigned
int>(
"num_slip_sys_flowrate_props")),
47 _slip_incr_tol(getParam<
Real>(
"slip_incr_tol")),
48 _mo(_variable_size * LIBMESH_DIM),
49 _no(_variable_size * LIBMESH_DIM),
68 Real vec[LIBMESH_DIM];
69 std::ifstream fileslipsys;
79 if (!(fileslipsys >> vec[
j]))
81 "CrystalPlasticitySlipRate Error: Premature end of file reading slip system file \n");
85 mag = Utility::pow<2>(vec[0]) + Utility::pow<2>(vec[1]) + Utility::pow<2>(vec[2]);
88 for (
unsigned j = 0;
j < LIBMESH_DIM; ++
j)
89 _no(i * LIBMESH_DIM +
j) = vec[
j] / mag;
93 if (!(fileslipsys >> vec[
j]))
95 "CrystalPlasticitySlipRate Error: Premature end of file reading slip system file \n");
98 mag = Utility::pow<2>(vec[0]) + Utility::pow<2>(vec[1]) + Utility::pow<2>(vec[2]);
102 _mo(i * LIBMESH_DIM +
j) = vec[
j] / mag;
106 mag +=
_mo(i * LIBMESH_DIM +
j) *
_no(i * LIBMESH_DIM +
j);
109 mooseError(
"CrystalPlasticitySlipRate Error: Slip direction and normal not orthonormal, "
static InputParameters validParams()
static constexpr std::size_t dim
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
Crystal plasticity system userobject base class.
static InputParameters validParams()
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
unsigned int _variable_size
CrystalPlasticitySlipRate(const InputParameters ¶meters)
virtual void getFlowRateParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::string _slip_sys_file_name
File should contain slip plane normal and direction.
void ErrorVector unsigned int
virtual void readFileFlowRateParams()
virtual void getSlipSystems()