https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ConstantMaterial Class Reference

Constant material with zero-valued derivatives. More...

#include <ConstantMaterial.h>

Inheritance diagram for ConstantMaterial:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ConstantMaterial (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (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)
 
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="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

const Real & _value
 
const MaterialPropertyName _property_name
 
MaterialProperty< Real > & _property
 
const unsigned int _n_derivative_vars
 Number of variables for which to create zero-valued property derivatives.
 
std::vector< const VariableValue * > _derivative_vars
 List of variables for which to create zero-valued property derivatives.
 
std::vector< MaterialProperty< Real > * > _derivative_properties
 Derivatives of material property with respect to each variable.
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

Detailed Description

Constant material with zero-valued derivatives.

Definition at line 17 of file ConstantMaterial.h.

Constructor & Destructor Documentation

◆ ConstantMaterial()

ConstantMaterial::ConstantMaterial ( const InputParameters parameters)

Definition at line 29 of file ConstantMaterial.C.

31 _value(getParam<Real>("value")),
32 _property_name(getParam<std::string>("property_name")),
33 _property(declareProperty<Real>(_property_name)),
34 _n_derivative_vars(coupledComponents("derivative_vars"))
35{
36 // get references to new material property derivatives
38 if (!isCoupledConstant("derivative_vars"))
39 for (unsigned int i = 0; i < _n_derivative_vars; ++i)
41 &declarePropertyDerivative<Real>(_property_name, coupledName("derivative_vars", i));
42}
const unsigned int _n_derivative_vars
Number of variables for which to create zero-valued property derivatives.
const Real & _value
const MaterialPropertyName _property_name
std::vector< MaterialProperty< Real > * > _derivative_properties
Derivatives of material property with respect to each variable.
MaterialProperty< Real > & _property
virtual void resize(const std::size_t size) override final

Member Function Documentation

◆ computeQpProperties()

void ConstantMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 45 of file ConstantMaterial.C.

46{
47 _property[_qp] = _value;
48
49 for (unsigned int i = 0; i < _n_derivative_vars; ++i)
51 (*_derivative_properties[i])[_qp] = 0;
52}

◆ validParams()

InputParameters ConstantMaterial::validParams ( )
static

Definition at line 15 of file ConstantMaterial.C.

16{
18 params.addClassDescription("Defines a single constant material property, along with zero "
19 "derivative material properties for user-defined variables");
20 params.addParam<Real>("value", 0., "Constant value being assigned into the property");
21 params.addRequiredParam<std::string>("property_name", "The property name to declare");
22 params.addCoupledVar(
23 "derivative_vars",
24 "Names of variables for which to create (zero) material derivative properties");
25 params.set<MooseEnum>("constant_on") = "SUBDOMAIN";
26 return params;
27}
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _derivative_properties

std::vector<MaterialProperty<Real> *> ConstantMaterial::_derivative_properties
protected

Derivatives of material property with respect to each variable.

Definition at line 38 of file ConstantMaterial.h.

Referenced by computeQpProperties(), and ConstantMaterial().

◆ _derivative_vars

std::vector<const VariableValue *> ConstantMaterial::_derivative_vars
protected

List of variables for which to create zero-valued property derivatives.

Definition at line 35 of file ConstantMaterial.h.

◆ _n_derivative_vars

const unsigned int ConstantMaterial::_n_derivative_vars
protected

Number of variables for which to create zero-valued property derivatives.

Definition at line 32 of file ConstantMaterial.h.

Referenced by computeQpProperties(), and ConstantMaterial().

◆ _property

MaterialProperty<Real>& ConstantMaterial::_property
protected

Definition at line 29 of file ConstantMaterial.h.

Referenced by computeQpProperties().

◆ _property_name

const MaterialPropertyName ConstantMaterial::_property_name
protected

Definition at line 27 of file ConstantMaterial.h.

Referenced by ConstantMaterial().

◆ _value

const Real& ConstantMaterial::_value
protected

Definition at line 25 of file ConstantMaterial.h.

Referenced by computeQpProperties().


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