www.mooseframework.org
XFEMVolFracAux.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 "XFEMVolFracAux.h"
11 
12 #include "XFEM.h"
13 
15 
18 {
20  params.addClassDescription(
21  "Computes the volume fraction of the physical material in each partial element.");
22  return params;
23 }
24 
25 XFEMVolFracAux::XFEMVolFracAux(const InputParameters & parameters) : AuxKernel(parameters)
26 {
27  if (isNodal())
28  mooseError("XFEMVolFracAux must be run on an element variable");
29  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
30  if (fe_problem == nullptr)
31  mooseError("Problem casting _subproblem to FEProblemBase in XFEMVolFracAux");
32  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
33  if (_xfem == nullptr)
34  mooseError("Problem casting to XFEM in XFEMVolFracAux");
35 }
36 
37 Real
39 {
40  return _xfem->getPhysicalVolumeFraction(_current_elem);
41 }
XFEMVolFracAux(const InputParameters &parameters)
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
This is the XFEM class.
Definition: XFEM.h:107
registerMooseObject("XFEMApp", XFEMVolFracAux)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Coupled auxiliary value.
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()
std::shared_ptr< XFEM > _xfem
virtual Real computeValue()