Reference documentation for deal.II version 9.6.0
\(\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
MeshWorker::Assembler::MatrixSimple< MatrixType > Class Template Reference

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

Inheritance diagram for MeshWorker::Assembler::MatrixSimple< MatrixType >:

Public Member Functions

 MatrixSimple (double threshold=1.e-12)
 
void initialize (MatrixType &m)
 
void initialize (std::vector< MatrixType > &m)
 
void initialize (const AffineConstraints< typename MatrixType::value_type > &constraints)
 
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)
 

Protected Attributes

std::vector< SmartPointer< MatrixType, MatrixSimple< MatrixType > > > matrix
 
const double threshold
 

Private Member Functions

void assemble (const FullMatrix< double > &M, const unsigned int index, const std::vector< types::global_dof_index > &i1, const std::vector< types::global_dof_index > &i2)
 

Private Attributes

SmartPointer< const AffineConstraints< typename MatrixType::value_type >, MatrixSimple< MatrixType > > constraints
 

Detailed Description

template<typename MatrixType>
class MeshWorker::Assembler::MatrixSimple< MatrixType >

Assemble local matrices into a single global matrix or several global matrices associated with the same DoFHandler. If these global matrix have a block structure, this structure is not used, but rather the global numbering of degrees of freedom.

After being initialized with a SparseMatrix object (or another matrix offering the same functionality as SparseMatrix::add()) or a vector of such, this class can be used in a MeshWorker::loop() to assemble the cell and face matrices into the global matrix.

If a AffineConstraints has been provided during initialization, this matrix will be used (AffineConstraints::distribute_local_to_global(), to be precise) to enter the local matrix into the global sparse matrix.

The assembler can handle two different types of local data. First, by default, the obvious choice of taking a single local matrix with dimensions equal to the number of degrees of freedom of the cell. Alternatively, a local block structure can be initialized in DoFInfo. After this, the local data will be arranged as an array of n by n FullMatrix blocks (n being the number of blocks in the FESystem used by the DoFHandler in DoFInfo), which are ordered lexicographically with column index fastest in DoFInfo. If the matrix was initialized with a vector of several matrices and local block structure is used, then the first n2 matrices in LocalResults will be used for the first matrix in this vector, the second set of n2 for the second, and so on.

Definition at line 151 of file simple.h.

Constructor & Destructor Documentation

◆ MatrixSimple()

template<typename MatrixType >
MeshWorker::Assembler::MatrixSimple< MatrixType >::MatrixSimple ( 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 577 of file simple.h.

Member Function Documentation

◆ initialize() [1/3]

template<typename MatrixType >
void MeshWorker::Assembler::MatrixSimple< MatrixType >::initialize ( MatrixType & m)
inline

Store the result matrix for later assembling.

Definition at line 584 of file simple.h.

◆ initialize() [2/3]

template<typename MatrixType >
void MeshWorker::Assembler::MatrixSimple< MatrixType >::initialize ( std::vector< MatrixType > & m)
inline

Store several result matrices for later assembling.

Definition at line 593 of file simple.h.

◆ initialize() [3/3]

template<typename MatrixType >
void MeshWorker::Assembler::MatrixSimple< MatrixType >::initialize ( const AffineConstraints< typename MatrixType::value_type > & constraints)
inline

Initialize the constraints. After this function has been called with a valid AffineConstraints object, the function AffineConstraints::distribute_local_to_global() will be used by assemble() to distribute the cell and face matrices into a global sparse matrix.

Definition at line 603 of file simple.h.

◆ initialize_info()

template<typename MatrixType >
template<class DOFINFO >
void MeshWorker::Assembler::MatrixSimple< MatrixType >::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 613 of file simple.h.

◆ assemble() [1/3]

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

Assemble the local matrices associated with a single cell into the global matrix.

Definition at line 668 of file simple.h.

◆ assemble() [2/3]

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

Assemble all local matrices associated with an interior face in the info1 and info2 objects into the global matrix.

Definition at line 695 of file simple.h.

◆ assemble() [3/3]

template<typename MatrixType >
void MeshWorker::Assembler::MatrixSimple< MatrixType >::assemble ( const FullMatrix< double > & M,
const unsigned int index,
const std::vector< types::global_dof_index > & i1,
const std::vector< types::global_dof_index > & i2 )
inlineprivate

Assemble a single matrix M into the element at index in the vector matrix.

Definition at line 644 of file simple.h.

Member Data Documentation

◆ matrix

template<typename MatrixType >
std::vector<SmartPointer<MatrixType, MatrixSimple<MatrixType> > > MeshWorker::Assembler::MatrixSimple< MatrixType >::matrix
protected

The vector of global matrices being assembled.

Definition at line 214 of file simple.h.

◆ threshold

template<typename MatrixType >
const double MeshWorker::Assembler::MatrixSimple< MatrixType >::threshold
protected

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 221 of file simple.h.

◆ constraints

template<typename MatrixType >
SmartPointer<const AffineConstraints<typename MatrixType::value_type>, MatrixSimple<MatrixType> > MeshWorker::Assembler::MatrixSimple< MatrixType >::constraints
private

A pointer to the object containing constraints.

Definition at line 239 of file simple.h.


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