Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number > Class Template Reference

#include <deal.II/meshworker/assembler.h>

Public Types

using MatrixPtrVector = MGMatrixBlockVector< MatrixType >
 
using MatrixPtrVectorPtr = SmartPointer< MatrixPtrVector, MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number > >
 

Public Member Functions

 MGMatrixLocalBlocksToGlobalBlocks (double threshold=1.e-12)
 
void initialize (const BlockInfo *block_info, MatrixPtrVector &matrices)
 
void initialize (const MGConstrainedDoFs &mg_constrained_dofs)
 
void initialize_edge_flux (MatrixPtrVector &up, MatrixPtrVector &down)
 
void initialize_interfaces (MatrixPtrVector &interface_in, MatrixPtrVector &interface_out)
 
template<class DOFINFO >
void initialize_info (DOFINFO &info, bool face) const
 
template<class DOFINFO >
void assemble (const DOFINFO &info)
 
template<class DOFINFO >
void assemble (const DOFINFO &info1, const DOFINFO &info2)
 

Private Member Functions

void assemble (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2, bool transpose=false)
 
void assemble_fluxes (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2)
 
void assemble_up (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2)
 
void assemble_down (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2)
 
void assemble_in (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2)
 
void assemble_out (MatrixType &global, const FullMatrix< number > &local, const unsigned int block_row, const unsigned int block_col, const std::vector< types::global_dof_index > &dof1, const std::vector< types::global_dof_index > &dof2, const unsigned int level1, const unsigned int level2)
 

Private Attributes

MatrixPtrVectorPtr matrices
 
MatrixPtrVectorPtr flux_down
 
MatrixPtrVectorPtr flux_up
 
MatrixPtrVectorPtr interface_out
 
MatrixPtrVectorPtr interface_in
 
SmartPointer< const BlockInfo, MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number > > block_info
 
SmartPointer< const MGConstrainedDoFs, MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number > > mg_constrained_dofs
 
const double threshold
 

Detailed Description

template<typename MatrixType, typename number = double>
class MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >

A helper class assembling local matrices into global multilevel matrices. This class is the multilevel equivalent of MatrixLocalBlocksToGlobalBlocks and documentation of that class applies here to a large extend.

The global matrices are expected as a vector of pointers to MatrixBlock objects, each containing a MGLevelObject with matrices with a function corresponding to SparseMatrix::add() and information on the block row and column this matrix represents in a block system.

The local matrices are a similar vector of MatrixBlock objects, but containing a FullMatrix.

If local refinement occurs, the Multigrid method needs more matrices, two for continuous elements and another two if numerical fluxes are computed on interfaces. The second set can be added using initialize_edge_flux(). Once added, the contributions in all participating matrices will be assembled from the cell and face matrices automatically.

Definition at line 325 of file assembler.h.

Member Typedef Documentation

◆ MatrixPtrVector

template<typename MatrixType , typename number = double>
using MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::MatrixPtrVector = MGMatrixBlockVector<MatrixType>

Definition at line 328 of file assembler.h.

◆ MatrixPtrVectorPtr

template<typename MatrixType , typename number = double>
using MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::MatrixPtrVectorPtr = SmartPointer<MatrixPtrVector, MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number> >

Definition at line 329 of file assembler.h.

Constructor & Destructor Documentation

◆ MGMatrixLocalBlocksToGlobalBlocks()

template<typename MatrixType , typename number >
MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::MGMatrixLocalBlocksToGlobalBlocks ( double  threshold = 1.e-12)
inline

Constructor, initializing the threshold, which limits how small numbers may be to be entered into the matrix.

Definition at line 782 of file assembler.h.

Member Function Documentation

◆ initialize() [1/2]

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::initialize ( const BlockInfo block_info,
MatrixPtrVector matrices 
)
inline

Copy the BlockInfo and the matrix pointers into local variables and initialize cell matrix vectors.

Definition at line 790 of file assembler.h.

◆ initialize() [2/2]

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::initialize ( const MGConstrainedDoFs mg_constrained_dofs)
inline

Initialize the multilevel constraints.

Definition at line 802 of file assembler.h.

◆ initialize_edge_flux()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::initialize_edge_flux ( MatrixPtrVector up,
MatrixPtrVector down 
)
inline

Multigrid methods on locally refined meshes need additional matrices. For discontinuous Galerkin methods, these are two flux matrices across the refinement edge, which are set by this method.

Definition at line 823 of file assembler.h.

◆ initialize_interfaces()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::initialize_interfaces ( MatrixPtrVector interface_in,
MatrixPtrVector interface_out 
)
inline

Multigrid methods on locally refined meshes need additional matrices. For discontinuous Galerkin methods, these are two flux matrices across the refinement edge, which are set by this method.

Definition at line 834 of file assembler.h.

◆ initialize_info()

template<typename MatrixType , typename number >
template<class DOFINFO >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::initialize_info ( DOFINFO &  info,
bool  face 
) const
inline

Initialize the local data in the DoFInfo object used later for assembling.

The info object refers to a cell if !face, or else to an interior or boundary face.

Definition at line 812 of file assembler.h.

◆ assemble() [1/3]

template<typename MatrixType , typename number >
template<class DOFINFO >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble ( const DOFINFO &  info)
inline

Assemble the local matrices into the global matrices.

Definition at line 1274 of file assembler.h.

◆ assemble() [2/3]

template<typename MatrixType , typename number >
template<class DOFINFO >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble ( const DOFINFO &  info1,
const DOFINFO &  info2 
)
inline

Assemble all local matrices into the global matrices.

Definition at line 1339 of file assembler.h.

◆ assemble() [3/3]

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2,
bool  transpose = false 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 844 of file assembler.h.

◆ assemble_fluxes()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble_fluxes ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 933 of file assembler.h.

◆ assemble_up()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble_up ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 996 of file assembler.h.

◆ assemble_down()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble_down ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 1059 of file assembler.h.

◆ assemble_in()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble_in ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 1122 of file assembler.h.

◆ assemble_out()

template<typename MatrixType , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::assemble_out ( MatrixType &  global,
const FullMatrix< number > &  local,
const unsigned int  block_row,
const unsigned int  block_col,
const std::vector< types::global_dof_index > &  dof1,
const std::vector< types::global_dof_index > &  dof2,
const unsigned int  level1,
const unsigned int  level2 
)
inlineprivate

Assemble a single local matrix into a global one.

Definition at line 1197 of file assembler.h.

Member Data Documentation

◆ matrices

template<typename MatrixType , typename number = double>
MatrixPtrVectorPtr MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::matrices
private

The level matrices, stored as a vector of pointers.

Definition at line 477 of file assembler.h.

◆ flux_down

template<typename MatrixType , typename number = double>
MatrixPtrVectorPtr MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::flux_down
private

The flux matrix between the fine and the coarse level at refinement edges.

Definition at line 483 of file assembler.h.

◆ flux_up

template<typename MatrixType , typename number = double>
MatrixPtrVectorPtr MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::flux_up
private

The flux matrix between the coarse and the fine level at refinement edges.

Definition at line 489 of file assembler.h.

◆ interface_out

template<typename MatrixType , typename number = double>
MatrixPtrVectorPtr MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::interface_out
private

The interface matrix between the fine and the coarse level at refinement edges.

Definition at line 495 of file assembler.h.

◆ interface_in

template<typename MatrixType , typename number = double>
MatrixPtrVectorPtr MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::interface_in
private

The interface matrix between the coarse and the fine level at refinement edges.

Definition at line 501 of file assembler.h.

◆ block_info

template<typename MatrixType , typename number = double>
SmartPointer<const BlockInfo, MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number> > MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::block_info
private

A pointer to the object containing the block structure.

Definition at line 508 of file assembler.h.

◆ mg_constrained_dofs

template<typename MatrixType , typename number = double>
SmartPointer<const MGConstrainedDoFs, MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number> > MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::mg_constrained_dofs
private

A pointer to the object containing constraints.

Definition at line 515 of file assembler.h.

◆ threshold

template<typename MatrixType , typename number = double>
const double MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MatrixType, number >::threshold
private

The smallest positive number that will be entered into the global matrix. All smaller absolute values will be treated as zero and will not be assembled.

Definition at line 523 of file assembler.h.


The documentation for this class was generated from the following file: