www.mooseframework.org
XFEMMarkerAux.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 "XFEMMarkerAux.h"
11 
12 #include "XFEM.h"
13 
15 
18 {
20  params.addClassDescription("Identify the crack tip elements.");
21  return params;
22 }
23 
24 XFEMMarkerAux::XFEMMarkerAux(const InputParameters & parameters) : AuxKernel(parameters)
25 {
26  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
27  if (fe_problem == nullptr)
28  mooseError("Problem casting _subproblem to FEProblemBase in XFEMMarkerAux");
29  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
30  if (_xfem == nullptr)
31  mooseError("Problem casting to XFEM in XFEMMarkerAux");
32  if (isNodal())
33  mooseError("XFEMMarkerAux can only be run on an element variable");
34 }
35 
36 Real
38 {
39  bool isCTE = _xfem->isElemAtCrackTip(_current_elem);
40  Real value = 0.0;
41  if (isCTE)
42  {
43  value = 1.0;
44  }
45 
46  return value;
47 }
XFEMMarkerAux(const InputParameters &parameters)
Definition: XFEMMarkerAux.C:24
static InputParameters validParams()
Definition: XFEMMarkerAux.C:17
This is the XFEM class.
Definition: XFEM.h:107
std::shared_ptr< XFEM > _xfem
Definition: XFEMMarkerAux.h:29
virtual Real computeValue()
Definition: XFEMMarkerAux.C:37
registerMooseObject("XFEMApp", XFEMMarkerAux)
virtual const OutputTools< Real >::VariableValue & value()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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()