https://mooseframework.inl.gov
ContainsPointAux.C
Go to the documentation of this file.
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 
14 
17 {
19  params.addRequiredParam<Point>("point", "The point we're checking containment of");
20  params.addClassDescription("Computes a binary field where the field is 1 in the elements that "
21  "contain the point and 0 everywhere else");
22  return params;
23 }
24 
26  : AuxKernel(parameters), _point(getParam<Point>("point"))
27 {
28  if (isNodal())
29  paramError("variable", "This AuxKernel only supports Elemental fields");
30 }
31 
32 Real
34 {
35  return _current_elem->contains_point(_point);
36 }
virtual Real computeValue() override
Compute and return the value of the aux variable.
registerMooseObject("MooseApp", ContainsPointAux)
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:435
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
ContainsPointAux(const InputParameters &parameters)
Computes a binary field where the field is 1 in the elements that contain the point (we say elements ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
Definition: AuxKernel.h:204
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
static InputParameters validParams()
Definition: AuxKernel.C:27
static InputParameters validParams()
const Point & _point
The point we&#39;re checking that the elements contain.
bool isNodal() const
Nodal or elemental kernel?
Definition: AuxKernel.h:86