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 : #include "Moose.h" 13 : #include "MooseTypes.h" 14 : 15 : #include "libmesh/elem_range.h" 16 : #include "libmesh/parallel_object.h" 17 : 18 : // Forward declare classes in libMesh 19 : namespace libMesh 20 : { 21 : class System; 22 : class DofMap; 23 : } 24 : class SubProblem; 25 : 26 : /** 27 : * Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed 28 : * in. 29 : */ 30 : class AllLocalDofIndicesThread : public libMesh::ParallelObject 31 : { 32 : public: 33 : AllLocalDofIndicesThread(SubProblem & problem, 34 : std::vector<std::string> vars, 35 : bool include_semilocal = false); 36 : // Splitting Constructor 37 : AllLocalDofIndicesThread(AllLocalDofIndicesThread & x, libMesh::Threads::split split); 38 : 39 : void operator()(const libMesh::ConstElemRange & range); 40 : 41 : void join(const AllLocalDofIndicesThread & y); 42 : 43 29169 : const std::set<dof_id_type> & getDofIndices() const { return _all_dof_indices; } 44 : 45 : void dofIndicesSetUnion(); 46 : 47 : protected: 48 : SubProblem & _problem; 49 : libMesh::System * _sys; 50 : std::vector<unsigned int> _var_numbers; 51 : 52 : /// Whether to include semilocal dof indices 53 : const bool _include_semilocal; 54 : 55 : THREAD_ID _tid; 56 : 57 : std::set<dof_id_type> _all_dof_indices; 58 : };