FEBio  1.5.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
FEStiffnessMatrix Class Reference

#include <FEStiffnessMatrix.h>

Public Member Functions

 FEStiffnessMatrix (SparseMatrix *pK)
 constructor
virtual ~FEStiffnessMatrix ()
 destructor
void Clear ()
 clears the sparse matrix that stores the stiffness matrix
bool Create (FESolver *psolver, int neq, bool breset)
 construct the stiffness matrix from a FEM object
void Assemble (matrix &ke, vector< int > &lm)
 assemble an element stiffness matrix into the global stiffness matrix
void Assemble (matrix &ke, vector< int > &lmi, vector< int > &lmj)
 more general assembly routine
int NonZeroes ()
 return the nonzeroes in the sparse matrix
int Rows ()
 return the number of rows
 operator SparseMatrix * ()
 converts a FEStiffnessMatrix to a SparseMatrix
 operator SparseMatrix & ()
 converts a FEStiffnessMatrix to a SparseMatrix
SparseMatrixGetSparseMatrixPtr ()
void Zero ()

Protected Types

enum  { MAX_LM_SIZE = 4096 }

Protected Member Functions

void build_begin (int neq)
void build_add (vector< int > &lm)
void build_end ()
void build_flush ()

Protected Attributes

SparseMatrixm_pA
 the actual global stiffness matrix
FEMm_pfem
 pointer to the FEM object
SparseMatrixProfilem_pMP
 profile of sparse matrix
vector< vector< int > > m_LM
 used for building the stiffness matrix
int m_nlm
 nr of elements in m_LM array

Detailed Description

The FEStiffnessmatrix class stores the global stiffness matrix of the FE problem. It also contains the algorithm to construct the stiffness matrix from a FEM object. The actual matrix data is stored in a SparseMatrix class.


Member Function Documentation

void FEStiffnessMatrix::build_add ( vector< int > &  lm) [protected]

Add an "element" to the matrix profile. The definition of an element is quite general at this point. Any two or more degrees of freedom that are connected somehow are considered an element. This function takes one argument, namely a list of degrees of freedom that are part of such an "element". Elements are first copied into a local LM array. When this array is full it is flushed and all elements in this array are added to the matrix profile.

void FEStiffnessMatrix::build_begin ( int  neq) [protected]

Start building the profile. That is delete the old profile (if there was one) and create a new one.

void FEStiffnessMatrix::build_end ( ) [protected]

This function makes sure the LM buffer is flushed and creates the actual sparse matrix from the matrix profile.

void FEStiffnessMatrix::build_flush ( ) [protected]

Flush the LM array. The LM array stores a buffer of elements that have to be added to the profile. When this buffer is full it needs to be flushed. This flushin operation causes the actual update of the matrix profile.

bool FEStiffnessMatrix::Create ( FESolver psolver,
int  neq,
bool  breset 
)

construct the stiffness matrix from a FEM object

Constructs the stiffness matrix from a FEM object. First a MatrixProfile object is constructed. This is done in two steps. First the "static" profile is constructed which contains the contribution of the static elements to the stiffness profile. The static profile is constructed only once during the first call to Create(). For next calls it is simply copied. After the static profile is created (or copied) the dynamic elements are added to the profile. Dynamic elements can change connectivity in between calls to Create() and therefore have to be added explicitly every time.


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