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::MatrixLocalBlocksToGlobalBlocks< MATRIX, number > Class Template Reference

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

#include <mesh_worker_assembler.h>

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

Public Types

typedef boost::shared_ptr
< MatrixBlock< MATRIX > > 
MatrixPtr
 The object that is stored.
 

Public Member Functions

 MatrixLocalBlocksToGlobalBlocks (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.
 
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)
 Assemble a single local matrix into a global one.
 

Private Attributes

std::vector< MatrixPtrmatrices
 The global matrices, stored as a vector of pointers.
 
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::MatrixLocalBlocksToGlobalBlocks< MATRIX, number >

A helper class assembling local matrices into global matrices.

The global matrices are expected as a vector of MatrixBlock objects, each containing a matrix object 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 expected as a similar vector of MatrixBlock objects, but containing a FullMatrix.

Like with ResidualLocalBlocksToGlobalBlocks, the initialization of the BlockInfo object decides whether the comprehensive data model or the block model is used.

In the comprehensive model, each of the LocalMatrixBlocks has coordinates (0,0) and dimensions equal to the number of degrees of freedom of the FESystem.

In the comprehensive model, each block has its own block coordinates and the size depends on the associated FESystem::base_element(). These blocks can be generated separately and will be assembled into the correct matrix block by this object.

Author
Guido Kanschat, 2009

Member Typedef Documentation

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

The object that is stored.

Constructor & Destructor Documentation

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

template<class MATRIX , typename number >
template<int dim>
void MeshWorker::Assembler::MatrixLocalBlocksToGlobalBlocks< 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 >::indices.

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

Assemble a single local matrix into a global one.

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

Member Data Documentation

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

The global matrices, stored as a vector of pointers.

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