https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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");
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
44Real
46{
47 Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id);
48
49 return value;
50}
registerMooseObject("XFEMApp", XFEMCutPlaneAux)
void ErrorVector unsigned int
SubProblem & _subproblem
const Elem *const & _current_elem
static InputParameters validParams()
std::shared_ptr< XFEMInterface > getXFEM()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
std::string getRawNames() const
virtual const OutputTools< ComputeValueType >::VariableValue & value()
Coupled auxiliary value.
Xfem::XFEM_CUTPLANE_QUANTITY _quantity
XFEMCutPlaneAux(const InputParameters &parameters)
virtual Real computeValue()
unsigned int _plane_id
std::shared_ptr< XFEM > _xfem
static InputParameters validParams()
Definition XFEM.h:26