21#include "libmesh/sparse_matrix.h"
27 const std::set<TagID> & tags)
28 :
ThreadedNodeLoop<ConstNodeRange, ConstNodeRange::const_iterator>(fe_problem),
29 _fe_problem(fe_problem),
31 _aux_sys(fe_problem.getAuxiliarySystem()),
33 _nodal_kernels(nodal_kernels),
41 :
ThreadedNodeLoop<ConstNodeRange, ConstNodeRange::const_iterator>(x, split),
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)
125 nodal_kernel->setSubdomains(block_ids);
126 nodal_kernel->computeOffDiagJacobian(jvar);
153 console <<
"[DBG] Executing nodal kernels contribution to Jacobian on nodes on " << execute_on
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
MooseObjectTagWarehouse< NodalKernelBase > & _nodal_kernels
AuxiliarySystem & _aux_sys
NonlinearSystemBase & _nl
virtual void pre() override
Called before the node range loop.
void printGeneralExecutionInformation() const override
Print information about the loop, mostly order of execution of objects.
ComputeNodalKernelJacobiansThread(FEProblemBase &fe_problem, NonlinearSystemBase &nl, MooseObjectTagWarehouse< NodalKernelBase > &nodal_kernels, const std::set< TagID > &tags)
FEProblemBase & _fe_problem
unsigned int _num_cached
Number of contributions cached up.
void join(const ComputeNodalKernelJacobiansThread &)
const std::set< TagID > & _tags
MooseObjectWarehouse< NodalKernelBase > * _nkernel_warehouse
virtual void onNode(ConstNodeRange::const_iterator &node_it) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void addCachedJacobian(const THREAD_ID tid) override
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
A storage container for MooseObjects that inherit from SetupInterface.
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.
MooseObjectWarehouse< T > & getMatrixTagObjectWarehouse(TagID tag_id, THREAD_ID tid)
Retrieve a moose object warehouse in which every moose object has the given matrix tag.
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.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
unsigned int number() const
Get variable number coming from libMesh.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Nonlinear system to be solved.
const ConsoleStream & console() const
Return console handle.
virtual unsigned int numMatrixTags() const
The total number of tags.
unsigned int number() const
Gets the number of this system.