www.mooseframework.org
XFEMCutPlaneAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<AuxKernel>();
21  MooseEnum quantity("origin_x origin_y origin_z normal_x normal_y normal_z");
22  params.addRequiredParam<MooseEnum>(
23  "quantity", quantity, "The quantity to be extracted. Choices: " + quantity.getRawNames());
24  params.addParam<unsigned int>("plane_id", 0, "The index of the cut plane");
25  return params;
26 }
27 
28 XFEMCutPlaneAux::XFEMCutPlaneAux(const InputParameters & parameters)
29  : AuxKernel(parameters),
30  _quantity(Xfem::XFEM_CUTPLANE_QUANTITY(int(getParam<MooseEnum>("quantity")))),
31  _plane_id(getParam<unsigned int>("plane_id"))
32 {
33  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
34  if (fe_problem == NULL)
35  mooseError("Problem casting _subproblem to FEProblemBase in XFEMCutPlaneAux");
36  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
37  if (_xfem == nullptr)
38  mooseError("Problem casting to XFEM in XFEMCutPlaneAux");
39  if (isNodal())
40  mooseError("XFEMCutPlaneAux can only be run on an element variable");
41 }
42 
43 Real
45 {
46  Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id);
47 
48  return value;
49 }
XFEMCutPlaneAux
Coupled auxiliary value.
Definition: XFEMCutPlaneAux.h:18
registerMooseObject
registerMooseObject("XFEMApp", XFEMCutPlaneAux)
XFEM.h
XFEMCutPlaneAux.h
XFEMCutPlaneAux::_xfem
std::shared_ptr< XFEM > _xfem
Definition: XFEMCutPlaneAux.h:30
XFEMCutPlaneAux::_quantity
Xfem::XFEM_CUTPLANE_QUANTITY _quantity
Definition: XFEMCutPlaneAux.h:29
validParams< XFEMCutPlaneAux >
InputParameters validParams< XFEMCutPlaneAux >()
Definition: XFEMCutPlaneAux.C:18
Xfem
Definition: XFEM.h:25
Xfem::XFEM_CUTPLANE_QUANTITY
XFEM_CUTPLANE_QUANTITY
Definition: XFEM.h:27
XFEMCutPlaneAux::XFEMCutPlaneAux
XFEMCutPlaneAux(const InputParameters &parameters)
Definition: XFEMCutPlaneAux.C:28
XFEMCutPlaneAux::computeValue
virtual Real computeValue()
Definition: XFEMCutPlaneAux.C:44
XFEMCutPlaneAux::_plane_id
unsigned int _plane_id
Definition: XFEMCutPlaneAux.h:31