MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
accelerometer.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/elec/accelerometer.h,v 1.28 2017/01/12 14:46:22 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 ACCELEROMETER_H
33 #define ACCELEROMETER_H
34 
35 #include "elec.h"
36 
37 /* Accelerometer - begin */
38 
39 class Accelerometer : virtual public Elem, public Electric {
40 private:
42  const ScalarDifferentialNode* pAbsNode; /* TODO: check if relaxable to ScalarNode */
48 
49 public:
50  Accelerometer(unsigned int uL, const DofOwner* pD,
51  const StructNode* pS,
52  const ScalarDifferentialNode* pA,
53  const Vec3& TmpDir,
54  doublereal dO, doublereal dT,
55  doublereal dC, doublereal dK,
56  flag fOut);
57  ~Accelerometer(void);
58 
59  virtual Electric::Type GetElectricType(void) const {
61  };
62 
63  /* Contributo al file di restart */
64  virtual std::ostream& Restart(std::ostream& out) const;
65 
66  virtual unsigned int iGetNumDof(void) const;
67  virtual DofOrder::Order GetDofType(unsigned int i) const;
68 
69  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
70 
73  doublereal dCoef,
74  const VectorHandler& XCurr,
75  const VectorHandler& XPrimeCurr);
77  AssRes(SubVectorHandler& WorkVec,
78  doublereal dCoef,
79  const VectorHandler& XCurr,
80  const VectorHandler& XPrimeCurr);
81 
82  virtual void SetInitialValue(VectorHandler& /* X */ );
83  virtual void SetValue(DataManager *pDM,
84  VectorHandler& X, VectorHandler& /* XP */ ,
85  SimulationEntity::Hints *ph = 0);
86 
87  /* *******PER IL SOLUTORE PARALLELO******** */
88  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
89  * utile per l'assemblaggio della matrice di connessione fra i dofs */
90  virtual void
91  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
92  connectedNodes.resize(2);
93  connectedNodes[0] = pStrNode;
94  connectedNodes[1] = pAbsNode;
95  };
96  /* ************************************************ */
97 };
98 
99 /* Accelerometer - end */
100 
101 
102 /* TranslAccel - begin */
103 
104 class TranslAccel : virtual public Elem, public Electric {
105 private:
107  const ScalarDifferentialNode* pAbsNode; /* TODO: check if relaxable to ScalarNode */
110 
111 public:
112  TranslAccel(unsigned int uL, const DofOwner* pD,
113  const StructNode* pS, const ScalarDifferentialNode* pA,
114  const Vec3& TmpDir, const Vec3& Tmpf,
115  flag fOut);
116  ~TranslAccel(void);
117 
118  virtual Electric::Type GetElectricType(void) const {
120  };
121 
122  /* Contributo al file di restart */
123  virtual std::ostream& Restart(std::ostream& out) const;
124 
125  virtual unsigned int iGetNumDof(void) const;
126  virtual DofOrder::Order GetDofType(unsigned int i) const;
127 
128  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
129 
132  doublereal dCoef,
133  const VectorHandler& XCurr,
134  const VectorHandler& XPrimeCurr);
136  AssRes(SubVectorHandler& WorkVec,
137  doublereal dCoef,
138  const VectorHandler& XCurr,
139  const VectorHandler& XPrimeCurr);
140 
141  virtual void SetInitialValue(VectorHandler& /* X */ );
142  virtual void SetValue(DataManager *pDM,
143  VectorHandler& X, VectorHandler& /* XP */ ,
144  SimulationEntity::Hints *ph = 0);
145 
146  /* *******PER IL SOLUTORE PARALLELO******** */
147  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
148  * utile per l'assemblaggio della matrice di connessione fra i dofs */
149  virtual void
150  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
151  connectedNodes.resize(2);
152  connectedNodes[0] = pStrNode;
153  connectedNodes[1] = pAbsNode;
154  };
155  /* ************************************************ */
156 };
157 
158 /* TranslAccel - end */
159 
160 
161 /* RotAccel - begin */
162 
163 class RotAccel : virtual public Elem, public Electric {
164 private:
166  const ScalarDifferentialNode* pAbsNode; /* TODO: check if relaxable to ScalarNode */
168 
169 public:
170  RotAccel(unsigned int uL, const DofOwner* pD,
171  const StructNode* pS, const ScalarDifferentialNode* pA,
172  const Vec3& TmpDir,
173  flag fOut);
174  ~RotAccel(void);
175 
176  virtual Electric::Type GetElectricType(void) const {
178  };
179 
180  /* Contributo al file di restart */
181  virtual std::ostream& Restart(std::ostream& out) const;
182 
183  virtual unsigned int iGetNumDof(void) const;
184  virtual DofOrder::Order GetDofType(unsigned int i) const;
185 
186  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
187 
190  doublereal dCoef,
191  const VectorHandler& XCurr,
192  const VectorHandler& XPrimeCurr);
194  AssRes(SubVectorHandler& WorkVec,
195  doublereal dCoef,
196  const VectorHandler& XCurr,
197  const VectorHandler& XPrimeCurr);
198 
199  virtual void SetInitialValue(VectorHandler& /* X */ );
200  virtual void SetValue(DataManager *pDM,
201  VectorHandler& X, VectorHandler& /* XP */ ,
202  SimulationEntity::Hints *ph = 0);
203 
204  /* *******PER IL SOLUTORE PARALLELO******** */
205  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
206  * utile per l'assemblaggio della matrice di connessione fra i dofs */
207  virtual void
208  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const {
209  connectedNodes.resize(2);
210  connectedNodes[0] = pStrNode;
211  connectedNodes[1] = pAbsNode;
212  };
213  /* ************************************************ */
214 };
215 
216 /* RotAccel - end */
217 
218 #endif /* ACCELEROMETER_H */
219 
doublereal dOmega
Definition: accelerometer.h:44
virtual unsigned int iGetNumDof(void) const
doublereal dKappa
Definition: accelerometer.h:47
const ScalarDifferentialNode * pAbsNode
virtual unsigned int iGetNumDof(void) const
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: accelerometer.h:91
long int flag
Definition: mbdyn.h:43
Definition: matvec3.h:98
virtual Electric::Type GetElectricType(void) const
Definition: accelerometer.h:59
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
const StructNode * pStrNode
Definition: accelerometer.h:41
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual void SetInitialValue(VectorHandler &)
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &, SimulationEntity::Hints *ph=0)
virtual void SetInitialValue(VectorHandler &)
doublereal dCsi
Definition: accelerometer.h:46
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &, SimulationEntity::Hints *ph=0)
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
const StructNode * pStrNode
virtual Electric::Type GetElectricType(void) const
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &, SimulationEntity::Hints *ph=0)
~TranslAccel(void)
~Accelerometer(void)
virtual void SetInitialValue(VectorHandler &)
virtual DofOrder::Order GetDofType(unsigned int i) const
virtual Electric::Type GetElectricType(void) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: elec.h:43
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
TranslAccel(unsigned int uL, const DofOwner *pD, const StructNode *pS, const ScalarDifferentialNode *pA, const Vec3 &TmpDir, const Vec3 &Tmpf, flag fOut)
virtual DofOrder::Order GetDofType(unsigned int i) const
Type
Definition: elec.h:46
const ScalarDifferentialNode * pAbsNode
virtual std::ostream & Restart(std::ostream &out) const
RotAccel(unsigned int uL, const DofOwner *pD, const StructNode *pS, const ScalarDifferentialNode *pA, const Vec3 &TmpDir, flag fOut)
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: elem.h:75
doublereal dTau
Definition: accelerometer.h:45
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
const StructNode * pStrNode
const ScalarDifferentialNode * pAbsNode
Definition: accelerometer.h:42
~RotAccel(void)
virtual std::ostream & Restart(std::ostream &out) const
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Accelerometer(unsigned int uL, const DofOwner *pD, const StructNode *pS, const ScalarDifferentialNode *pA, const Vec3 &TmpDir, doublereal dO, doublereal dT, doublereal dC, doublereal dK, flag fOut)
virtual std::ostream & Restart(std::ostream &out) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual unsigned int iGetNumDof(void) const
virtual DofOrder::Order GetDofType(unsigned int i) const