https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
32Real
34{
35 return _current_elem->contains_point(_point);
36}
registerMooseObject("MooseApp", ContainsPointAux)
bool isNodal() const
Nodal or elemental kernel?
Definition AuxKernel.h:43
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
Definition AuxKernel.h:133
static InputParameters validParams()
Definition AuxKernel.C:27
Computes a binary field where the field is 1 in the elements that contain the point (we say elements ...
ContainsPointAux(const InputParameters &parameters)
const Point & _point
The point we're checking that the elements contain.
static InputParameters validParams()
virtual Real computeValue() override
Compute and return the value of the aux variable.
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...
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.
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:457