17#include "libmesh/dof_map.h"
18#include "libmesh/threads.h"
19#include "libmesh/system.h"
23#include LIBMESH_INCLUDE_UNORDERED_SET
24LIBMESH_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++)
40 mooseError(
"Variables passed in AllLocalDofIndicesThread must be all in the same 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?");
76 for (
const auto & elem : range)
78 std::vector<dof_id_type> dof_indices;
80 dof_id_type local_dof_begin = dof_map.first_dof();
81 dof_id_type local_dof_end = dof_map.end_dof();
87 for (
unsigned int j = 0; j < dof_indices.size(); j++)
89 dof_id_type dof = dof_indices[j];
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in.
AllLocalDofIndicesThread(SubProblem &problem, std::vector< std::string > vars, bool include_semilocal=false)
void operator()(const libMesh::ConstElemRange &range)
std::vector< unsigned int > _var_numbers
const bool _include_semilocal
Whether to include semilocal dof indices.
void dofIndicesSetUnion()
std::set< dof_id_type > _all_dof_indices
void join(const AllLocalDofIndicesThread &y)
Generic class for solving transient nonlinear problems.
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...
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.
void set_union(T &data, const unsigned int root_id) const
const Parallel::Communicator & _communicator
unsigned int variable_number(std::string_view var) const
const DofMap & get_dof_map() const