www.mooseframework.org
XFEMCutPlaneAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "XFEMCutPlaneAux.h"
9 
10 #include "XFEM.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<AuxKernel>();
17  MooseEnum quantity("origin_x origin_y origin_z normal_x normal_y normal_z");
18  params.addRequiredParam<MooseEnum>(
19  "quantity", quantity, "The quantity to be extracted. Choices: " + quantity.getRawNames());
20  params.addParam<unsigned int>("plane_id", 0, "The index of the cut plane");
21  return params;
22 }
23 
24 XFEMCutPlaneAux::XFEMCutPlaneAux(const InputParameters & parameters)
25  : AuxKernel(parameters),
26  _quantity(Xfem::XFEM_CUTPLANE_QUANTITY(int(getParam<MooseEnum>("quantity")))),
27  _plane_id(getParam<unsigned int>("plane_id"))
28 {
29  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
30  if (fe_problem == NULL)
31  mooseError("Problem casting _subproblem to FEProblemBase in XFEMCutPlaneAux");
32  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
33  if (_xfem == NULL)
34  mooseError("Problem casting to XFEM in XFEMCutPlaneAux");
35  if (isNodal())
36  mooseError("XFEMCutPlaneAux can only be run on an element variable");
37 }
38 
39 Real
41 {
42  Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id);
43 
44  return value;
45 }
MooseSharedPointer< XFEM > _xfem
virtual Real computeValue()
This is the XFEM class.
Definition: XFEM.h:60
Definition: XFEM.h:24
XFEM_CUTPLANE_QUANTITY
Definition: XFEM.h:26
InputParameters validParams< XFEMCutPlaneAux >()
Xfem::XFEM_CUTPLANE_QUANTITY _quantity
unsigned int _plane_id
XFEMCutPlaneAux(const InputParameters &parameters)