MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
resforces.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/resforces.h,v 1.20 2017/01/12 14:46:10 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 #ifndef RESFORCES_H
33 #define RESFORCES_H
34 
35 #include <cfloat>
36 #include <iostream>
37 
38 #include <set>
39 #include "strnode.h"
40 
41 /* ResForces - begin */
42 
43 class ResForces {
44 protected:
47 
48 public:
49  ResForces(void);
50  virtual ~ResForces(void);
51 
52  virtual void Reset(void);
53  void AddForce(const Vec3& f);
54  void AddForce(const Vec3& f, Vec3& x);
55  void AddMoment(const Vec3& c);
56  void AddForces(const Vec3& f, const Vec3& c, const Vec3& x);
57  void PutForce(const Vec3& f);
58  void PutMoment(const Vec3& c);
59  void PutForces(const Vec3& f, const Vec3& c);
60 
61  virtual const Vec3& Force(void) const;
62  virtual const Vec3& Moment(void) const;
63  virtual const Vec3& Pole(void) const = 0;
64 };
65 
66 class ExternResForces : public ResForces {
67 protected:
69 
70 public:
71  ExternResForces(void);
72  virtual ~ExternResForces(void);
73 
74  void Reset(void);
75  void Reset(const Vec3& x);
76  void PutPole(const Vec3& x);
77 
78  const Vec3& Pole(void) const;
79 };
80 
81 class NodeResForces : public ResForces {
82 protected:
83  const StructNode *pNode;
84 
85 public:
86  NodeResForces(const StructNode *n = 0);
87  virtual ~NodeResForces(void);
88 
89  const Vec3& Pole(void) const;
90 };
91 
93 protected:
94  mutable Vec3 Fr;
95  mutable Vec3 Cr;
96 
97 public:
98  LocalNodeResForces(const StructNode *n = 0);
99  virtual ~LocalNodeResForces(void);
100 
101  const Vec3& Force(void) const;
102  const Vec3& Moment(void) const;
103 };
104 
105 struct ResForceSet : public WithLabel {
107  std::set<unsigned int> labelSet;
108 
109  ResForceSet(unsigned int uLabel, ResForces *p);
110  virtual ~ResForceSet(void);
111  bool is_in(unsigned int uL);
112 };
113 
114 /* ResForces - end */
115 
116 extern ResForceSet *
117 ReadResSet(DataManager* pDM, MBDynParser& HP, unsigned int uL);
118 extern ResForceSet **
120 
121 #endif /* RESFORCES_H */
122 
void PutForces(const Vec3 &f, const Vec3 &c)
Definition: resforces.cc:96
ResForces * pRes
Definition: resforces.h:106
void PutMoment(const Vec3 &c)
Definition: resforces.cc:90
const Vec3 & Force(void) const
Definition: resforces.cc:180
Definition: matvec3.h:98
virtual ~ResForceSet(void)
Definition: resforces.cc:197
void Reset(void)
Definition: resforces.cc:126
NodeResForces(const StructNode *n=0)
Definition: resforces.cc:150
virtual const Vec3 & Force(void) const
Definition: resforces.cc:103
ResForces(void)
Definition: resforces.cc:39
const Vec3 & Pole(void) const
Definition: resforces.cc:145
ResForceSet * ReadResSet(DataManager *pDM, MBDynParser &HP, unsigned int uL)
Definition: resforces.cc:209
virtual const Vec3 & Moment(void) const
Definition: resforces.cc:109
const Vec3 & Pole(void) const
Definition: resforces.cc:162
bool is_in(unsigned int uL)
Definition: resforces.cc:203
LocalNodeResForces(const StructNode *n=0)
Definition: resforces.cc:168
std::set< unsigned int > labelSet
Definition: resforces.h:107
void AddForces(const Vec3 &f, const Vec3 &c, const Vec3 &x)
Definition: resforces.cc:77
virtual const Vec3 & Pole(void) const =0
const Vec3 & Moment(void) const
Definition: resforces.cc:186
ResForceSet(unsigned int uLabel, ResForces *p)
Definition: resforces.cc:191
unsigned int uLabel
Definition: withlab.h:44
void PutPole(const Vec3 &x)
Definition: resforces.cc:139
virtual ~LocalNodeResForces(void)
Definition: resforces.cc:174
Vec3 C
Definition: resforces.h:46
virtual ~ResForces(void)
Definition: resforces.cc:45
static std::stack< cleanup * > c
Definition: cleanup.cc:59
Vec3 F
Definition: resforces.h:45
void AddForce(const Vec3 &f)
Definition: resforces.cc:58
virtual ~ExternResForces(void)
Definition: resforces.cc:120
ExternResForces(void)
Definition: resforces.cc:114
void PutForce(const Vec3 &f)
Definition: resforces.cc:84
const StructNode * pNode
Definition: resforces.h:83
virtual ~NodeResForces(void)
Definition: resforces.cc:156
ResForceSet ** ReadResSets(DataManager *pDM, MBDynParser &HP)
Definition: resforces.cc:263
virtual void Reset(void)
Definition: resforces.cc:51
void AddMoment(const Vec3 &c)
Definition: resforces.cc:71