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 "XFEMCutPlaneAux.h" 11 : 12 : #include "XFEM.h" 13 : 14 : registerMooseObject("XFEMApp", XFEMCutPlaneAux); 15 : 16 : InputParameters 17 5460 : XFEMCutPlaneAux::validParams() 18 : { 19 5460 : InputParameters params = AuxKernel::validParams(); 20 10920 : MooseEnum quantity("origin_x origin_y origin_z normal_x normal_y normal_z"); 21 10920 : params.addRequiredParam<MooseEnum>( 22 5460 : "quantity", quantity, "The quantity to be extracted. Choices: " + quantity.getRawNames()); 23 10920 : params.addParam<unsigned int>("plane_id", 0, "The index of the cut plane"); 24 5460 : params.addClassDescription( 25 : "Computes the normal and origin of a cutting plane for each partial element."); 26 5460 : return params; 27 5460 : } 28 : 29 5040 : XFEMCutPlaneAux::XFEMCutPlaneAux(const InputParameters & parameters) 30 : : AuxKernel(parameters), 31 5040 : _quantity(Xfem::XFEM_CUTPLANE_QUANTITY(int(getParam<MooseEnum>("quantity")))), 32 15120 : _plane_id(getParam<unsigned int>("plane_id")) 33 : { 34 5040 : FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem); 35 5040 : if (fe_problem == nullptr) 36 0 : mooseError("Problem casting _subproblem to FEProblemBase in XFEMCutPlaneAux"); 37 10080 : _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM()); 38 5040 : if (_xfem == nullptr) 39 0 : mooseError("Problem casting to XFEM in XFEMCutPlaneAux"); 40 5040 : if (isNodal()) 41 0 : mooseError("XFEMCutPlaneAux can only be run on an element variable"); 42 5040 : } 43 : 44 : Real 45 7556664 : XFEMCutPlaneAux::computeValue() 46 : { 47 7556664 : Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id); 48 : 49 7556664 : return value; 50 : }