20#include "libmesh/threads.h"
26 std::vector<Number> & serialized_solution,
27 unsigned int max_h_level,
28 const std::string & marker_name,
29 bool is_serialized_solution)
31 _fe_problem(fe_problem),
32 _displaced_problem(_fe_problem.getDisplacedProblem()),
33 _aux_sys(fe_problem.getAuxiliarySystem()),
34 _system_number(_aux_sys.number()),
35 _adaptivity(_fe_problem.adaptivity()),
36 _field_var(_fe_problem.getVariable(
37 0, marker_name,
Moose::VarKindType::VAR_ANY,
Moose::VarFieldType::VAR_FIELD_ANY)),
38 _field_var_number(_field_var.number()),
39 _serialized_solution(serialized_solution),
40 _max_h_level(max_h_level),
41 _is_serialized_solution(is_serialized_solution)
48 _fe_problem(x._fe_problem),
49 _displaced_problem(x._displaced_problem),
51 _system_number(x._system_number),
52 _adaptivity(x._adaptivity),
53 _field_var(x._field_var),
54 _field_var_number(x._field_var_number),
55 _serialized_solution(x._serialized_solution),
56 _max_h_level(x._max_h_level),
57 _is_serialized_solution(x._is_serialized_solution)
64 mooseAssert(elem->active(),
"This thread should only act on active elements");
74 Number dof_value = 0.;
85 dof_value = current_local_solution(dof_number);
92 if (std::abs(
static_cast<int>(marker_value) - dof_value) > TOLERANCE * TOLERANCE)
93 mooseError(
"Invalid Marker value detected: ", dof_value);
104 const_cast<Elem *
>(elem)->set_refinement_flag((Elem::RefinementState)marker_value);
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const NumericVector< Number > *const & currentSolution() const override
The solution vector that is currently being operated on.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseVariableFEBase & _field_var
bool _is_serialized_solution
unsigned int _system_number
void join(const FlagElementsThread &)
std::vector< Number > & _serialized_solution
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
AuxiliarySystem & _aux_sys
FlagElementsThread(FEProblemBase &fe_problem, std::vector< Number > &serialized_solution, unsigned int max_h_level, const std::string &marker_name, bool is_serialized_solution)
unsigned int _max_h_level
unsigned int _field_var_number
MarkerValue
This mirrors the main refinement flag values in libMesh in Elem::RefinementState but adds "dont_mark"...
bool activeOnSubdomain(SubdomainID subdomain) const
Is the variable active on the subdomain?
Base class for assembly-like calculations.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...