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 14292 : ContainsPointAux::validParams() 17 : { 18 14292 : InputParameters params = AuxKernel::validParams(); 19 14292 : params.addRequiredParam<Point>("point", "The point we're checking containment of"); 20 14292 : params.addClassDescription("Computes a binary field where the field is 1 in the elements that " 21 : "contain the point and 0 everywhere else"); 22 14292 : return params; 23 0 : } 24 : 25 14 : ContainsPointAux::ContainsPointAux(const InputParameters & parameters) 26 14 : : AuxKernel(parameters), _point(getParam<Point>("point")) 27 : { 28 14 : if (isNodal()) 29 0 : paramError("variable", "This AuxKernel only supports Elemental fields"); 30 14 : } 31 : 32 : Real 33 729 : ContainsPointAux::computeValue() 34 : { 35 729 : return _current_elem->contains_point(_point); 36 : }