Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

ElmMatVec Class Reference

element matrix and vector for FEM programming. More...

#include <ElmMatVec.h>

Inheritance diagram for ElmMatVec::

HandleId List of all members.

Public Methods

 ElmMatVec ()
void attach (DegFreeFE &dof)
void attach (DegFreeFE &dof, DegFreeFE &jdof)
void detach ()
 ElmMatVec (DegFreeFE &dof)
 ~ElmMatVec ()
bool refill (int elm_no)
bool refill2dofs (int elm_no)
void fill (const ElmMatVec &elmat)
DegFreeFEgetDegFreeFE (bool col=false)
int getNoDofInElm () const
void enforceEssBC ()
void enforceEssBC2dofs ()
bool ok () const
void print (Os os, int help=1) const
 COPY_CONSTRUCTOR (ElmMatVec)
 ASSIGNMENT_OPERATOR (ElmMatVec)

Public Attributes

int elm_no
int nedof
int neeqs
bool is_block
Handle(DegFreeFEdof
Handle(DegFreeFEjdof
Mat(NUMT) A
Vec(NUMT) b
VecSimple(int) loc2glob_u
VecSimple(int) loc2glob_e
Vec(NUMT) b_mod

Detailed Description

element matrix and vector for FEM programming.

NAME: ElmMatVec - element matrix and vector for FEM programming

DESCRIPTION:

The class represents the element matrix and vector that are frequently used when programming finite element methods. In addition, the class has data for the mapping between local and global degrees of freedom and data for the boundary conditions.

The contents of the class are used when assembling the element level contributions in a finite element algorithm. The class also implements the essential boundary conditions at nodes in the element. The computation of the data in the class is performed by the "refill" function for initialization, then the programmer fills the element matrix and vector with contents, for example, in a numerical integration loop over the element. When using class "FEM" algorithms, one usually adds the contribution from the current integration point to the "ElmMatVec" object in an "integrands" routine. Alternatively, the programmer can fill the "ElmMatVec" object in "calcElmMatVec" using explicit analytical expressions for the element contributions.

The row number of the element matrix reflects the weighting function number, or more precisely, the discrete equation number, while the column number reflect the primary unknown number.

NOTE: Some comments in the documentation of this class refer to mixed finite element methods. See also class "MxElmMatVec".


Constructor & Destructor Documentation

ElmMatVec::ElmMatVec ( )
 

There are two ways of creating a class instance: 1) use the constructor without arguments and then attach a "DegFreeFE" object keeping track of the grid, element and linear system degrees of freedom, or 2) use the constructor that takes the "DegFreeFE" object as argument. Note that for each element, one must take a "refill" call in order to initialize the "ElmMatVec" object for that particular element. The "refill" function will size "A" and "b" correctly, set these to zero (which is required if they are used inside a numerical integration loop), and compute the local-global degrees of freedom mapping ("loc2glob" array).

One can easily make a "VecSimplest(ElmMatVec)" object for storing all the element matrices and vectors in a finite element problem. However, one should be aware of the efficiency loss of such a structure since each element matrix and vector must be allocated separately and will hence be spread out in memory. For high efficiency one should store all the element matrices and vectors in pure arrays that occupy a continuous memory segment.

NOTE! The users of this class have public access to the element matrix "A" and the element vector "b" as "Mat(NUMT)" and "Vec(NUMT)" objects.

ElmMatVec::ElmMatVec ( DegFreeFE & dof )
 

See documentation of one of the overloaded constructor.

ElmMatVec::~ElmMatVec ( )
 


Member Function Documentation

ElmMatVec::ASSIGNMENT_OPERATOR ( ElmMatVec )
 

ElmMatVec::COPY_CONSTRUCTOR ( ElmMatVec )
 

void ElmMatVec::attach ( DegFreeFE & dof,
DegFreeFE & jdof )
 

See documentation of one of the overloaded functions.

void ElmMatVec::attach ( DegFreeFE & dof )
 

make a connection to a "DegFreeFE" object. An overloaded version of this function which accepts two "DegFreeFE" objects as input is used for mixed FEM.

void ElmMatVec::detach ( ) [inline]
 

frees the connection to the main "DegFreeFE" object.

void ElmMatVec::enforceEssBC ( )
 

enforces essential boundary conditions. If the system of linear equations, corresponding to a "ElmMatVec" object, has an unknown which is a correction vector, special care must be taken. This is the case when e.g. Newton''s method are used for solving systems of nonlinear equations. In each linear problem it is assumed that the total solution has its boundary conditions inserted and that the correction vector must have zeroes for all entries where the value is known. That is, in the modification of "A" and "b" one must set the essential condition to be zero. The "ElmMatVec enforceEssBC" function calls the "zeroInterpretationOfEssBC" of "DegFreeFE" for determining whether the user has indicated to the "DegFreeFE" object that all non-zero essential boundary condition values are to be interpreted as if they were zero. When Newton-Raphson''s method is used, it is important that the programmer calls the "fillEssBC2zero" function of the "DegFreeFE" class object prior to any "enforceEssBC."

void ElmMatVec::enforceEssBC2dofs ( )
 

void ElmMatVec::fill ( const ElmMatVec & elmat )
 

copy the element matrix and vector from the input "ElmMatVec" object.

DegFreeFE & ElmMatVec::getDegFreeFE ( bool col = false )
 

called with the default argument "false", this function returns a reference to the main "DegFreeFE" object. For a "true" input value, it returns the secondary "DegFreeFE" object used for mixed FEM.

int ElmMatVec::getNoDofInElm ( ) const [inline]
 

returns the number of degrees of freedom for this element. The number equals the number of columns in the element matrix.

bool ElmMatVec::ok ( ) const
 

void ElmMatVec::print ( Os os,
int help = 1 ) const
 

bool ElmMatVec::refill ( int elm_no )
 

initialize the data structure and mappings for element number "elm_no".

bool ElmMatVec::refill2dofs ( int elm_no )
 

variant of "refill" to be used for mixed FEM.


Member Data Documentation

Mat(NUMT) ElmMatVec::A
 

Vec(NUMT) ElmMatVec::b
 

Vec(NUMT) ElmMatVec::b_mod
 

Handle(DegFreeFE) ElmMatVec::dof
 

int ElmMatVec::elm_no
 

bool ElmMatVec::is_block
 

Handle(DegFreeFE) ElmMatVec::jdof
 

VecSimple(int) ElmMatVec::loc2glob_e
 

VecSimple(int) ElmMatVec::loc2glob_u
 

int ElmMatVec::nedof
 

int ElmMatVec::neeqs
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.