IFEM  90A354
Classes | Public Member Functions | Private Attributes | List of all members
BlockElmMats Class Reference

Class representing the block element matrices for a FEM problem. More...

#include <BlockElmMats.h>

Inheritance diagram for BlockElmMats:
Inheritance graph
[legend]
Collaboration diagram for BlockElmMats:
Collaboration graph
[legend]

Classes

struct  Basis
 A struct with some key parameters for each basis. More...
 
struct  Block
 A struct with some key parameters for each block. More...
 

Public Member Functions

 BlockElmMats (size_t nBlk, size_t nBas)
 The constructor initializes the block information arrays. More...
 
virtual ~BlockElmMats ()
 Empty destructor.
 
bool redim (size_t blkIndex, size_t nen, size_t ncmp=1, char basis=1)
 Sets the dimension of a diagonal block sub-matrix. More...
 
bool redimOffDiag (size_t blkIndex, char symmetric=1)
 Sets the dimension of an off-diagonal block sub-matrix. More...
 
bool finalize ()
 Calculates the dimension of the Newton matrix. More...
 
virtual const MatrixgetNewtonMatrix () const
 Returns the element-level Newton matrix.
 
virtual const VectorgetRHSVector () const
 Returns the element-level right-hand-side vector.
 
void redim (size_t ndim)
 Sets the dimension of the element matrices and vectors. More...
 
- Public Member Functions inherited from ElmMats
 ElmMats (bool lhs=true)
 Default constructor.
 
virtual ~ElmMats ()
 Empty destructor.
 
void resize (size_t nA, size_t nB, size_t nC=0)
 Defines the number of element matrices and vectors. More...
 
void redim (size_t ndim)
 Sets the dimension of the element matrices and vectors. More...
 
virtual bool empty () const
 Checks if the element matrices are empty.
 
virtual void setStepSize (double, int)
 Updates the time step size.
 
void printMat (std::ostream &os, size_t idx=0, const char *prefix=nullptr) const
 Prints element matrix idx to output stream os.
 
void printVec (std::ostream &os, size_t idx=0, const char *prefix=nullptr) const
 Prints element vector idx to output stream os.
 
void printScl (std::ostream &os, size_t idx=0, const char *prefix=nullptr) const
 Prints element scalar idx to output stream os.
 
- Public Member Functions inherited from LocalIntegral
virtual ~LocalIntegral ()
 Empty destructor.
 
virtual void destruct ()
 Virtual destruction method to clean up after numerical integration.
 
virtual const LocalIntegralref () const
 Returns the LocalIntegral object to assemble into the global one.
 
void getSolution (size_t nsd, size_t nen, Matrix *u=nullptr, Matrix *v=nullptr, Matrix *a=nullptr, bool forceCurrent=false) const
 Extracts element solution vectors as nsd by nen matrices. More...
 

Private Attributes

size_t neldof
 Size of newton matrix.
 
std::vector< BlockblockInfo
 Block information.
 
std::vector< BasisbasisInfo
 Basis information.
 
std::vector< char > symmFlag
 Symmetry flag for off-diagonal blocks.
 

Additional Inherited Members

- Public Attributes inherited from ElmMats
std::vector< MatrixA
 The element coefficient matrices.
 
std::vector< Vectorb
 The element right-hand-side vectors.
 
std::vector< double > c
 The scalar quantities.
 
std::vector< const char * > Aname
 Matrix names (for debug print)
 
std::vector< const char * > Bname
 Vector names (for debug print)
 
std::vector< const char * > Cname
 Scalar names (for debug print)
 
bool rhsOnly
 If true, only the right-hand-sides are assembled.
 
bool withLHS
 If true, left-hand-side element matrices are present.
 
- Public Attributes inherited from LocalIntegral
Vectors vec
 Element-level primary solution vectors.
 
- Protected Member Functions inherited from LocalIntegral
 LocalIntegral ()
 The default constructor is protected to allow sub-classes only.
 

Detailed Description

Class representing the block element matrices for a FEM problem.

This class can be used for multi-integrand FEM problems with strong coupling, where the element matrices typically consist of blocks resulting from the various integrands. The block sub-matrices are stitched together into an element-level Newton matrix corresponding to all DOFs of the element by the getNewtonMatrix() method.

Constructor & Destructor Documentation

◆ BlockElmMats()

BlockElmMats::BlockElmMats ( size_t  nBlk,
size_t  nBas 
)
inline

The constructor initializes the block information arrays.

Parameters
[in]nBlkNumber of matrix blocks (in each direction, row & column)
[in]nBasNumber of bases (> 1 for mixed problems)

Member Function Documentation

◆ finalize()

bool BlockElmMats::finalize ( )

Calculates the dimension of the Newton matrix.

This method must not be invoked until the redim method has been invoked for all the diagonal blocks.

References basisInfo, blockInfo, and neldof.

◆ redim() [1/2]

bool BlockElmMats::redim ( size_t  blkIndex,
size_t  nen,
size_t  ncmp = 1,
char  basis = 1 
)

Sets the dimension of a diagonal block sub-matrix.

Parameters
[in]blkIndexSub-matrix block index
[in]nenNumber of element nodes for this matrix block
[in]ncmpNumber of nodal components for this matrix block
[in]basisBasis index associated with this block. If negative, this diagonal block is identically zero, but the dimension parameters are used for the associated off-diagonal blocks later.

References ElmMats::A, ElmMats::b, basisInfo, and blockInfo.

◆ redim() [2/2]

void ElmMats::redim

Sets the dimension of the element matrices and vectors.

Parameters
[in]ndimNumber of rows and columns in the matrices/vectors

◆ redimOffDiag()

bool BlockElmMats::redimOffDiag ( size_t  blkIndex,
char  symmetric = 1 
)

Sets the dimension of an off-diagonal block sub-matrix.

Parameters
[in]blkIndexSub-matrix block index
[in]symmetricSymmetry flag (0: not, 1: yes, -1: skew-symmetric)

This method must not be invoked until the redim method has been invoked for all the diagonal blocks.

References ElmMats::A, basisInfo, blockInfo, and symmFlag.


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