Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 "ContainsPointAux.h" 11 : #include "libmesh/elem.h" 12 : 13 : registerMooseObject("MooseApp", ContainsPointAux); 14 : 15 : InputParameters 16 14290 : ContainsPointAux::validParams() 17 : { 18 14290 : InputParameters params = AuxKernel::validParams(); 19 14290 : params.addRequiredParam<Point>("point", "The point we're checking containment of"); 20 14290 : params.addClassDescription("Computes a binary field where the field is 1 in the elements that " 21 : "contain the point and 0 everywhere else"); 22 14290 : return params; 23 0 : } 24 : 25 13 : ContainsPointAux::ContainsPointAux(const InputParameters & parameters) 26 13 : : AuxKernel(parameters), _point(getParam<Point>("point")) 27 : { 28 13 : if (isNodal()) 29 0 : paramError("variable", "This AuxKernel only supports Elemental fields"); 30 13 : } 31 : 32 : Real 33 648 : ContainsPointAux::computeValue() 34 : { 35 648 : return _current_elem->contains_point(_point); 36 : }