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

Class for storage of a global nodal force vector with assembly methods. More...

#include <GlbForceVec.h>

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

Public Member Functions

 GlbForceVec (const SAM &_sam)
 The constructor only sets its reference to the SAM object.
 
virtual ~GlbForceVec ()
 Empty destructor.
 
bool initNodeMap (const std::vector< int > &globalNodes, size_t nfc)
 Initializes the global node map and allocates the force vector. More...
 
virtual void initialize (char=0)
 Initializes the global nodal force vector to zero.
 
virtual bool finalize (bool=false)
 Finalizes the global nodal force vector after element assembly.
 
virtual bool assemble (const LocalIntegral *elmObj, int elmId)
 Adds a set of element nodal forces into the global nodal forces. More...
 
Vec3 getForce (int node) const
 Returns the global nodal force vector for a specified node. More...
 
Vec3 getTotalForce () const
 Returns the sum of the nodal forces, i.e. total force.
 
int getForce (size_t indx, Vec3 &force) const
 Returns the global nodal force vector for a specified node. More...
 
size_t size () const
 Returns the size in terms of number of nodes with nodal forces.
 
- Public Member Functions inherited from GlobalIntegral
 GlobalIntegral ()
 The default constructor.
 
virtual ~GlobalIntegral ()
 Empty destructor.
 
virtual bool threadSafe () const
 Returns true if all elements can be assembled in parallel.
 
virtual bool haveContributions (size_t, const std::vector< Property > &) const
 Returns false if no contributions from a specified patch.
 

Private Attributes

const SAMsam
 Data for FE assembly management.
 
Matrix F
 Global nodal forces.
 
std::vector< int > nodeNum
 Global node numbers with forces.
 
std::map< int, size_t > nodeMap
 Maps from global node number to force index.
 

Detailed Description

Class for storage of a global nodal force vector with assembly methods.

Member Function Documentation

◆ assemble()

bool GlbForceVec::assemble ( const LocalIntegral elmObj,
int  elmId 
)
virtual

Adds a set of element nodal forces into the global nodal forces.

Parameters
[in]elmObjPointer to the element nodal forces to add into *this
[in]elmIdGlobal number of the element associated with *elmObj

Reimplemented from GlobalIntegral.

References ElmMats::b, F, SAM::getElmNodes(), SAM::getNodeDOFs(), ElmMats::getRHSVector(), nodeMap, utl::matrix< T >::rows(), and sam.

◆ getForce() [1/2]

Vec3 GlbForceVec::getForce ( int  node) const

Returns the global nodal force vector for a specified node.

Parameters
[in]node1-based global node number to return the forces for

References F, utl::matrix< T >::getColumn(), and nodeMap.

Referenced by HDF5Writer::writeNodalForces().

◆ getForce() [2/2]

int GlbForceVec::getForce ( size_t  indx,
Vec3 force 
) const

Returns the global nodal force vector for a specified node.

Parameters
[in]indx0-based node index to return the forces for
[out]forceThe force at the sepcified node
Returns
Global node number of the specified node, or zero if out-of-range

References utl::matrix< T >::cols(), F, utl::matrix< T >::getColumn(), and nodeNum.

◆ initNodeMap()

bool GlbForceVec::initNodeMap ( const std::vector< int > &  globalNodes,
size_t  nfc 
)

Initializes the global node map and allocates the force vector.

Parameters
[in]globalNodesThe global node numbers that will have force terms
[in]nfcNumber of force components

References F, SAM::getNoNodes(), nodeMap, nodeNum, utl::matrix< T >::resize(), and sam.

Referenced by SIM::initBoundaryNodeMap().


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