Go to the documentation of this file.
12 #include "libmesh/quadrature.h"
24 params.
addParam<std::vector<std::string>>(
26 "Base name of the free energy function (used to name the material properties)");
32 "args",
"Arguments of the free energy functions being summed - use vector coupling");
34 "Vector of displacement gradient variables (see "
35 "Modules/PhaseField/DisplacementGradients "
39 params.
addParam<std::vector<Real>>(
"prefactor",
"Prefactor to multiply the sum term with.");
40 params.
addParam<Real>(
"constant", 0.0,
"Constant to be added to the prefactor multiplied sum.");
48 _sum_materials(getParam<
std::vector<
std::string>>(
"sum_materials")),
49 _num_materials(_sum_materials.size()),
50 _prefactor(_num_materials, 1.0),
51 _constant(getParam<Real>(
"constant"))
55 mooseError(
"Please supply at least one material to sum in DerivativeSumMaterial ",
name());
58 std::vector<Real> p = getParam<std::vector<Real>>(
"prefactor");
63 else if (p.size() != 0)
64 mooseError(
"Supply the same nummber of sum materials and prefactors.");
79 for (
unsigned int i = 0; i <
_nargs; ++i)
87 for (
unsigned int j = 0; j <
_nargs; ++j)
96 for (
unsigned int k = 0; k <
_nargs; ++k)
97 _summand_d3F[
n][i][j][k] = &getMaterialPropertyDerivative<Real>(
115 unsigned int i, j, k;
127 for (i = 0; i <
_nargs; ++i)
138 for (j = i; j <
_nargs; ++j)
150 for (k = j; k <
_nargs; ++k)
const QBase *const & _qrule
std::vector< Real > _prefactor
arguments to construct a sum of the form
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _summand_d2F
Second derivatives of the summands.
std::vector< MaterialProperty< Real > * > _prop_dF
Material properties to store the derivatives of f with respect to arg[i].
void mooseError(Args &&... args) const
MaterialProperty< Real > * _prop_F
Material property to store the function value.
defineLegacyParams(DerivativeSumMaterial)
std::vector< std::string > _sum_materials
Material base class to compute a function and its derivatives.
std::vector< std::vector< MaterialProperty< Real > * > > _prop_d2F
Material properties to store the second derivatives.
std::vector< std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > > _summand_d3F
Third derivatives of the summands.
bool _third_derivatives
Calculate (and allocate memory for) the third derivatives of the free energy.
unsigned int _num_materials
unsigned int _nargs
Number of coupled arguments.
DerivativeSumMaterial(const InputParameters ¶meters)
std::vector< const MaterialProperty< Real > * > _summand_F
Function values of the summands.
virtual void computeProperties()
Performs the quadrature point loop, calling computeQpProperties.
static InputParameters validParams()
std::vector< std::string > _arg_names
String vector of all argument names.
registerMooseObject("MooseApp", DerivativeSumMaterial)
std::vector< std::vector< std::vector< MaterialProperty< Real > * > > > _prop_d3F
Material properties to store the third derivatives.
static InputParameters validParams()
virtual void initialSetup()
Check if we got the right number of components in the 'args' coupled variable vector.
std::vector< std::vector< const MaterialProperty< Real > * > > _summand_dF
Derivatives of the summands with respect to arg[i].
virtual const std::string & name() const
Get the name of the object.