GemaCoreLib
The GeMA Core library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GmElementDof Class Reference

A class to represent the degrees of freedom associated with each node of an element as seen by a physics object. More...

#include <gmElementDof.h>

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

Public Member Functions

 GmElementDof (GmCellType type, const QList< int > &dofList=QList< int >())
 Constructor for a GmElementDof based on element type. Creates an element with the number of nodes given by the element type. Suitable only if the element does not have ghost nodes (with dof). More...
 
 GmElementDof (int numNodes, const QList< int > &dofList=QList< int >())
 Constructor for a GmElementDof based on element number of nodes. More...
 
 ~GmElementDof ()
 Destructor.
 
virtual int numDof () const
 Returns the total number of dofs for this element.
 
int numNodes () const
 Returns the number of nodes in the element (which can contain ghost nodes)
 
int node (int columnIndex) const
 Given a 'matrix column' index, returns the associated node. More...
 
virtual int dof (int columnIndex) const
 Given a 'matrix column' index, returns the associated dof. More...
 
GmElementDofMap nodeDofMap (int node) const
 Returns the dof map for the requested element local node.
 
QList< int > nodeDofList (int node) const
 Returns the dof list for the requested element local node. This function is slow and creates a new list when called.
 
GmElementDofMap elementDofMap () const
 Returns a map with the union of the maps of each of the elements nodes.
 
void setNodeDof (int node, const QList< int > &dofList)
 Replaces the dof map associated to an element node, receiving as input a list with VALID dof numbers (between 0 and GM_MAX_DOF), in their specified element order.
 
void addNode (const QList< int > &dofList)
 Adds a new (ghost) node to the element dof map, initializing its dof list with the given dofs. The list should contain VALID dof numbers (between 0 and GM_MAX_DOF), in their specified element order.
 

Private Member Functions

void init (int numNodes, const QList< int > &dofList)
 Helper function for constructing the object. See parameters in the constructor description.
 
GmElementDofMap dofMapFromList (const QList< int > &dofList) const
 Given a list with VALID dof numbers (between 0 and GM_MAX_DOF), returns a dof map representing the list.
 

Private Attributes

int _ndof
 The total number of dof for this element type.
 
QVector< GmElementDofMap_nodeMaps
 Vector storing the dof map for each element node.
 
QVector< int > _columnNodeList
 Vector indexed by 'matrix column' storing the column respective node number. Size equal to numDof().
 
QVector< int > _columnDofList
 Vector indexed by 'matrix column' storing the column respective dof number. Size equal to numDof().
 

Detailed Description

A class to represent the degrees of freedom associated with each node of an element as seen by a physics object.

For each node, dofs are stored as a bit map, represented by the GmElementDofMap type, where bit 'i' turned on means that dof 'i' is associated with that node.

The element number of nodes can be greater then the standard node number for the element type, allowing for dofs associated with ghost nodes. It can also change over time when a ghost node is added to an element.

To allow for efficient translation of 'column indices' into their respective node and dof values, the same information is also stored in two lists, one storing node numbers and the other dof values. Those lists have size equal to the number of dofs for the entire element and are ordered by node, with the order inside each node group defined by the dof order in the list used to set dofs per node.

The list representation stores dof order while the bit representation is a compact one that makes it easy to combine node information from several elements in situation where the order is not important.

Constructor & Destructor Documentation

◆ GmElementDof() [1/2]

GmElementDof::GmElementDof ( GmCellType  type,
const QList< int > &  dofList = QList<int>() 
)

Constructor for a GmElementDof based on element type. Creates an element with the number of nodes given by the element type. Suitable only if the element does not have ghost nodes (with dof).

Parameters
typeThe type of element we are storing dof maps for
dofIf different from an empty list, specifies the dof numbers that should be associated to every node in the element in the given order. List entries MUST be valid dof numbers (between 0 and GM_MAX_DOF). If the list is empty, the object wil be constructed with an empty map associated with every node.

◆ GmElementDof() [2/2]

GmElementDof::GmElementDof ( int  numNodes,
const QList< int > &  dofList = QList<int>() 
)

Constructor for a GmElementDof based on element number of nodes.

Parameters
numNodesThe number of node in the element we are storing dof maps for
dofIf different from an empty list, specifies the dof numbers that should be associated to every node in the element in the given order. List entries MUST be valid dof numbers (between 0 and GM_MAX_DOF). If the list is empty, the object wil be constructed with an empty map associated with every node.

Member Function Documentation

◆ dof()

virtual int GmElementDof::dof ( int  columnIndex) const
inlinevirtual

Given a 'matrix column' index, returns the associated dof.

Column indices represent a position inside the ordered set of degrees of freedom associated to the element, the same order used when creating local element matrices. columnIndex must be a value less than numDof().

Implements GmDofMap.

◆ node()

int GmElementDof::node ( int  columnIndex) const
inline

Given a 'matrix column' index, returns the associated node.

Column indices represent a position inside the ordered set of degrees of freedom associated to the element, the same order used when creating local element matrices. columnIndex must be a value less than numDof().


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