www.mooseframework.org
ComputeJacobianBlocksThread.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 // MOOSE includes
13 #include "DGKernel.h"
14 #include "FEProblem.h"
15 #include "KernelBase.h"
16 #include "IntegratedBC.h"
17 
18 #include "libmesh/threads.h"
19 #include "libmesh/dof_map.h"
20 
22  std::vector<JacobianBlock *> & blocks,
23  const std::set<TagID> & tags)
24  : ComputeFullJacobianThread(fe_problem, tags), _blocks(blocks)
25 {
26 }
27 
28 // Splitting Constructor
31  : ComputeFullJacobianThread(x, split), _blocks(x._blocks)
32 {
33 }
34 
36 
37 void
39 {
40  std::vector<dof_id_type>
41  dof_indices; // Do this out here to avoid creating and destroying it thousands of times
42 
43  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
44 
45  for (const auto & block : _blocks)
46  {
47  const DofMap & dof_map = block->_precond_system.get_dof_map();
48  dof_map.dof_indices(elem, dof_indices);
49 
51  block->_jacobian, block->_ivar, block->_jvar, dof_map, dof_indices, _tid);
52  }
53 }
virtual void postElement(const Elem *elem) override
Called after the element assembly is done (including surface assembling)
ComputeJacobianBlocksThread(FEProblemBase &fe_problem, std::vector< JacobianBlock *> &blocks, const std::set< TagID > &tags)
static PetscErrorCode Vec x
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Specialization for filling multiple "small" preconditioning matrices simulatenously.
std::vector< std::string > split(const std::string &str, const std::string &delimiter)
Python like split function for strings.
Definition: MooseUtils.C:736
DofMap & dof_map
std::vector< JacobianBlock * > _blocks
virtual void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, THREAD_ID tid) override