forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
// MOOSE includes | ||
#include "AuxKernel.h" | ||
|
||
class ContainsPointAux : public AuxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
ContainsPointAux(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeValue() override; | ||
|
||
const Point _point; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
// MOOSE includes | ||
#include "ContainsPointAux.h" | ||
#include "MooseMesh.h" | ||
|
||
registerMooseObject("MooseApp", ContainsPointAux); | ||
|
||
InputParameters | ||
ContainsPointAux::validParams() | ||
{ | ||
InputParameters params = AuxKernel::validParams(); | ||
params.addRequiredParam<Point>("point", "The point we're checking containment of"); | ||
return params; | ||
} | ||
|
||
ContainsPointAux::ContainsPointAux(const InputParameters & parameters) | ||
: AuxKernel(parameters), _point(getParam<Point>("point")) | ||
{ | ||
if (isNodal()) | ||
paramError("variable", "This AuxKernel only supports Elemental fields"); | ||
} | ||
|
||
Real | ||
ContainsPointAux::computeValue() | ||
{ | ||
return _current_elem->contains_point(_point); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters