21 MooseEnum(getConstantTypeEnumOptions(),
"none"),
22 "When ELEMENT, MOOSE will only call computeQpProperties() for the 0th "
23 "quadrature point, and then copy that value to the other qps."
24 "When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th "
25 "quadrature point, and then copy that value to the other qps. Evaluations on element qps "
35 _bnd(_material_data_type !=
Moose::BLOCK_MATERIAL_DATA),
36 _neighbor(_material_data_type ==
Moose::NEIGHBOR_MATERIAL_DATA),
37 _q_point(_bnd ? (_neighbor ? _assembly.qPointsFaceNeighbor() : _assembly.qPointsFace())
38 : _assembly.qPoints()),
39 _qrule(_bnd ? (_neighbor ? _assembly.qRuleNeighbor() : _assembly.qRuleFace())
41 _JxW(_bnd ? _assembly.JxWFace() : _assembly.JxW()),
42 _current_elem(_neighbor ? _assembly.neighbor() : _assembly.elem()),
43 _current_subdomain_id(_neighbor ? _assembly.currentNeighborSubdomainID()
44 : _assembly.currentSubdomainID()),
45 _current_side(_neighbor ? _assembly.neighborSide() : _assembly.side()),
46 _constant_option(computeConstantOption()),
55 bool has_fe_vars =
false;
56 bool has_fv_vars =
false;
57 for (
auto *
const var : coupled_vars)
72 if (has_fe_vars && has_fv_vars)
76 " couples in both FE and FV vars. To support ghost calculations which some FV "
77 "consumers may need, multiphysics simulations should define separate materials for "
78 "coupling in finite element and finite volume variables because we do not have a user "
79 "friendly way of running DerivedMaterial::computeQpProperties and saying 'compute this "
80 "property because it doesn't depend on finite element variables' or 'don't compute this "
81 "property because it *does* depend on finite element variables'");
93 props[prop_id].resize(nqp);
104 for (
decltype(nqp) qp = 1; qp < nqp; ++qp)
105 props[prop_id].qpCopy(qp, props[prop_id], 0);
131 auto nqp =
_qrule->n_points();
132 for (
decltype(nqp) qp = 1; qp < nqp; ++qp)
133 props[prop_id].qpCopy(qp, props[prop_id], 0);
141Material::ConstantTypeEnum
144 auto co = getParam<MooseEnum>(
"constant_on").getEnum<ConstantTypeEnum>();
149 if (
_bnd && co == ConstantTypeEnum::SUBDOMAIN)
150 co = ConstantTypeEnum::ELEMENT;
159 mooseError(
"To ensure dependency resolution, discrete materials must be retrieved during "
160 "initial setup. This is a code problem.");
169 _requested_props.insert(discrete_requested.begin(), discrete_requested.end());
179 proxy->resolve(*
this);
const ExecFlagType EXEC_INITIAL
virtual bool boundaryRestricted() const
Returns true if this object has been restricted to a boundary.
Interface for objects that needs coupling capabilities.
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
unsigned int getMaxQps() const
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
MaterialBases compute MaterialProperties.
virtual void computeQpProperties()
Users must override this method.
std::set< unsigned int > _supplied_prop_ids
The ids of the supplied properties, i.e.
FEProblemBase & _fe_problem
virtual const std::set< std::string > & getRequestedItems() override
Return a set of properties accessed with getMaterialProperty.
std::set< std::string > _requested_props
Set of properties accessed via get method.
static InputParameters validParams()
std::unordered_set< unsigned int > _active_prop_ids
The ids of the current active supplied properties.
const MaterialProperties & props(const unsigned int state=0) const
{
An interface for accessing Materials.
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false)
virtual void checkMaterialProperty(const std::string &name, const unsigned int state)
A helper method for checking material properties This method was required to avoid a compiler problem...
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
MaterialData & _material_data
The material data class that stores properties.
static InputParameters validParams()
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
Retrieve the discrete material named "name".
virtual void computeProperties() override
Performs the quadrature point loop, calling computeQpProperties.
static InputParameters validParams()
virtual void resolveOptionalProperties() override
resolve all optional properties
const ConstantTypeEnum _constant_option
Options of the constantness level of the material.
ConstantTypeEnum computeConstantOption()
virtual const MaterialData & materialData() const override
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< Material > > > _optional_property_proxies
optional material properties
const QBase *const & _qrule
Material(const InputParameters ¶meters)
virtual void subdomainSetup() override
Subdomain setup evaluating material properties when required.
virtual void checkMaterialProperty(const std::string &name, const unsigned int state) override
A helper method for checking material properties This method was required to avoid a compiler problem...
bool _ghostable
Whether this material can be computed in a ghosted context.
const std::string & name() const
Get the name of the class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
void clear()
Clears the underlying vector.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...