43 template <
typename U,
bool is_ad = false>
47 template <
typename U,
bool is_ad = false>
58 template <
typename U,
bool is_ad = false>
62 template <
typename U,
bool is_ad = false>
64 const std::vector<SymbolName> & c);
66 template <
typename U,
bool is_ad = false>
80 template <
typename U,
bool is_ad = false>
84 template <
typename U,
bool is_ad = false>
88 template <
typename U,
bool is_ad = false>
101 template <
typename U,
bool is_ad = false>
108 template <
typename U,
bool is_ad = false>
123 template <
typename U,
bool is_ad = false>
126 const std::vector<VariableName> & c);
128 template <
typename U,
bool is_ad = false>
131 const std::vector<SymbolName> & c);
133 template <
typename U,
bool is_ad = false>
146 template <
typename U,
bool is_ad = false>
148 const std::vector<VariableName> & c,
149 bool validate_aux =
true);
151 template <
typename U,
bool is_ad = false>
153 const VariableName & c1 =
"",
154 const VariableName & c2 =
"",
155 const VariableName & c3 =
"");
157 template <
typename U,
bool is_ad = false>
159 const VariableName & c1 =
"",
160 const VariableName & c2 =
"",
161 const VariableName & c3 =
"");
170 template <
typename U,
bool is_ad = false>
175 template <
typename U,
bool is_ad = false>
179 std::vector<VariableName>
180 buildVariableVector(
const VariableName & c1,
const VariableName & c2,
const VariableName & c3);
183 template <
typename U,
bool is_ad = false>
185 const std::vector<VariableName> & c,
186 const System & system,
187 std::vector<VariableName> & missing);
200 _dmi_fe_problem(*parameters.getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base"))
205 template <
typename U,
bool is_ad>
210 this->
template hasBoundaryMaterialProperty<U, is_ad>(prop_name)) ||
211 (this->
template hasBlockMaterialProperty<U, is_ad>(prop_name)));
215 template <
typename U,
bool is_ad>
223 bnd->template hasBoundaryMaterialProperty<U, is_ad>(prop_name)) ||
224 (blk && blk->template hasBlockMaterialProperty<U, is_ad>(prop_name)) ||
225 (this->
template hasGenericMaterialProperty<U, is_ad>(prop_name)));
229 template <
typename U,
bool is_ad>
234 std::string prop_name = this->getMaterialPropertyName(
name);
237 const auto * default_property =
238 this->
template defaultGenericMaterialProperty<U, is_ad>(prop_name);
239 if (default_property)
240 return *default_property;
243 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(prop_name);
247 template <
typename U,
bool is_ad>
252 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(prop_name);
256 template <
typename U,
bool is_ad>
259 const std::vector<VariableName> & c)
261 std::vector<SymbolName> symbol_vector(c.begin(), c.end());
262 return declarePropertyDerivative<U, is_ad>(base, symbol_vector);
266 template <
typename U,
bool is_ad>
269 const std::vector<SymbolName> & c)
271 return this->
template declareGenericProperty<U, is_ad>(derivativePropertyName(base, c));
275 template <
typename U,
bool is_ad>
283 return this->
template declareGenericProperty<U, is_ad>(
284 derivativePropertyNameThird(base, c1, c2, c3));
286 return this->
template declareGenericProperty<U, is_ad>(
287 derivativePropertyNameSecond(base, c1, c2));
288 return this->
template declareGenericProperty<U, is_ad>(derivativePropertyNameFirst(base, c1));
292 template <
typename U,
bool is_ad>
295 const std::vector<VariableName> & c)
297 std::vector<SymbolName> symbol_vector(c.begin(), c.end());
298 return getMaterialPropertyDerivative(base, symbol_vector);
302 template <
typename U,
bool is_ad>
305 const std::vector<SymbolName> & c)
308 std::string prop_name = this->getMaterialPropertyName(base);
314 if (this->
template defaultGenericMaterialProperty<U, is_ad>(prop_name))
315 return this->
template getGenericZeroMaterialProperty<U, is_ad>();
317 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
318 derivativePropertyName(prop_name, c));
322 template <
typename U,
bool is_ad>
330 std::string prop_name = this->getMaterialPropertyName(base);
336 if (this->
template defaultGenericMaterialProperty<U, is_ad>(prop_name))
337 return this->
template getGenericZeroMaterialProperty<U, is_ad>();
340 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
341 derivativePropertyNameThird(prop_name, c1, c2, c3));
343 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
344 derivativePropertyNameSecond(prop_name, c1, c2));
345 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
346 derivativePropertyNameFirst(prop_name, c1));
350 template <
typename U,
bool is_ad>
357 return getMaterialPropertyDerivative<U, is_ad>(
360 this->_coupled_standard_moose_vars[v2]->name(),
365 template <
typename U,
bool is_ad>
372 return getMaterialPropertyDerivative<U, is_ad>(
374 this->_coupled_standard_moose_vars[v1]->name(),
380 template <
typename U,
bool is_ad>
383 const MaterialPropertyName & base,
const std::vector<VariableName> & c)
385 std::vector<SymbolName> symbol_vector(c.begin(), c.end());
386 return getMaterialPropertyDerivativeByName(base, symbol_vector);
390 template <
typename U,
bool is_ad>
393 const MaterialPropertyName & base,
const std::vector<SymbolName> & c)
395 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
396 derivativePropertyName(base, c));
400 template <
typename U,
bool is_ad>
403 const MaterialPropertyName & base,
409 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
410 derivativePropertyNameThird(base, c1, c2, c3));
412 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
413 derivativePropertyNameSecond(base, c1, c2));
414 return this->
template getGenericZeroMaterialPropertyByName<U, is_ad>(
415 derivativePropertyNameFirst(base, c1));
419 template <
typename U,
bool is_ad>
422 const std::vector<VariableName> & c,
423 const System & system,
424 std::vector<VariableName> & missing)
426 unsigned int ncoupled = this->_coupled_standard_moose_vars.size();
429 for (
unsigned int i = 0; i < system.n_variable_groups(); ++i)
431 const VariableGroup & vg = system.variable_group(i);
432 for (
unsigned int j = 0; j < vg.n_variables(); ++j)
434 std::vector<SymbolName> cj(c.begin(), c.end());
439 if (haveMaterialProperty<U, is_ad>(derivativePropertyName(base, cj)))
442 bool is_missing = isNotObjectVariable(jname);
444 for (
unsigned int k = 0; k < ncoupled; ++k)
445 if (this->_coupled_standard_moose_vars[k]->
name() == jname)
452 missing.push_back(jname);
459 template <
typename U,
bool is_ad>
462 const std::vector<VariableName> & c,
466 std::string prop_name = this->getMaterialPropertyName(base);
468 std::vector<VariableName> missing;
471 validateCouplingHelper<U, is_ad>(
472 prop_name, c, _dmi_fe_problem.getNonlinearSystemBase(0).system(), missing);
474 validateCouplingHelper<U, is_ad>(
475 prop_name, c, _dmi_fe_problem.getAuxiliarySystem().system(), missing);
477 if (missing.size() > 0)
480 std::string list = missing[0];
481 for (
unsigned int i = 1; i < missing.size(); ++i)
482 list +=
", " + missing[i];
486 "} (add them to coupled_variables parameter of ",
493 std::vector<VariableName>
495 const VariableName & c2,
496 const VariableName & c3)
498 std::vector<VariableName> c;
513 template <
typename U,
bool is_ad>
516 const VariableName & c1,
517 const VariableName & c2,
518 const VariableName & c3)
520 validateCoupling<U, is_ad>(base, buildVariableVector(c1, c2, c3),
true);
524 template <
typename U,
bool is_ad>
527 const VariableName & c1,
528 const VariableName & c2,
529 const VariableName & c3)
531 validateCoupling<U, is_ad>(base, buildVariableVector(c1, c2, c3),
false);
535 template <
typename U,
bool is_ad>
540 const MaterialPropertyName prop_name = this->
template getParam<MaterialPropertyName>(base);
544 if (!haveMaterialProperty<U, is_ad>(prop_name) &&
545 this->
template defaultGenericMaterialProperty<U, is_ad>(prop_name) == 0)
548 "' does not exist. The kernel '",
550 "' only needs its derivatives, but this may indicate a typo in the input file.");
559 if (kernel_ptr !=
nullptr)
564 if (bc_ptr !=
nullptr)
std::string name(const ElemQuality q)
DerivativeMaterialInterface(const InputParameters ¶meters)
const unsigned int invalid_uint
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 != "") ...
virtual bool boundaryRestricted() const
Returns true if this object has been restricted to a boundary.
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative(const std::string &base, const std::vector< VariableName > &c)
Methods for declaring derivative material properties.
void validateNonlinearCoupling(const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
const std::string & name() const override
Get the variable name.
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...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty(const std::string &name)
Fetch a material property if it exists, otherwise return getZeroMaterialProperty. ...
void validateCouplingHelper(const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
helper method to compile list of missing coupled variables for a given system
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative(const std::string &base, const std::vector< VariableName > &c)
Methods for retrieving derivative material properties.
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName(const MaterialPropertyName &base, const std::vector< VariableName > &c)
Methods for retrieving derivative material properties.
This is the common base class for the three main kernel types implemented in MOOSE, Kernel, VectorKernel and ArrayKernel.
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName(const std::string &name)
Fetch a material property by name if it exists, otherwise return getZeroMaterialProperty.
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
bool haveMaterialProperty(const std::string &prop_name)
Check if a material property is present with the applicable restrictions.
FEProblemBase & _dmi_fe_problem
Reference to FEProblemBase.
DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
Base class for creating new types of boundary conditions.
Interface class ("Veneer") to provide generator methods for derivative material property names...
An interface that restricts an object to subdomains via the 'blocks' input parameter.
virtual const MooseVariableBase & variable() const =0
Returns the variable that this object operates on.
bool boundaryRestricted(const std::set< BoundaryID > &boundary_ids)
void validateDerivativeMaterialPropertyBase(const std::string &base)
Check if the material property base exists.
bool isNotObjectVariable(const VariableName &name)