IFEM  90A354
GlbForceVec.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _GLB_FORCE_VEC_H
15 #define _GLB_FORCE_VEC_H
16 
17 #include "GlobalIntegral.h"
18 #include "MatVec.h"
19 #include <map>
20 
21 class LocalIntegral;
22 class Vec3;
23 class SAM;
24 
25 
31 {
32 public:
34  explicit GlbForceVec(const SAM& _sam) : sam(_sam) {}
36  virtual ~GlbForceVec() {}
37 
41  bool initNodeMap(const std::vector<int>& globalNodes, size_t nfc);
42 
44  virtual void initialize(char = 0);
46  virtual bool finalize(bool = false);
47 
51  virtual bool assemble(const LocalIntegral* elmObj, int elmId);
52 
55  Vec3 getForce(int node) const;
56 
58  Vec3 getTotalForce() const;
59 
64  int getForce(size_t indx, Vec3& force) const;
65 
67  size_t size() const { return nodeMap.size(); }
68 
69 private:
70  const SAM& sam;
72  std::vector<int> nodeNum;
73  std::map<int,size_t> nodeMap;
74 };
75 
76 #endif
Abstract interface for classes representing integrated quantities.
Global algebraic operations on index 1-based matrices and vectors.
Class for storage of a global nodal force vector with assembly methods.
Definition: GlbForceVec.h:31
std::vector< int > nodeNum
Global node numbers with forces.
Definition: GlbForceVec.h:72
GlbForceVec(const SAM &_sam)
The constructor only sets its reference to the SAM object.
Definition: GlbForceVec.h:34
virtual ~GlbForceVec()
Empty destructor.
Definition: GlbForceVec.h:36
size_t size() const
Returns the size in terms of number of nodes with nodal forces.
Definition: GlbForceVec.h:67
std::map< int, size_t > nodeMap
Maps from global node number to force index.
Definition: GlbForceVec.h:73
Vec3 getTotalForce() const
Returns the sum of the nodal forces, i.e. total force.
Definition: GlbForceVec.C:111
const SAM & sam
Data for FE assembly management.
Definition: GlbForceVec.h:70
bool initNodeMap(const std::vector< int > &globalNodes, size_t nfc)
Initializes the global node map and allocates the force vector.
Definition: GlbForceVec.C:23
virtual bool assemble(const LocalIntegral *elmObj, int elmId)
Adds a set of element nodal forces into the global nodal forces.
Definition: GlbForceVec.C:51
virtual void initialize(char=0)
Initializes the global nodal force vector to zero.
Definition: GlbForceVec.C:45
virtual bool finalize(bool=false)
Finalizes the global nodal force vector after element assembly.
Definition: GlbForceVec.C:90
Matrix F
Global nodal forces.
Definition: GlbForceVec.h:71
Vec3 getForce(int node) const
Returns the global nodal force vector for a specified node.
Definition: GlbForceVec.C:97
Abstract base class representing a system level integrated quantity.
Definition: GlobalIntegral.h:29
Abstract base class representing an element level integrated quantity.
Definition: LocalIntegral.h:25
This class contains data and functions for the assembly of FE matrices.
Definition: SAM.h:39
Simple class for representing a point in 3D space.
Definition: Vec3.h:27