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 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<AuxKernel>();
21  return params;
22 }
23 
24 XFEMVolFracAux::XFEMVolFracAux(const InputParameters & parameters) : AuxKernel(parameters)
25 {
26  if (isNodal())
27  mooseError("XFEMVolFracAux must be run on an element variable");
28  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
29  if (fe_problem == NULL)
30  mooseError("Problem casting _subproblem to FEProblemBase in XFEMVolFracAux");
31  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
32  if (_xfem == nullptr)
33  mooseError("Problem casting to XFEM in XFEMVolFracAux");
34 }
35 
36 Real
38 {
39  return _xfem->getPhysicalVolumeFraction(_current_elem);
40 }
XFEMVolFracAux
Coupled auxiliary value.
Definition: XFEMVolFracAux.h:19
validParams< XFEMVolFracAux >
InputParameters validParams< XFEMVolFracAux >()
Definition: XFEMVolFracAux.C:18
XFEM.h
XFEMVolFracAux::XFEMVolFracAux
XFEMVolFracAux(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Definition: XFEMVolFracAux.C:24
XFEMVolFracAux.h
registerMooseObject
registerMooseObject("XFEMApp", XFEMVolFracAux)
XFEMVolFracAux::computeValue
virtual Real computeValue()
Definition: XFEMVolFracAux.C:37
XFEMVolFracAux::_xfem
std::shared_ptr< XFEM > _xfem
Definition: XFEMVolFracAux.h:34