21 "state_variable_file_name",
23 "Name of the file containing the initial values of slip system resistances");
24 MooseEnum intvar_read_options(
"file_input inline_input user_input",
"inline_input");
28 "Read from options for initial value of internal variables: Default from .i file");
29 params.
addParam<std::vector<unsigned int>>(
"groups",
31 "To group the initial values on different " 32 "slip systems 'format: [start end)', i.e.'0 " 33 "4 8 11' groups 0-3, 4-7 and 8-11 ");
34 params.
addParam<std::vector<Real>>(
"group_values",
36 "The initial values corresponding to each " 37 "group, i.e. '0.0 1.0 2.0' means 0-4 = 0.0, " 38 "4-8 = 1.0 and 8-12 = 2.0 ");
39 params.
addParam<std::vector<std::string>>(
"uo_state_var_evol_rate_comp_name",
40 "Name of state variable evolution rate component " 41 "property: Same as state variable evolution rate " 42 "component user object specified in input file.");
43 params.
addParam<
Real>(
"zero", 0.0,
"Numerical zero for interval variable");
44 params.
addParam<std::vector<Real>>(
"scale_factor",
"Scale factor of individual component.");
46 "Crystal plasticity state variable class. Override the virtual functions in your class");
52 _num_mat_state_var_evol_rate_comps(
53 parameters.
get<
std::vector<
std::string>>(
"uo_state_var_evol_rate_comp_name").size()),
54 _mat_prop_state_var(getMaterialProperty<
std::vector<
Real>>(_name)),
55 _state_variable_file_name(getParam<FileName>(
"state_variable_file_name")),
56 _intvar_read_type(getParam<
MooseEnum>(
"intvar_read_type")),
57 _groups(getParam<
std::vector<unsigned
int>>(
"groups")),
58 _group_values(getParam<
std::vector<
Real>>(
"group_values")),
59 _zero(getParam<
Real>(
"zero")),
60 _scale_factor(getParam<
std::vector<
Real>>(
"scale_factor"))
63 mooseError(
"CrystalPlasticityStateVariable: Scale factor should be have the same size of " 64 "evolution rate components.");
70 parameters.
get<std::vector<std::string>>(
"uo_state_var_evol_rate_comp_name")[i]);
75 const Point & q_point)
const 89 mooseError(
"CrystalPlasticityStateVariable: Read option for initial value of internal " 90 "variables is not supported.");
95 mooseError(
"CrystalPlasticityStateVariable: Value of state variables ", i,
" non positive");
107 if (!(file >> val[i]))
108 mooseError(
"Error CrystalPlasticityStateVariable: Premature end of state_variable file");
117 mooseError(
"CrystalPlasticityStateVariable: Error in reading initial state variable values: " 118 "Specify input in .i file or in state_variable file");
121 "CrystalPlasticityStateVariable: The size of the groups and group_values does not match.");
123 for (
unsigned int i = 0; i <
_groups.size() - 1; ++i)
131 mooseError(
"CrystalPlasticityStateVariable: Start index is = ",
133 " should be greater than end index ie = ",
135 " in state variable read");
137 for (
unsigned int j =
is;
j <= ie; ++
j)
144 const Point & )
const 146 mooseError(
"Error CrystalPlasticityStateVariable: User has to overwrite " 147 "'provideInitialValueByUser' function" 148 "in order to provide specific initial values based on quadrature point location.");
154 std::vector<Real> & val,
155 std::vector<Real> & val_old)
const 166 if (val_old[i] <
_zero && val[i] < 0.0)
169 val[i] = val_old[i] + val[i];
MooseEnum _intvar_read_type
Read from options for initial values of internal variables.
unsigned int _num_mat_state_var_evol_rate_comps
virtual void readInitialValueFromFile(std::vector< Real > &val) const
virtual bool updateStateVariable(unsigned int qp, Real dt, std::vector< Real > &val, std::vector< Real > &val_old) const
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", CrystalPlasticityStateVariable)
virtual void initSlipSysProps(std::vector< Real > &val, const Point &q_point) const
std::vector< unsigned int > _groups
The _groups variable is used to group slip systems and assign the initial values to each group...
Crystal plasticity system userobject base class.
virtual void provideInitialValueByUser(std::vector< Real > &, const Point &) const
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
PetscErrorCode PetscInt const PetscInt IS * is
CrystalPlasticityStateVariable(const InputParameters ¶meters)
std::vector< Real > _scale_factor
Scale factor of individual component.
std::vector< const MaterialProperty< std::vector< Real > > * > _mat_prop_state_var_evol_rate_comps
unsigned int _variable_size
FileName _state_variable_file_name
File should contain initial values of the state variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _group_values
The _group_values are the initial values corresponding to each group.
const MaterialProperty< T > & getMaterialProperty(const std::string &name, MaterialData &material_data, const unsigned int state=0)
virtual void readInitialValueFromInline(std::vector< Real > &val) const
static InputParameters validParams()
void mooseError(Args &&... args) const
Crystal plasticity state variable userobject class.
const InputParameters & parameters() const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Real _zero
Numerical zero for internal variable.
void ErrorVector unsigned int
const Elem & get(const ElemType type_in)