https://mooseframework.inl.gov
XFEMCutPlaneAux.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 "XFEMCutPlaneAux.h"
11 
12 #include "XFEM.h"
13 
15 
18 {
20  MooseEnum quantity("origin_x origin_y origin_z normal_x normal_y normal_z");
22  "quantity", quantity, "The quantity to be extracted. Choices: " + quantity.getRawNames());
23  params.addParam<unsigned int>("plane_id", 0, "The index of the cut plane");
24  params.addClassDescription(
25  "Computes the normal and origin of a cutting plane for each partial element.");
26  return params;
27 }
28 
30  : AuxKernel(parameters),
31  _quantity(Xfem::XFEM_CUTPLANE_QUANTITY(int(getParam<MooseEnum>("quantity")))),
32  _plane_id(getParam<unsigned int>("plane_id"))
33 {
34  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
35  if (fe_problem == nullptr)
36  mooseError("Problem casting _subproblem to FEProblemBase in XFEMCutPlaneAux");
37  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
38  if (_xfem == nullptr)
39  mooseError("Problem casting to XFEM in XFEMCutPlaneAux");
40  if (isNodal())
41  mooseError("XFEMCutPlaneAux can only be run on an element variable");
42 }
43 
44 Real
46 {
47  Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id);
48 
49  return value;
50 }
std::shared_ptr< XFEM > _xfem
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual Real computeValue()
static InputParameters validParams()
std::string getRawNames() const
This is the XFEM class.
Definition: XFEM.h:107
void addRequiredParam(const std::string &name, const std::string &doc_string)
Coupled auxiliary value.
registerMooseObject("XFEMApp", XFEMCutPlaneAux)
Definition: XFEM.h:25
virtual const OutputTools< Real >::VariableValue & value()
XFEM_CUTPLANE_QUANTITY
Definition: XFEM.h:27
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Xfem::XFEM_CUTPLANE_QUANTITY _quantity
std::shared_ptr< XFEMInterface > getXFEM()
SubProblem & _subproblem
void mooseError(Args &&... args) const
const Elem *const & _current_elem
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
unsigned int _plane_id
XFEMCutPlaneAux(const InputParameters &parameters)
void ErrorVector unsigned int