Line data Source code
1 : // libMesh includes 2 : #include "libmesh/numeric_vector.h" 3 : 4 : // Mastodon includes 5 : #include "LayerInterfaceIndicator.h" 6 : 7 : // libMesh includes 8 : #include "libmesh/quadrature.h" 9 : 10 : #include "MooseVariable.h" 11 : 12 : registerMooseObject("MastodonApp", LayerInterfaceIndicator); 13 : 14 : InputParameters 15 20 : LayerInterfaceIndicator::validParams() 16 : { 17 20 : InputParameters params = InternalSideIndicator::validParams(); 18 40 : params.addParam<Real>("tolerance", 19 40 : 1e-10, 20 : "Differences in the layer_id between elements above " 21 : "this tolerance will be marked for refinement."); 22 20 : params.addClassDescription("Computes the difference in the element layer ids " 23 : "between neighbors and sets the error to 1.0 if " 24 : "different."); 25 20 : return params; 26 0 : } 27 : 28 10 : LayerInterfaceIndicator::LayerInterfaceIndicator(const InputParameters & parameters) 29 20 : : InternalSideIndicator(parameters), _tolerance(getParam<Real>("tolerance")) 30 : { 31 10 : } 32 : 33 : void 34 95590 : LayerInterfaceIndicator::computeIndicator() 35 : { 36 95590 : if ((std::abs(_u[0] - _u_neighbor[0])) > _tolerance) 37 : { 38 : Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx); 39 12940 : _solution.set(_field_var.nodalDofIndex(), 1.0); 40 : } 41 95590 : }