Line data Source code
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 "XFEMVolFracAux.h" 11 : 12 : #include "XFEM.h" 13 : 14 : registerMooseObject("XFEMApp", XFEMVolFracAux); 15 : 16 : InputParameters 17 840 : XFEMVolFracAux::validParams() 18 : { 19 840 : InputParameters params = AuxKernel::validParams(); 20 840 : params.addClassDescription( 21 : "Computes the volume fraction of the physical material in each partial element."); 22 840 : return params; 23 0 : } 24 : 25 420 : XFEMVolFracAux::XFEMVolFracAux(const InputParameters & parameters) : AuxKernel(parameters) 26 : { 27 420 : if (isNodal()) 28 0 : mooseError("XFEMVolFracAux must be run on an element variable"); 29 420 : FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem); 30 420 : if (fe_problem == nullptr) 31 0 : mooseError("Problem casting _subproblem to FEProblemBase in XFEMVolFracAux"); 32 840 : _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM()); 33 420 : if (_xfem == nullptr) 34 0 : mooseError("Problem casting to XFEM in XFEMVolFracAux"); 35 420 : } 36 : 37 : Real 38 964652 : XFEMVolFracAux::computeValue() 39 : { 40 964652 : return _xfem->getPhysicalVolumeFraction(_current_elem); 41 : }