www.mooseframework.org
PorousFlowNearestQp.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "PorousFlowNearestQp.h"
11 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<PorousFlowMaterial>();
19  params.set<bool>("nodal_material") = true;
20  params.addPrivateParam<std::string>("pf_material_type", "nearest_qp");
21  params.addClassDescription("Provides the nearest quadpoint to a node in each element");
22  return params;
23 }
24 
25 PorousFlowNearestQp::PorousFlowNearestQp(const InputParameters & parameters)
26  : PorousFlowMaterial(parameters),
27  _nearest_qp(declareProperty<unsigned>("PorousFlow_nearestqp_nodal"))
28 {
29  if (getParam<bool>("nodal_material") == false)
30  paramError("nodal_material", "This must be a nodal material!");
31 }
32 
33 void
35 {
36  _nearest_qp[_qp] = nearestQP(_qp);
37 }
PorousFlowMaterial is the base class for all PorousFlow Materials It allows users to specify that the...
registerMooseObject("PorousFlowApp", PorousFlowNearestQp)
virtual void computeQpProperties() override
InputParameters validParams< PorousFlowMaterial >()
MaterialProperty< unsigned int > & _nearest_qp
The nearest quadpoint.
unsigned nearestQP(unsigned nodenum) const
Find the nearest quadpoint to the node labelled by nodenum in the current element.
InputParameters validParams< PorousFlowNearestQp >()
Material designed to provide the nearest quadpoint to each node in the element.
PorousFlowNearestQp(const InputParameters &parameters)