www.mooseframework.org
XFEMVolFracAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "XFEMVolFracAux.h"
9 
10 #include "XFEM.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<AuxKernel>();
17  return params;
18 }
19 
20 XFEMVolFracAux::XFEMVolFracAux(const InputParameters & parameters) : AuxKernel(parameters)
21 {
22  if (isNodal())
23  mooseError("XFEMVolFracAux must be run on an element variable");
24  FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
25  if (fe_problem == NULL)
26  mooseError("Problem casting _subproblem to FEProblemBase in XFEMVolFracAux");
27  _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
28  if (_xfem == NULL)
29  mooseError("Problem casting to XFEM in XFEMVolFracAux");
30 }
31 
32 Real
34 {
35  return _xfem->getPhysicalVolumeFraction(_current_elem);
36 }
XFEMVolFracAux(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
This is the XFEM class.
Definition: XFEM.h:60
MooseSharedPointer< XFEM > _xfem
InputParameters validParams< XFEMVolFracAux >()
virtual Real computeValue()