24 #include "libmesh/threads.h" 28 _fe_problem(fe_problem),
29 _aux_sys(fe_problem.getAuxiliarySystem()),
30 _indicator_whs(_fe_problem.getIndicatorWarehouse()),
31 _internal_side_indicators(_fe_problem.getInternalSideIndicatorWarehouse()),
39 _fe_problem(x._fe_problem),
41 _indicator_whs(x._indicator_whs),
42 _internal_side_indicators(x._internal_side_indicators),
43 _finalize(x._finalize)
57 std::set<MooseVariableFEBase *> needed_moose_vars;
63 std::set<TagID> needed_var_vector_tags;
72 std::unordered_set<unsigned int> needed_mat_props;
99 const std::vector<std::shared_ptr<Indicator>> & indicators =
101 for (
const auto & indicator : indicators)
102 indicator->computeIndicator();
111 const std::vector<std::shared_ptr<Indicator>> & indicators =
113 for (
const auto & indicator : indicators)
114 indicator->finalize();
119 const std::vector<std::shared_ptr<InternalSideIndicator>> & internal_indicators =
121 for (
const auto & internal_indicator : internal_indicators)
122 internal_indicator->finalize();
128 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
149 const Elem * neighbor = elem->neighbor_ptr(side);
168 const std::vector<std::shared_ptr<InternalSideIndicator>> & indicators =
170 for (
const auto & indicator : indicators)
171 indicator->computeIndicator();
201 console <<
"[DBG] Executing indicators on elements then on internal sides on " << execute_on
204 console <<
"[DBG] Finalizing indicator loop" << std::endl;
217 console <<
"[DBG] Ordering of element indicators on block " <<
_subdomain << std::endl;
218 printExecutionOrdering<Indicator>(indicators,
false);
223 console <<
"[DBG] Ordering of element internal sides indicators on block " <<
_subdomain 225 printExecutionOrdering<InternalSideIndicator>(indicators,
false);
void updateVariableDependency(std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
virtual void onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id, const Elem *lower_d_elem=nullptr) override
Called when doing boundary assembling.
const MooseObjectWarehouse< InternalSideIndicator > & _internal_side_indicators
InternalSideIndicator Storage.
Base class for assembly-like calculations.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
NumericVector< Number > & solution()
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
const MaterialWarehouse & getMaterialWarehouse() const
AuxiliarySystem & _aux_sys
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void reinitMaterialsFace(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on element faces
virtual void swapBackMaterialsFace(const THREAD_ID tid)
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
void printGeneralExecutionInformation() const override
Print general information about the loop when it executes.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
virtual void postElement(const Elem *) override
Called after the element assembly is done (including surface assembling)
virtual ~ComputeIndicatorThread()
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
void reinitMaterialsNeighbor(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on the neighboring element face
ComputeIndicatorThread(FEProblemBase &fe_problem, bool finalize=false)
boundary_id_type BoundaryID
void updateMatPropDependency(std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
Update material property dependency vector.
virtual void swapBackMaterialsNeighbor(const THREAD_ID tid)
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
std::set< SubdomainID > _blocks_exec_printed
Keep track of which blocks were visited.
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.
const ConsoleStream & console() const
Return console handle.
virtual void swapBackMaterials(const THREAD_ID tid)
void updateBlockFEVariableCoupledVectorTagDependency(SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
Update FE variable coupleable vector tag vector.
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
const MooseObjectWarehouse< Indicator > & _indicator_whs
Indicator Storage.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
void printBlockExecutionInformation() const override
Print list of specific objects executed and in which order.
void join(const ComputeIndicatorThread &)
SubdomainID _subdomain
The subdomain for the current element.
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual void onInternalSide(const Elem *elem, unsigned int side) override
Called when doing internal edge assembling.
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
virtual void post() override
Called after the element range loop.
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)
Add the MooseVariables and the material properties that the current materials depend on to the depend...
virtual void subdomainSetup(THREAD_ID tid=0) const
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
FEProblemBase & _fe_problem
The "SwapBackSentinel" class's destructor guarantees that FEProblemBase::swapBackMaterials{Face,Neighbor}() is called even when an exception is thrown from FEProblemBase::reinitMaterials{Face,Neighbor}.