https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeJacobianBlocksThread.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
34
36
37void
39{
40 _dof_indices.clear();
41
42 for (const auto & block : _blocks)
43 {
44 const auto & dof_map = block->_precond_system.get_dof_map();
45 dof_map.dof_indices(elem, _dof_indices);
46
48 block->_jacobian, block->_ivar, block->_jvar, dof_map, _dof_indices, _tags, _tid);
49 }
50}
51
52void
53ComputeJacobianBlocksThread::postInternalSide(const Elem * elem, unsigned int side)
54{
56 {
57 _dof_indices.clear();
59
60 // Pointer to the neighbor we are currently working on.
61 const Elem * neighbor = elem->neighbor_ptr(side);
62
63 // Get the global id of the element and the neighbor
64 const auto elem_id = elem->id(), neighbor_id = neighbor->id();
65
66 if ((neighbor->active() && (neighbor->level() == elem->level()) && (elem_id < neighbor_id)) ||
67 (neighbor->level() < elem->level()))
68 for (const auto & block : _blocks)
69 {
70 const auto & dof_map = block->_precond_system.get_dof_map();
71 dof_map.dof_indices(elem, _dof_indices);
72 dof_map.dof_indices(neighbor, _dof_neighbor_indices);
73
74 _fe_problem.addJacobianNeighbor(block->_jacobian,
75 block->_ivar,
76 block->_jvar,
77 dof_map,
80 _tags,
81 _tid);
82 }
83 }
84}
char ** blocks
Specialization for filling multiple "small" preconditioning matrices simulatenously.
ComputeJacobianBlocksThread(FEProblemBase &fe_problem, std::vector< JacobianBlock * > &blocks, const std::set< TagID > &tags)
virtual void postElement(const Elem *elem) override
Called after the element assembly is done (including surface assembling)
virtual void postInternalSide(const Elem *elem, unsigned int side) override
Called after evaluations on an element internal side.
std::vector< dof_id_type > _dof_neighbor_indices
std::vector< dof_id_type > _dof_indices
std::vector< JacobianBlock * > _blocks
const std::set< TagID > & _tags
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void addJacobianBlockTags(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
virtual void addJacobianNeighbor(const THREAD_ID tid) override
bool hasActiveBlockObjects(THREAD_ID tid=0) const
MooseObjectWarehouse< DGKernelBase > * _dg_warehouse
SubdomainID _subdomain
The subdomain for the current element.