14 #include "libmesh/quadrature.h" 23 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names");
25 "at_nodes",
false,
"Evaluate Material properties at nodes instead of quadpoints");
27 params.
addClassDescription(
"This generalises MOOSE's Material class to allow for Materials that " 28 "hold information related to the nodes in the finite element");
32 params.
set<
bool>(
"_force_stateful_init") =
true;
39 _nodal_material(getParam<bool>(
"at_nodes")),
41 _pressure_variable_name(
"pressure_variable"),
42 _saturation_variable_name(
"saturation_variable"),
43 _temperature_variable_name(
"temperature_variable"),
44 _mass_fraction_variable_name(
"mass_fraction_variable")
56 if (!storage.hasStatefulProperties())
60 for (
const auto i :
index_range(stateful_prop_id_to_prop_id))
62 const auto prop_id = stateful_prop_id_to_prop_id[i];
98 if (numnodes < _qrule->n_points())
104 for (
unsigned int qp = numnodes; qp <
_qrule->n_points(); ++qp)
105 props[prop_id].qpCopy(qp, props[prop_id], numnodes - 1);
151 props[prop_id].
resize(new_size);
153 for (
const auto state : storage.statefulIndexRange())
162 unsigned nearest_qp = 0;
163 Real smallest_dist = std::numeric_limits<Real>::max();
167 if (this_dist < smallest_dist)
170 smallest_dist = this_dist;
const MooseArray< Point > & _q_point
const MaterialPropertyStorage & getMaterialPropertyStorage() const
virtual void initStatefulProperties(const unsigned int n_points)
void sizeNodalProperties()
Resizes properties to be equal to max(number of nodes, number of quadpoints) in the current element...
virtual void computeProperties() override
Correctly sizes nodal materials, then computes using Material::computeProperties. ...
const QBase *const & _qrule
virtual void computeQpProperties()
void onlyResizeIfSmaller(bool flag)
std::vector< unsigned int > _supplied_old_prop_ids
stateful material property ids that this material supplies
virtual void initialSetup() override
virtual void initStatefulProperties(unsigned int n_points) override
Correctly sizes nodal materials, then initialises using Material::initStatefulProperties.
virtual void computeProperties() override
const bool _nodal_material
Whether the derived class holds nodal values.
void resize(const std::size_t size, const WriteKey)
const std::vector< unsigned int > & statefulProps() const
MaterialData & _material_data
static InputParameters validParams()
const MaterialProperties & props(const unsigned int state=0) const
std::set< unsigned int > _supplied_prop_ids
PorousFlowMaterial(const InputParameters ¶meters)
static InputParameters validParams()
unsigned nearestQP(unsigned nodenum) const
Find the nearest quadpoint to the node labelled by nodenum in the current element.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
IntRange< T > make_range(T beg, T end)
bool hasValue(const std::size_t i) const
auto index_range(const T &sizable)
const Elem *const & _current_elem
void computeNodalProperties()
Compute the material properties at each node, and if the number of nodes is less than the number of q...