OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number > Class Template Reference

A helper class assembling local matrices into global multilevel matrices. More...

#include <mesh_worker_assembler.h>

Inheritance diagram for MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >:
Inheritance graph
[legend]
Collaboration diagram for MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from MeshWorker::Assembler::LocalMatrixBlocks< number >
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< MatrixPtrmatrices
 The level matrices, stored as a vector of pointers.
 
std::vector< MatrixPtrflux_down
 The flux matrix between the fine and the coarse level at refinement edges.
 
std::vector< MatrixPtrflux_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

- Public Attributes inherited from MeshWorker::Assembler::LocalMatrixBlocks< number >
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.
 

Detailed Description

template<class MATRIX, typename number = double>
class MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, 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.

Author
Guido Kanschat, 2009

Member Typedef Documentation

template<class MATRIX , typename number = double>
typedef boost::shared_ptr<MatrixBlock<MGLevelObject<MATRIX> > > MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::MatrixPtr

The object that is stored.

Constructor & Destructor Documentation

template<class MATRIX , typename number >
MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, 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.

Member Function Documentation

template<class MATRIX , typename number >
template<int dim>
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::assemble ( const InfoObjects::DoFInfo< dim > &  info)
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.

template<class MATRIX , typename number >
template<int dim>
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::assemble ( const InfoObjects::DoFInfo< dim > &  info1,
const InfoObjects::DoFInfo< dim > &  info2 
)
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.

template<class MATRIX , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::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 
)
inlineprivate

Assemble a single local matrix into a global one.

template<class MATRIX , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::initialize ( const BlockInfo block_info,
std::vector< MatrixPtr > &  matrices 
)
inline

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

References MeshWorker::Assembler::LocalMatrixBlocks< number >::initialize().

Here is the call graph for this function:

template<class MATRIX , typename number >
void MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::initialize_edge_flux ( std::vector< MatrixPtr > &  up,
std::vector< MatrixPtr > &  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.

Member Data Documentation

template<class MATRIX , typename number = double>
std::vector<MatrixPtr> MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::flux_down
private

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

template<class MATRIX , typename number = double>
std::vector<MatrixPtr> MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::flux_up
private

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

template<class MATRIX , typename number = double>
std::vector<MatrixPtr> MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, number >::matrices
private

The level matrices, stored as a vector of pointers.

template<class MATRIX , typename number = double>
const double MeshWorker::Assembler::MGMatrixLocalBlocksToGlobalBlocks< MATRIX, 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.


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