17 #include "libmesh/dof_map.h" 18 #include "libmesh/threads.h" 19 #include "libmesh/system.h" 23 #include LIBMESH_INCLUDE_UNORDERED_SET 24 LIBMESH_DEFINE_HASH_POINTERS
27 std::vector<std::string> vars,
28 bool include_semilocal)
29 : ParallelObject(problem.comm()),
32 _include_semilocal(include_semilocal)
34 for (
unsigned int i = 0; i < vars.size(); i++)
39 if (
_sys != &var.sys().system())
40 mooseError(
"Variables passed in AllLocalDofIndicesThread must be all in the same system.");
43 _sys = &var.sys().system();
48 for (
unsigned int p = 0; p < var.count(); ++p)
59 : ParallelObject(x._problem.comm()),
62 _var_numbers(x._var_numbers),
63 _include_semilocal(x._include_semilocal)
73 mooseAssert(
_sys,
"We should have a system, did you forget to specify any variable in vars?");
74 auto & dof_map =
_sys->get_dof_map();
76 for (
const auto & elem : range)
78 std::vector<dof_id_type> dof_indices;
87 for (
unsigned int j = 0; j < dof_indices.size(); j++)
void operator()(const ConstElemRange &range)
std::vector< unsigned int > _var_numbers
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
void dofIndicesSetUnion()
void join(const AllLocalDofIndicesThread &y)
StoredRange< MeshBase::const_element_iterator, const Elem *> ConstElemRange
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in...
std::set< dof_id_type > _all_dof_indices
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested ArrayMooseVariable which may be in any system...
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
Generic class for solving transient nonlinear problems.
const bool _include_semilocal
Whether to include semilocal dof indices.
AllLocalDofIndicesThread(SubProblem &problem, std::vector< std::string > vars, bool include_semilocal=false)