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 : #pragma once 11 : 12 : // MOOSE includes 13 : #include "ElementUserObject.h" 14 : #include "BoundaryRestrictable.h" 15 : 16 : #include "libmesh/fe_type.h" 17 : 18 : #include <mutex> 19 : 20 : class AuxiliarySystem; 21 : 22 : /** 23 : * An ElementUserObject that prepares MOOSE for computing nodal 24 : * normals. 25 : */ 26 : class NodalNormalsPreprocessor : public ElementUserObject 27 : { 28 : public: 29 : static InputParameters validParams(); 30 : 31 : NodalNormalsPreprocessor(const InputParameters & parameters); 32 : 33 : virtual void initialize() override; 34 : virtual void finalize() override; 35 : virtual void execute() override; 36 482 : virtual void threadJoin(const UserObject & /*uo*/) override {} 37 : 38 : /** 39 : * Forces object to be stored as a block object. 40 : * 41 : * This object inherits from BoundaryRestrictable to utilize the "boundary" parameter and other 42 : * methods that come with this interface class. However, this object is an ElementUserObject and 43 : * must execute on each element (see ComputeUserObjectsThread::onElement). 44 : * 45 : * The MooseObjectWarehouseBase object that stores the objects uses this method to determine 46 : * whether the object should be stored as boundary or block. Since this object needs to execute on 47 : * elements, it must be stored as a block object, overloading this method to always return false 48 : * has such effect. 49 : */ 50 : 51 : protected: 52 : AuxiliarySystem & _aux; 53 : libMesh::FEType _fe_type; 54 : bool _has_corners; 55 : std::vector<BoundaryID> _boundaries; 56 : BoundaryID _corner_boundary_id; 57 : 58 : const VariablePhiGradient & _grad_phi; 59 : 60 : private: 61 : static std::mutex _nodal_normals_mutex; 62 : 63 : // For access to mutex 64 : friend class NodalNormalsCorner; 65 : friend class NodalNormalsEvaluator; 66 : };