21 #include "libmesh/threads.h" 24 const std::set<TagID> & tags,
27 _is_jacobian(is_jacobian),
28 _nl(feproblem.currentNonlinearSystem()),
30 _dirac_kernels(_nl.getDiracKernelWarehouse())
37 _is_jacobian(x._is_jacobian),
40 _dirac_kernels(x._dirac_kernels)
59 std::set<MooseVariableFEBase *> needed_moose_vars;
63 std::unordered_set<unsigned int> needed_mat_props;
74 else if (
_tags.size() == 1)
88 if (!has_dirac_kernels_on_elem)
91 std::set<MooseVariableFEBase *> needed_moose_vars;
97 for (
const auto & dirac_kernel : dkernels)
101 if (dirac_kernel->getMaterialPropertyCalled())
108 for (
const auto & dirac_kernel : dkernels)
110 if (!dirac_kernel->hasPointsOnElem(elem))
114 dirac_kernel->computeResidual();
119 const auto & coupling_entries =
120 dirac_kernel->subProblem().assembly(
_tid,
_nl.
number()).couplingEntries();
123 for (
const auto & it : coupling_entries)
133 if (dirac_kernel->variable().number() == ivariable->
number() &&
137 dirac_kernel->prepareShapes(jvariable->
number());
138 dirac_kernel->computeOffDiagJacobian(jvariable->
number());
151 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
189 console <<
"[DBG] Ordering of DiracKernels on subdomain " <<
_subdomain << std::endl;
190 printExecutionOrdering<DiracKernelBase>(dkernels,
false);
void updateVariableDependency(std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
void setActiveMaterialProperties(const std::unordered_set< unsigned int > &mat_prop_ids, const THREAD_ID tid)
Record and set the material properties required by the current computing thread.
Base class for assembly-like calculations.
virtual unsigned int numberOfDofs() const
Get the number of local DoFs.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::string & name() const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
void join(const ComputeDiracThread &)
unsigned int number() const
Get variable number coming from libMesh.
virtual void pre() override
Called before the element range loop.
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
FEProblemBase & _fe_problem
virtual void addJacobian(const THREAD_ID tid) override
MooseObjectWarehouse< T > & getVectorTagsObjectWarehouse(const std::set< TagID > &tags, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object at least has one of the given vector ta...
virtual void postElement(const Elem *) override
Called after the element assembly is done (including surface assembling)
This class provides an interface for common operations on field variables of both FE and FV types wit...
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
ComputeDiracThread(FEProblemBase &feproblem, const std::set< TagID > &tags, bool _is_jacobian)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
void printBlockExecutionInformation() const override
Output the order of execution of objects within the current subdomain.
MooseObjectTagWarehouse< DiracKernelBase > & _dirac_kernels
Storage for DiracKernel objects.
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
const std::set< TagID > & _tags
MooseObjectWarehouse< T > & getMatrixTagObjectWarehouse(TagID tag_id, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object has the given matrix tag...
virtual void addResidual(const THREAD_ID tid) override
unsigned int number() const
Gets the number of this system.
NonlinearSystemBase & _nl
void updateMatPropDependency(std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
Update material property dependency vector.
void printGeneralExecutionInformation() const override
Output a message indicating execution on this execution flag.
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
virtual unsigned int numMatrixTags() const
The total number of tags.
std::set< SubdomainID > _blocks_exec_printed
Keep track of which blocks were visited.
const ConsoleStream & console() const
Return console handle.
MooseObjectWarehouse< DiracKernelBase > * _dirac_warehouse
StoredRange< std::set< const Elem * >::const_iterator, const Elem * > DistElemRange
virtual ~ComputeDiracThread()
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
MooseObjectWarehouse< T > & getMatrixTagsObjectWarehouse(const std::set< TagID > &tags, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object has one of the given matrix tags...
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
MooseObjectWarehouse< T > & getVectorTagObjectWarehouse(TagID tag_id, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object has the given vector tag...
bool activeOnSubdomain(SubdomainID subdomain) const
Is the variable active on the subdomain?
virtual void post() override
Called after the element range loop.
SubdomainID _subdomain
The subdomain for the current element.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.