www.mooseframework.org
PorousFlowNearestQp.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "PorousFlowNearestQp.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowMaterial>();
15  params.set<bool>("nodal_material") = true;
16  params.addClassDescription("Provides the nearest quadpoint to a node in each element");
17  return params;
18 }
19 
20 PorousFlowNearestQp::PorousFlowNearestQp(const InputParameters & parameters)
21  : PorousFlowMaterial(parameters),
22  _nearest_qp(declareProperty<unsigned>("PorousFlow_nearestqp_nodal"))
23 {
24  if (getParam<bool>("nodal_material") == false)
25  mooseError("PorousFlowNearestQp must be a nodal material");
26 }
27 
28 void
30 {
31  _nearest_qp[_qp] = nearestQP(_qp);
32 }
virtual void computeQpProperties() override
InputParameters validParams< PorousFlowMaterial >()
unsigned nearestQP(unsigned nodenum) const
Find the nearest quadpoint to the node labelled by nodenum in the current element.
MaterialProperty< unsigned int > & _nearest_qp
the nearest quadpoint
InputParameters validParams< PorousFlowNearestQp >()
PorousFlowNearestQp(const InputParameters &parameters)