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 880 : XFEMVolFracAux::validParams() 18 : { 19 880 : InputParameters params = AuxKernel::validParams(); 20 880 : params.addClassDescription( 21 : "Computes the volume fraction of the physical material in each partial element."); 22 880 : return params; 23 0 : } 24 : 25 440 : XFEMVolFracAux::XFEMVolFracAux(const InputParameters & parameters) : AuxKernel(parameters) 26 : { 27 440 : if (isNodal()) 28 0 : mooseError("XFEMVolFracAux must be run on an element variable"); 29 440 : FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem); 30 440 : if (fe_problem == nullptr) 31 0 : mooseError("Problem casting _subproblem to FEProblemBase in XFEMVolFracAux"); 32 880 : _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM()); 33 440 : if (_xfem == nullptr) 34 0 : mooseError("Problem casting to XFEM in XFEMVolFracAux"); 35 440 : } 36 : 37 : Real 38 1671820 : XFEMVolFracAux::computeValue() 39 : { 40 1671820 : return _xfem->getPhysicalVolumeFraction(_current_elem); 41 : }