www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CompositeTensorBase< T, U > Class Template Reference

CompositeTensorBase computes a simple T type MaterialProperty \( \bar T\) that is summed up from a list of other T objects (tensors) \( T_i \) with associated weights \( w_i \). More...

#include <CompositeTensorBase.h>

Inheritance diagram for CompositeTensorBase< T, U >:
[legend]

Public Member Functions

 CompositeTensorBase (const InputParameters &parameters)
 
const MaterialProperty< U > & getDefaultMaterialProperty (const std::string &name)
 Fetch a material property if it exists, otherwise return getZeroMaterialProperty. More...
 
const MaterialProperty< U > & getDefaultMaterialPropertyByName (const std::string &name)
 Fetch a material property by name if it exists, otherwise return getZeroMaterialProperty. More...
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 Check if the material property base exists. More...
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< VariableName > &c) const
 Helper functions to generate the material property names for the arbitrary derivatives. More...
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const VariableName &c1) const
 Helper functions to generate the material property names for the first derivatives. More...
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2) const
 Helper functions to generate the material property names for the second derivatives. More...
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2, const VariableName &c3) const
 Helper functions to generate the material property names for the third derivatives. More...
 
MaterialProperty< U > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 Methods for declaring derivative material properties. More...
 
MaterialProperty< U > & declarePropertyDerivative (const std::string &base, const VariableName &c1, const VariableName &c2="", const VariableName &c3="")
 
const MaterialProperty< U > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 Methods for retreiving derivative material properties. More...
 
const MaterialProperty< U > & getMaterialPropertyDerivative (const std::string &base, const VariableName &c1, const VariableName &c2="", const VariableName &c3="")
 
const MaterialProperty< U > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 Methods for retreiving derivative material properties. More...
 
const MaterialProperty< U > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 check if derivatives of the passed in material property exist w.r.t a variable that is not coupled in to the current object More...
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

void initializeDerivativeProperties (const std::string name)
 Output material properties are initialized here so that derived classes can modify the name. More...
 
virtual void computeQpTensorProperties (MaterialProperty< T > &M, Real derivative_prefactor=1.0)
 Fill in the. More...
 

Protected Attributes

std::vector< MaterialPropertyName > _tensor_names
 component tensor names More...
 
std::vector< MaterialPropertyName > _weight_names
 component weight names More...
 
unsigned int _num_args
 number of dependent variables More...
 
unsigned int _num_comp
 number of compomemt tensors and weights More...
 
std::vector< MaterialProperty< T > * > _dM
 Composed tensor and its derivatives. More...
 
std::vector< std::vector< MaterialProperty< T > * > > _d2M
 
std::vector< const MaterialProperty< T > * > _tensors
 component tensors and their derivatives w.r.t. the args More...
 
std::vector< std::vector< const MaterialProperty< T > * > > _dtensors
 
std::vector< std::vector< std::vector< const MaterialProperty< T > * > > > _d2tensors
 
std::vector< const MaterialProperty< Real > * > _weights
 component weights and their derivatives w.r.t. the args More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _dweights
 
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2weights
 

Detailed Description

template<class T, class U>
class CompositeTensorBase< T, U >

CompositeTensorBase computes a simple T type MaterialProperty \( \bar T\) that is summed up from a list of other T objects (tensors) \( T_i \) with associated weights \( w_i \).

\( \bar T = \sum_i T_i\cdot w_i \) Derivatives w.r.t. variables are computed accordingly. This base class is used by the CompositeMobilityTensor and CompositeElasticityTensor classes.

Template Parameters
TThe type of the objects to sum together

Definition at line 28 of file CompositeTensorBase.h.

Constructor & Destructor Documentation

◆ CompositeTensorBase()

template<class T , class U >
CompositeTensorBase< T, U >::CompositeTensorBase ( const InputParameters parameters)

Definition at line 82 of file CompositeTensorBase.h.

83  : DerivativeMaterialInterface<U>(parameters),
84  _tensor_names(this->template getParam<std::vector<MaterialPropertyName>>("tensors")),
85  _weight_names(this->template getParam<std::vector<MaterialPropertyName>>("weights")),
87  _num_comp(_tensor_names.size()),
88  _dM(_num_args),
89  _d2M(_num_args),
96 {
97  if (_num_comp != _weight_names.size())
98  mooseError("The number of supplied 'tensors' and 'weights' must match.");
99 }
std::vector< const MaterialProperty< Real > * > _weights
component weights and their derivatives w.r.t. the args
std::vector< MaterialProperty< T > * > _dM
Composed tensor and its derivatives.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::vector< MaterialPropertyName > _weight_names
component weight names
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2weights
std::vector< const MaterialProperty< T > * > _tensors
component tensors and their derivatives w.r.t. the args
std::vector< std::vector< const MaterialProperty< T > * > > _dtensors
unsigned int _num_comp
number of compomemt tensors and weights
std::vector< std::vector< const MaterialProperty< Real > * > > _dweights
unsigned int _num_args
number of dependent variables
std::vector< std::vector< MaterialProperty< T > * > > _d2M
std::vector< MaterialPropertyName > _tensor_names
component tensor names
std::vector< std::vector< std::vector< const MaterialProperty< T > * > > > _d2tensors

Member Function Documentation

◆ computeQpTensorProperties()

template<class T , class U >
void CompositeTensorBase< T, U >::computeQpTensorProperties ( MaterialProperty< T > &  M,
Real  derivative_prefactor = 1.0 
)
protectedvirtual

Fill in the.

  • main tensor property given by M
  • derivatives, set up by initializeDerivativeProperties

The root_property is kept separate from the derivatives to allow the application of this template to the Eigenstrain calculation, which contributes derivatives to a different material property (and uses a derivative_prefactor of -1).

Definition at line 169 of file CompositeTensorBase.h.

171 {
172  const unsigned int qp = this->DerivativeMaterialInterface<U>::_qp;
173 
174  M[qp].zero();
175  for (unsigned int i = 0; i < _num_comp; ++i)
176  {
177  M[qp] += (*_tensors[i])[qp] * (*_weights[i])[qp];
178 
179  for (unsigned int j = 0; j < _num_args; ++j)
180  {
181  if (i == 0)
182  (*_dM[j])[qp].zero();
183 
184  (*_dM[j])[qp] += derivative_prefactor * ((*_tensors[i])[qp] * (*_dweights[i][j])[qp] +
185  (*_dtensors[i][j])[qp] * (*_weights[i])[qp]);
186 
187  for (unsigned int k = 0; k <= j; ++k)
188  {
189  if (i == 0)
190  (*_d2M[j][k])[qp].zero();
191 
192  (*_d2M[j][k])[qp] +=
193  derivative_prefactor * (2.0 * (*_dtensors[i][j])[qp] * (*_dweights[i][j])[qp] +
194  (*_tensors[i])[qp] * (*_d2weights[i][j][k])[qp] +
195  (*_d2tensors[i][j][k])[qp] * (*_weights[i])[qp]);
196  }
197  }
198  }
199 }
std::vector< const MaterialProperty< Real > * > _weights
component weights and their derivatives w.r.t. the args
std::vector< MaterialProperty< T > * > _dM
Composed tensor and its derivatives.
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2weights
std::vector< const MaterialProperty< T > * > _tensors
component tensors and their derivatives w.r.t. the args
std::vector< std::vector< const MaterialProperty< T > * > > _dtensors
unsigned int _num_comp
number of compomemt tensors and weights
Interface class ("Veneer") to provide generator methods for derivative material property names...
PetscInt M
std::vector< std::vector< const MaterialProperty< Real > * > > _dweights
unsigned int _num_args
number of dependent variables
std::vector< std::vector< MaterialProperty< T > * > > _d2M
std::vector< std::vector< std::vector< const MaterialProperty< T > * > > > _d2tensors

◆ declarePropertyDerivative() [1/2]

MaterialProperty< U > & DerivativeMaterialInterface< U >::declarePropertyDerivative ( const std::string &  base,
const std::vector< VariableName > &  c 
)
inherited

Methods for declaring derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
cThe variable(s) to take the derivatives with respect to

Definition at line 218 of file DerivativeMaterialInterface.h.

220 {
221  return this->template declareProperty<U>(propertyName(base, c));
222 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ declarePropertyDerivative() [2/2]

MaterialProperty< U > & DerivativeMaterialInterface< U >::declarePropertyDerivative ( const std::string &  base,
const VariableName &  c1,
const VariableName &  c2 = "",
const VariableName &  c3 = "" 
)
inherited

Definition at line 227 of file DerivativeMaterialInterface.h.

231 {
232  if (c3 != "")
233  return this->template declareProperty<U>(propertyNameThird(base, c1, c2, c3));
234  if (c2 != "")
235  return this->template declareProperty<U>(propertyNameSecond(base, c1, c2));
236  return this->template declareProperty<U>(propertyNameFirst(base, c1));
237 }
const MaterialPropertyName propertyNameThird(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2, const VariableName &c3) const
Helper functions to generate the material property names for the third derivatives.
const MaterialPropertyName propertyNameFirst(const MaterialPropertyName &base, const VariableName &c1) const
Helper functions to generate the material property names for the first derivatives.
const MaterialPropertyName propertyNameSecond(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2) const
Helper functions to generate the material property names for the second derivatives.

◆ getDefaultMaterialProperty()

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getDefaultMaterialProperty ( const std::string &  name)
inherited

Fetch a material property if it exists, otherwise return getZeroMaterialProperty.

Parameters
nameThe input parameter key of type MaterialPropertyName

Definition at line 188 of file DerivativeMaterialInterface.h.

189 {
190  // get the base property name
191  std::string prop_name = this->deducePropertyName(name);
192 
193  // Check if it's just a constant
194  const MaterialProperty<U> * default_property =
195  this->template defaultMaterialProperty<U>(prop_name);
196  if (default_property)
197  return *default_property;
198 
199  // if found return the requested property
200  return getDefaultMaterialPropertyByName<U>(prop_name);
201 }
Concrete definition of a parameter value for a specified type.

◆ getDefaultMaterialPropertyByName()

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getDefaultMaterialPropertyByName ( const std::string &  name)
inherited

Fetch a material property by name if it exists, otherwise return getZeroMaterialProperty.

Definition at line 206 of file DerivativeMaterialInterface.h.

207 {
208  // if found return the requested property
209  if (haveMaterialProperty<U>(prop_name))
210  return this->template getMaterialPropertyByName<U>(prop_name);
211 
212  return this->template getZeroMaterialProperty<U>(prop_name);
213 }

◆ getMaterialPropertyDerivative() [1/2]

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getMaterialPropertyDerivative ( const std::string &  base,
const std::vector< VariableName > &  c 
)
inherited

Methods for retreiving derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
cThe variable(s) to take the derivatives with respect to

Check if base is a default property and shortcut to returning zero, as derivatives of constants are zero.

Definition at line 242 of file DerivativeMaterialInterface.h.

244 {
245  // get the base property name
246  std::string prop_name = this->deducePropertyName(base);
247 
252  if (this->template defaultMaterialProperty<U>(prop_name))
253  return this->template getZeroMaterialProperty<U>(prop_name + "_zeroderivative");
254 
255  return getDefaultMaterialPropertyByName<U>(propertyName(prop_name, c));
256 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ getMaterialPropertyDerivative() [2/2]

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getMaterialPropertyDerivative ( const std::string &  base,
const VariableName &  c1,
const VariableName &  c2 = "",
const VariableName &  c3 = "" 
)
inherited

Check if base is a default property and shortcut to returning zero, as derivatives of constants are zero.

Definition at line 261 of file DerivativeMaterialInterface.h.

265 {
266  // get the base property name
267  std::string prop_name = this->deducePropertyName(base);
268 
273  if (this->template defaultMaterialProperty<U>(prop_name))
274  return this->template getZeroMaterialProperty<U>(prop_name + "_zeroderivative");
275 
276  if (c3 != "")
277  return getDefaultMaterialPropertyByName<U>(propertyNameThird(prop_name, c1, c2, c3));
278  if (c2 != "")
279  return getDefaultMaterialPropertyByName<U>(propertyNameSecond(prop_name, c1, c2));
280  return getDefaultMaterialPropertyByName<U>(propertyNameFirst(prop_name, c1));
281 }
const MaterialPropertyName propertyNameThird(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2, const VariableName &c3) const
Helper functions to generate the material property names for the third derivatives.
const MaterialPropertyName propertyNameFirst(const MaterialPropertyName &base, const VariableName &c1) const
Helper functions to generate the material property names for the first derivatives.
const MaterialPropertyName propertyNameSecond(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2) const
Helper functions to generate the material property names for the second derivatives.

◆ getMaterialPropertyDerivativeByName() [1/2]

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getMaterialPropertyDerivativeByName ( const MaterialPropertyName &  base,
const std::vector< VariableName > &  c 
)
inherited

Methods for retreiving derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
cThe variable(s) to take the derivatives with respect to

Definition at line 286 of file DerivativeMaterialInterface.h.

288 {
289  return getDefaultMaterialPropertyByName<U>(propertyName(base, c));
290 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ getMaterialPropertyDerivativeByName() [2/2]

const MaterialProperty< U > & DerivativeMaterialInterface< U >::getMaterialPropertyDerivativeByName ( const MaterialPropertyName &  base,
const VariableName &  c1,
const VariableName &  c2 = "",
const VariableName &  c3 = "" 
)
inherited

Definition at line 295 of file DerivativeMaterialInterface.h.

300 {
301  if (c3 != "")
302  return getDefaultMaterialPropertyByName<U>(propertyNameThird(base, c1, c2, c3));
303  if (c2 != "")
304  return getDefaultMaterialPropertyByName<U>(propertyNameSecond(base, c1, c2));
305  return getDefaultMaterialPropertyByName<U>(propertyNameFirst(base, c1));
306 }
const MaterialPropertyName propertyNameThird(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2, const VariableName &c3) const
Helper functions to generate the material property names for the third derivatives.
const MaterialPropertyName propertyNameFirst(const MaterialPropertyName &base, const VariableName &c1) const
Helper functions to generate the material property names for the first derivatives.
const MaterialPropertyName propertyNameSecond(const MaterialPropertyName &base, const VariableName &c1, const VariableName &c2) const
Helper functions to generate the material property names for the second derivatives.

◆ initializeDerivativeProperties()

template<class T , class U >
void CompositeTensorBase< T, U >::initializeDerivativeProperties ( const std::string  name)
protected

Output material properties are initialized here so that derived classes can modify the name.

Definition at line 114 of file CompositeTensorBase.h.

115 {
116  // setup output composite tensor and derivatives
117  for (unsigned int j = 0; j < _num_args; ++j)
118  {
119  const VariableName & jname = this->DerivativeMaterialInterface<U>::getVar("args", j)->name();
120  _dM[j] = &this->template declarePropertyDerivative<T>(name, jname);
121  _d2M[j].resize(j + 1);
122 
123  for (unsigned int k = 0; k <= j; ++k)
124  {
125  const VariableName & kname = this->DerivativeMaterialInterface<U>::getVar("args", k)->name();
126  _d2M[j][k] = &this->template declarePropertyDerivative<T>(name, jname, kname);
127  }
128  }
129 
130  // setup input components and its derivatives
131  for (unsigned int i = 0; i < _num_comp; ++i)
132  {
133  _tensors[i] = &this->template getMaterialPropertyByName<T>(_tensor_names[i]);
134  _weights[i] = &this->template getMaterialPropertyByName<Real>(_weight_names[i]);
135 
136  _dtensors[i].resize(_num_args);
137  _dweights[i].resize(_num_args);
138  _d2tensors[i].resize(_num_args);
139  _d2weights[i].resize(_num_args);
140 
141  for (unsigned int j = 0; j < _num_args; ++j)
142  {
143  const VariableName & jname = this->DerivativeMaterialInterface<U>::getVar("args", j)->name();
144 
145  _dtensors[i][j] =
146  &this->template getMaterialPropertyDerivativeByName<T>(_tensor_names[i], jname);
147  _dweights[i][j] =
148  &this->template getMaterialPropertyDerivativeByName<Real>(_weight_names[i], jname);
149 
150  _d2tensors[i][j].resize(j + 1);
151  _d2weights[i][j].resize(j + 1);
152 
153  for (unsigned int k = 0; k <= j; ++k)
154  {
155  const VariableName & kname =
156  this->DerivativeMaterialInterface<U>::getVar("args", k)->name();
157 
158  _d2tensors[i][j][k] =
159  &this->template getMaterialPropertyDerivativeByName<T>(_tensor_names[i], jname, kname);
160  _d2weights[i][j][k] = &this->template getMaterialPropertyDerivativeByName<Real>(
161  _weight_names[i], jname, kname);
162  }
163  }
164  }
165 }
std::vector< const MaterialProperty< Real > * > _weights
component weights and their derivatives w.r.t. the args
std::vector< MaterialProperty< T > * > _dM
Composed tensor and its derivatives.
std::vector< MaterialPropertyName > _weight_names
component weight names
std::vector< std::vector< std::vector< const MaterialProperty< Real > * > > > _d2weights
std::vector< const MaterialProperty< T > * > _tensors
component tensors and their derivatives w.r.t. the args
std::vector< std::vector< const MaterialProperty< T > * > > _dtensors
unsigned int _num_comp
number of compomemt tensors and weights
Interface class ("Veneer") to provide generator methods for derivative material property names...
std::vector< std::vector< const MaterialProperty< Real > * > > _dweights
unsigned int _num_args
number of dependent variables
std::vector< std::vector< MaterialProperty< T > * > > _d2M
std::vector< MaterialPropertyName > _tensor_names
component tensor names
std::vector< std::vector< std::vector< const MaterialProperty< T > * > > > _d2tensors

◆ propertyName()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyName ( const MaterialPropertyName &  base,
const std::vector< VariableName > &  c 
) const
inherited

Helper functions to generate the material property names for the arbitrary derivatives.

Definition at line 15 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by FunctionMaterialPropertyDescriptor::getPropertyName(), DerivativeMaterialPropertyNameInterface::propertyNameSecond(), and DerivativeMaterialPropertyNameInterface::propertyNameThird().

17 {
18  // to obtain well defined names we sort alphabetically
19  std::vector<VariableName> a(c);
20  std::sort(a.begin(), a.end());
21 
22  // derivative order
23  unsigned int order = a.size();
24  if (order == 0)
25  return base;
26 
27  // build the property name as a stringstream
28  std::stringstream name;
29 
30  // build numerator
31  name << 'd';
32  if (order > 1)
33  name << '^' << order;
34  name << base << '/';
35 
36  // build denominator with 'pretty' names using exponents rather than repeat multiplication
37  unsigned int exponent = 1;
38  for (unsigned i = 1; i <= order; ++i)
39  {
40  if (i == order || a[i - 1] != a[i])
41  {
42  name << 'd' << a[i - 1];
43  if (exponent > 1)
44  name << '^' << exponent;
45  exponent = 1;
46  }
47  else
48  exponent++;
49  }
50 
51  return name.str();
52 }

◆ propertyNameFirst()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameFirst ( const MaterialPropertyName &  base,
const VariableName &  c1 
) const
inherited

Helper functions to generate the material property names for the first derivatives.

Definition at line 55 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

57 {
58  return "d" + base + "/d" + c1;
59 }

◆ propertyNameSecond()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameSecond ( const MaterialPropertyName &  base,
const VariableName &  c1,
const VariableName &  c2 
) const
inherited

Helper functions to generate the material property names for the second derivatives.

Definition at line 62 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

65 {
66  return propertyName(base, {c1, c2});
67 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ propertyNameThird()

const MaterialPropertyName DerivativeMaterialPropertyNameInterface::propertyNameThird ( const MaterialPropertyName &  base,
const VariableName &  c1,
const VariableName &  c2,
const VariableName &  c3 
) const
inherited

Helper functions to generate the material property names for the third derivatives.

Definition at line 70 of file DerivativeMaterialPropertyNameInterface.C.

Referenced by DerivativeFunctionMaterialBase::initialSetup().

74 {
75  return propertyName(base, {c1, c2, c3});
76 }
const MaterialPropertyName propertyName(const MaterialPropertyName &base, const std::vector< VariableName > &c) const
Helper functions to generate the material property names for the arbitrary derivatives.

◆ validateCoupling() [1/2]

void DerivativeMaterialInterface< U >::validateCoupling ( const MaterialPropertyName &  base,
const std::vector< VariableName > &  c,
bool  validate_aux = true 
)
inherited

check if derivatives of the passed in material property exist w.r.t a variable that is not coupled in to the current object

Definition at line 351 of file DerivativeMaterialInterface.h.

354 {
355  // get the base property name
356  std::string prop_name = this->deducePropertyName(base);
357  // list of potentially missing coupled variables
358  std::vector<VariableName> missing;
359 
360  // iterate over all variables in the both the non-linear and auxiliary system (optional)
361  validateCouplingHelper<U>(
362  prop_name, c, _dmi_fe_problem.getNonlinearSystemBase().system(), missing);
363  if (validate_aux)
364  validateCouplingHelper<U>(prop_name, c, _dmi_fe_problem.getAuxiliarySystem().system(), missing);
365 
366  if (missing.size() > 0)
367  {
368  // join list of missing variable names
369  std::string list = missing[0];
370  for (unsigned int i = 1; i < missing.size(); ++i)
371  list += ", " + missing[i];
372 
373  mooseWarning("Missing coupled variables {",
374  list,
375  "} (add them to args parameter of ",
376  this->name(),
377  ")");
378  }
379 }
NonlinearSystemBase & getNonlinearSystemBase()
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
FEProblemBase & _dmi_fe_problem
Reference to FEProblemBase.
AuxiliarySystem & getAuxiliarySystem()
virtual System & system() override
Get the reference to the libMesh system.
virtual System & system() override
Get the reference to the libMesh system.

◆ validateCoupling() [2/2]

void DerivativeMaterialInterface< U >::validateCoupling ( const MaterialPropertyName &  base,
const VariableName &  c1 = "",
const VariableName &  c2 = "",
const VariableName &  c3 = "" 
)
inherited

Definition at line 404 of file DerivativeMaterialInterface.h.

408 {
409  validateCoupling<U>(base, buildVariableVector(c1, c2, c3), true);
410 }
std::vector< VariableName > buildVariableVector(const VariableName &c1, const VariableName &c2, const VariableName &c3)
helper method to combine multiple VariableNames into a vector (if they are != "") ...

◆ validateDerivativeMaterialPropertyBase()

void DerivativeMaterialInterface< U >::validateDerivativeMaterialPropertyBase ( const std::string &  base)
inherited

Check if the material property base exists.

Print a warning if it doesn't. This is useful in materials that pull in only derivative properties, which are optional. If the base property name has a typo all derivatives will be set to zero without the user ever knowing.

Definition at line 426 of file DerivativeMaterialInterface.h.

427 {
428  // resolve the input parameter name base to the actual material property name
429  const MaterialPropertyName prop_name = this->template getParam<MaterialPropertyName>(base);
430 
431  // check if the material property does not exist on the blocks of the current object,
432  // and check if it is not a plain number in the input file
433  if (!haveMaterialProperty<U>(prop_name) &&
434  this->template defaultMaterialProperty<U>(prop_name) == 0)
435  mooseWarning("The material property '",
436  prop_name,
437  "' does not exist. The kernel '",
438  this->name(),
439  "' only needs its derivatives, but this may indicate a typo in the input file.");
440 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220

◆ validateNonlinearCoupling()

void DerivativeMaterialInterface< U >::validateNonlinearCoupling ( const MaterialPropertyName &  base,
const VariableName &  c1 = "",
const VariableName &  c2 = "",
const VariableName &  c3 = "" 
)
inherited

Definition at line 415 of file DerivativeMaterialInterface.h.

419 {
420  validateCoupling<U>(base, buildVariableVector(c1, c2, c3), false);
421 }
std::vector< VariableName > buildVariableVector(const VariableName &c1, const VariableName &c2, const VariableName &c3)
helper method to combine multiple VariableNames into a vector (if they are != "") ...

◆ validParams()

template<class T , class U >
InputParameters CompositeTensorBase< T, U >::validParams ( )
static

Definition at line 103 of file CompositeTensorBase.h.

104 {
105  InputParameters params = ::validParams<U>();
106  params.addRequiredParam<std::vector<MaterialPropertyName>>("tensors", "Component tensors");
107  params.addRequiredParam<std::vector<MaterialPropertyName>>("weights", "Component weights");
108  params.addRequiredCoupledVar("args", "variable dependencies for the prefactor");
109  return params;
110 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.

Member Data Documentation

◆ _d2M

template<class T , class U >
std::vector<std::vector<MaterialProperty<T> *> > CompositeTensorBase< T, U >::_d2M
protected

Definition at line 65 of file CompositeTensorBase.h.

◆ _d2tensors

template<class T , class U >
std::vector<std::vector<std::vector<const MaterialProperty<T> *> > > CompositeTensorBase< T, U >::_d2tensors
protected

Definition at line 71 of file CompositeTensorBase.h.

◆ _d2weights

template<class T , class U >
std::vector<std::vector<std::vector<const MaterialProperty<Real> *> > > CompositeTensorBase< T, U >::_d2weights
protected

Definition at line 77 of file CompositeTensorBase.h.

◆ _dM

template<class T , class U >
std::vector<MaterialProperty<T> *> CompositeTensorBase< T, U >::_dM
protected

Composed tensor and its derivatives.

Definition at line 64 of file CompositeTensorBase.h.

◆ _dtensors

template<class T , class U >
std::vector<std::vector<const MaterialProperty<T> *> > CompositeTensorBase< T, U >::_dtensors
protected

Definition at line 70 of file CompositeTensorBase.h.

◆ _dweights

template<class T , class U >
std::vector<std::vector<const MaterialProperty<Real> *> > CompositeTensorBase< T, U >::_dweights
protected

Definition at line 76 of file CompositeTensorBase.h.

◆ _num_args

template<class T , class U >
unsigned int CompositeTensorBase< T, U >::_num_args
protected

number of dependent variables

Definition at line 59 of file CompositeTensorBase.h.

◆ _num_comp

template<class T , class U >
unsigned int CompositeTensorBase< T, U >::_num_comp
protected

number of compomemt tensors and weights

Definition at line 61 of file CompositeTensorBase.h.

Referenced by CompositeTensorBase< T, U >::CompositeTensorBase().

◆ _tensor_names

template<class T , class U >
std::vector<MaterialPropertyName> CompositeTensorBase< T, U >::_tensor_names
protected

component tensor names

Definition at line 54 of file CompositeTensorBase.h.

◆ _tensors

template<class T , class U >
std::vector<const MaterialProperty<T> *> CompositeTensorBase< T, U >::_tensors
protected

component tensors and their derivatives w.r.t. the args

Definition at line 69 of file CompositeTensorBase.h.

◆ _weight_names

template<class T , class U >
std::vector<MaterialPropertyName> CompositeTensorBase< T, U >::_weight_names
protected

component weight names

Definition at line 56 of file CompositeTensorBase.h.

Referenced by CompositeTensorBase< T, U >::CompositeTensorBase().

◆ _weights

template<class T , class U >
std::vector<const MaterialProperty<Real> *> CompositeTensorBase< T, U >::_weights
protected

component weights and their derivatives w.r.t. the args

Definition at line 75 of file CompositeTensorBase.h.


The documentation for this class was generated from the following file: