OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
A helper class assembling local matrices into global multilevel matrices. More...
#include <mesh_worker_assembler.h>
Public Types | |
typedef boost::shared_ptr < MatrixBlock< MGLevelObject < MATRIX > > > | MatrixPtr |
The object that is stored. | |
Public Member Functions | |
MGMatrixLocalBlocksToGlobalBlocks (double threshold=1.e-12) | |
Constructor, initializing the threshold, which limits how small numbers may be to be entered into the matrix. | |
void | initialize (const BlockInfo &block_info, std::vector< MatrixPtr > &matrices) |
Copy the BlockInfo and the matrix pointers into local variables and initialize cell matrix vectors. | |
void | initialize_edge_flux (std::vector< MatrixPtr > &up, std::vector< MatrixPtr > &down) |
Multigrid methods on locally refined meshes need additional matrices. | |
template<int dim> | |
void | assemble (const InfoObjects::DoFInfo< dim > &info) |
Assemble the matrices M11 into the global matrices and reset them to zero. | |
template<int dim> | |
void | assemble (const InfoObjects::DoFInfo< dim > &info1, const InfoObjects::DoFInfo< dim > &info2) |
Assemble all local matrices into the global matrices and reset them to zero. | |
![]() | |
template<class MatrixPtr > | |
void | initialize (const BlockInfo &block_info, std::vector< MatrixPtr > &matrices) |
Copy the BlockInfo and the matrix pointers into local variables and initialize cell matrix vectors. | |
Private Member Functions | |
void | assemble (MATRIX &global, const FullMatrix< number > &local, unsigned int block_row, unsigned int block_col, const std::vector< unsigned int > &dof1, const std::vector< unsigned int > &dof2, unsigned int level1, unsigned int level2, bool transpose=false) |
Assemble a single local matrix into a global one. | |
Private Attributes | |
std::vector< MatrixPtr > | matrices |
The level matrices, stored as a vector of pointers. | |
std::vector< MatrixPtr > | flux_down |
The flux matrix between the fine and the coarse level at refinement edges. | |
std::vector< MatrixPtr > | flux_up |
The flux matrix between the coarse and the fine level at refinement edges. | |
const double | threshold |
The smallest positive number that will be entered into the global matrix. | |
Additional Inherited Members | |
![]() | |
std::vector< MatrixBlock < FullMatrix< number > > > | M11 |
The local matrices coupling degrees of freedom in the cell itself aor within the first cell on a face. | |
std::vector< MatrixBlock < FullMatrix< number > > > | M22 |
The local matrices coupling degrees of freedom in the second cell on a face. | |
std::vector< MatrixBlock < FullMatrix< number > > > | M12 |
The local matrices coupling test function degrees of freedom in the first cell and trial function degrees of freedom in the second cell of a face, respectively. | |
std::vector< MatrixBlock < FullMatrix< number > > > | M21 |
The local matrices coupling test function degrees of freedom in the second cell and trial function degrees of freedom in the first cell of a face, respectively. | |
BlockInfo | block_info |
Information on block sizes and block start indices. | |
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.
typedef boost::shared_ptr<MatrixBlock<MGLevelObject<MATRIX> > > MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::MatrixPtr |
The object that is stored.
|
inline |
Constructor, initializing the threshold, which limits how small numbers may be to be entered into the matrix.
|
inline |
Assemble the matrices M11 into the global matrices and reset them to zero.
References MeshWorker::InfoObjects::DoFInfo< dim, spacedim >::cell, and MeshWorker::InfoObjects::DoFInfo< dim, spacedim >::indices.
|
inline |
Assemble all local matrices into the global matrices and reset them to zero.
References MeshWorker::InfoObjects::DoFInfo< dim, spacedim >::cell, and MeshWorker::InfoObjects::DoFInfo< dim, spacedim >::indices.
|
inlineprivate |
Assemble a single local matrix into a global one.
|
inline |
Copy the BlockInfo and the matrix pointers into local variables and initialize cell matrix vectors.
References MeshWorker::Assembler::LocalMatrixBlocks< number >::initialize().
|
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.
|
private |
The flux matrix between the fine and the coarse level at refinement edges.
|
private |
The flux matrix between the coarse and the fine level at refinement edges.
|
private |
The level matrices, stored as a vector of pointers.
|
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.