www.mooseframework.org
ComputeJacobianBlocksThread.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
16 
17 // MOOSE includes
18 #include "DGKernel.h"
19 #include "FEProblem.h"
20 #include "KernelBase.h"
21 #include "IntegratedBC.h"
22 
23 #include "libmesh/threads.h"
24 #include "libmesh/dof_map.h"
25 
27  std::vector<JacobianBlock *> & blocks)
28  : ComputeFullJacobianThread(fe_problem, blocks[0]->_jacobian /* have to pass something */),
29  _blocks(blocks)
30 {
31 }
32 
33 // Splitting Constructor
35  Threads::split split)
37 {
38 }
39 
41 
42 void
44 {
45  std::vector<dof_id_type>
46  dof_indices; // Do this out here to avoid creating and destroying it thousands of times
47 
48  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
49 
50  for (const auto & block : _blocks)
51  {
52  const DofMap & dof_map = block->_precond_system.get_dof_map();
53  dof_map.dof_indices(elem, dof_indices);
54 
56  block->_jacobian, block->_ivar, block->_jvar, dof_map, dof_indices, _tid);
57  }
58 }
virtual void postElement(const Elem *elem) override
Called after the element assembly is done (including surface assembling)
static PetscErrorCode Vec x
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Specialization for filling multiple "small" preconditioning matrices simulatenously.
ComputeJacobianBlocksThread(FEProblemBase &fe_problem, std::vector< JacobianBlock * > &blocks)
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