21 #include "libmesh/sparse_matrix.h" 27 const std::set<TagID> & tags)
29 _fe_problem(fe_problem),
31 _aux_sys(fe_problem.getAuxiliarySystem()),
33 _nodal_kernels(nodal_kernels),
42 _fe_problem(x._fe_problem),
46 _nodal_kernels(x._nodal_kernels),
58 else if (
_tags.size() == 1)
67 const Node * node = *node_it;
70 for (
const auto & it : ce)
75 unsigned int ivar = ivariable.
number();
76 unsigned int jvar = jvariable.
number();
79 std::vector<std::shared_ptr<NodalKernelBase>> active_involved_kernels;
82 for (
const auto & block : block_ids)
88 for (
const auto & nodal_kernel : objects)
90 if (nodal_kernel->variable().number() == ivar)
94 if (nodal_kernel->variable().number() == jvar)
96 active_involved_kernels.push_back(nodal_kernel);
101 const std::vector<MooseVariableFEBase *> & coupled_vars =
102 nodal_kernel->getCoupledMooseVars();
103 for (
const auto & var : coupled_vars)
104 if (var->number() == jvar)
106 active_involved_kernels.push_back(nodal_kernel);
115 if (!active_involved_kernels.empty())
123 for (
const auto & nodal_kernel : active_involved_kernels)
124 nodal_kernel->computeOffDiagJacobian(jvar);
132 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
152 console <<
"[DBG] Executing nodal kernels contribution to Jacobian on nodes on " << execute_on
std::string activeObjectsToFormattedString(THREAD_ID tid=0, const std::string &prefix="[DBG]") const
Output the active content of the warehouse to a string, meant to be output to the console...
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void join(const ComputeNodalKernelJacobiansThread &)
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual void onNode(ConstNodeRange::const_iterator &node_it) override
Called for each node.
unsigned int number() const
Get variable number coming from libMesh.
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
ComputeNodalKernelJacobiansThread(FEProblemBase &fe_problem, NonlinearSystemBase &nl, MooseObjectTagWarehouse< NodalKernelBase > &nodal_kernels, const std::set< TagID > &tags)
NonlinearSystemBase & _nl
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseObjectWarehouse< NodalKernelBase > * _nkernel_warehouse
Nonlinear system to be solved.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
FEProblemBase & _fe_problem
MooseObjectWarehouse< T > & getMatrixTagObjectWarehouse(TagID tag_id, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object has the given matrix tag...
StoredRange< MeshBase::const_node_iterator, const Node *> ConstNodeRange
unsigned int number() const
Gets the number of this system.
void printGeneralExecutionInformation() const override
Print information about the loop, mostly order of execution of objects.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
virtual unsigned int numMatrixTags() const
The total number of tags.
const ConsoleStream & console() const
Return console handle.
bool hasActiveObjects(THREAD_ID tid=0) const
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...
AuxiliarySystem & _aux_sys
const std::set< TagID > & _tags
MooseObjectTagWarehouse< NodalKernelBase > & _nodal_kernels
virtual void pre() override
Called before the node range loop.
unsigned int _num_cached
Number of contributions cached up.
virtual void addCachedJacobian(const THREAD_ID tid) override