MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
rottrim.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/elec/rottrim.h,v 1.29 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 ROTTRIM_H
33 #define ROTTRIM_H
34 
35 #include "rotor.h"
36 #include "genel.h"
37 
38 /*
39  pRotor->iGetPrivDataIdx("Tz");
40  pRotor->iGetPrivDataIdx("Mx");
41  pRotor->iGetPrivDataIdx("My");
42  doublereal dRho = pRotor->dGetAirDensity(pRotor->GetXCurr());
43  doublereal dOmega = pRotor->dGetOmega();
44  doublereal dRadius = pRotor->dGetRadius();
45  doublereal dMu = pRotor->dGetMu();
46  doublereal dThrust = pRotor->dGetPrivData(iRotorTz)/d;
47  doublereal dRollMoment = pRotor->dGetPrivData(iRotorMx)/d;
48  doublereal dPitchMoment = pRotor->dGetPrivData(iRotorMy)/d;
49  pRotor->GetConnectedNodes(connectedNodes);
50 
51  dThrust, dRollMoment, dPitchMoment // from drives?
52  dRho // from AirProperties
53  dOmega // from kinematics
54  dRadius // constant
55  dMu // from drive?
56  */
57 
58 class RotorTrimBase : virtual public Elem, public Genel {
59 protected:
64 
67 
71 
76 
77 protected:
78  virtual void
79  GetData(doublereal &dThrust,
80  doublereal &dRollMoment,
81  doublereal &dPitchMoment,
82  doublereal &dRho,
83  doublereal &dOmega,
84  doublereal &dMu) const = 0;
85 
86 public:
87  RotorTrimBase(unsigned int uL,
88  const DofOwner* pDO,
89  const ScalarDifferentialNode* pNode1,
90  const ScalarDifferentialNode* pNode2,
91  const ScalarDifferentialNode* pNode3,
92  const DriveCaller* pDThrust,
93  const DriveCaller* pDRollMoment,
94  const DriveCaller* pDPitchMoment,
95  const doublereal& dG,
96  const doublereal& dp,
97  const doublereal& dT0,
98  const doublereal& dT1,
99  const doublereal& dK0,
100  const doublereal& dK1,
101  const DriveCaller *pTrigger,
102  flag fOut);
103 
104  virtual ~RotorTrimBase(void);
105 
106  virtual unsigned int iGetNumDof(void) const;
107 
108  /* Tipo di Genel */
109  virtual Genel::Type GetGenelType(void) const {
110  return Genel::ROTORTRIM;
111  };
112 
113  /* Dimensioni del workspace */
114  virtual void
115  WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
116 
117  /* assemblaggio jacobiano */
118  virtual VariableSubMatrixHandler&
120  doublereal dCoef,
121  const VectorHandler& /* XCurr */ ,
122  const VectorHandler& /* XPrimeCurr */ );
123 
124  /* assemblaggio residuo */
125  virtual SubVectorHandler&
126  AssRes(SubVectorHandler& WorkVec,
127  doublereal dCoef,
128  const VectorHandler& /* XCurr */ ,
129  const VectorHandler& /* XPrimeCurr */ );
130 
131  /* *******PER IL SOLUTORE PARALLELO******** */
132  /*
133  * Fornisce il tipo e la label dei nodi che sono connessi all'elemento
134  * utile per l'assemblaggio della matrice di connessione fra i dofs
135  */
136  virtual void
137  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
138  /* ************************************************ */
139 };
140 
141 class RotorTrim : virtual public Elem, public RotorTrimBase {
142 protected:
143  const Rotor* pRotor;
144 
145  virtual void
146  GetData(doublereal &dThrust,
147  doublereal &dRollMoment,
148  doublereal &dPitchMoment,
149  doublereal &dRho,
150  doublereal &dOmega,
151  doublereal &dMu) const;
152 
153 public:
154  RotorTrim(unsigned int uL,
155  const DofOwner* pDO,
156  const Rotor* pRot,
157  const ScalarDifferentialNode* pNode1,
158  const ScalarDifferentialNode* pNode2,
159  const ScalarDifferentialNode* pNode3,
160  const DriveCaller* pDThrust,
161  const DriveCaller* pDRollMoment,
162  const DriveCaller* pDPitchMoment,
163  const doublereal& dG,
164  const doublereal& dp,
165  const doublereal& dT0,
166  const doublereal& dT1,
167  const doublereal& dK0,
168  const doublereal& dK1,
169  const DriveCaller *pTrigger,
170  flag fOut);
171 
172  virtual ~RotorTrim(void);
173 
174  /* Scrive il contributo dell'elemento al file di restart */
175  virtual std::ostream& Restart(std::ostream& out) const;
176 
177  /* *******PER IL SOLUTORE PARALLELO******** */
178  /*
179  * Fornisce il tipo e la label dei nodi che sono connessi all'elemento
180  * utile per l'assemblaggio della matrice di connessione fra i dofs
181  */
182  virtual void
183  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
184  /* ************************************************ */
185 };
186 
187 class RotorTrimGeneric : virtual public Elem, public RotorTrimBase {
188 protected:
193 
194  virtual void
195  GetData(doublereal &dThrust,
196  doublereal &dRollMoment,
197  doublereal &dPitchMoment,
198  doublereal &dRho,
199  doublereal &dOmega,
200  doublereal &dMu) const;
201 
202 public:
203  RotorTrimGeneric(unsigned int uL,
204  const DofOwner* pDO,
205  const StructNode *pStrNode,
206  const DriveCaller *pThrust,
207  const DriveCaller *pRollMoment,
208  const DriveCaller *pPitchMoment,
209  const AirProperties *pAP,
211  const DriveCaller *pOmega,
212  const DriveCaller *pMu,
213  const ScalarDifferentialNode* pNode1,
214  const ScalarDifferentialNode* pNode2,
215  const ScalarDifferentialNode* pNode3,
216  const DriveCaller* pDThrust,
217  const DriveCaller* pDRollMoment,
218  const DriveCaller* pDPitchMoment,
219  const doublereal& dG,
220  const doublereal& dp,
221  const doublereal& dT0,
222  const doublereal& dT1,
223  const doublereal& dK0,
224  const doublereal& dK1,
225  const DriveCaller *pTrigger,
226  flag fOut);
227 
228  virtual ~RotorTrimGeneric(void);
229 
230  /* Scrive il contributo dell'elemento al file di restart */
231  virtual std::ostream& Restart(std::ostream& out) const;
232 };
233 
234 #endif // ROTTRIM_H
235 
DriveOwner PitchMoment
Definition: rottrim.h:190
virtual std::ostream & Restart(std::ostream &out) const
Definition: rottrim.cc:263
long int flag
Definition: mbdyn.h:43
virtual ~RotorTrimBase(void)
Definition: rottrim.cc:85
doublereal dC2
Definition: rottrim.h:70
doublereal dKappa1
Definition: rottrim.h:75
virtual unsigned int iGetNumDof(void) const
Definition: rottrim.cc:91
RotorTrimBase(unsigned int uL, const DofOwner *pDO, const ScalarDifferentialNode *pNode1, const ScalarDifferentialNode *pNode2, const ScalarDifferentialNode *pNode3, const DriveCaller *pDThrust, const DriveCaller *pDRollMoment, const DriveCaller *pDPitchMoment, const doublereal &dG, const doublereal &dp, const doublereal &dT0, const doublereal &dT1, const doublereal &dK0, const doublereal &dK1, const DriveCaller *pTrigger, flag fOut)
Definition: rottrim.cc:41
Type
Definition: genel.h:48
DriveOwner DThrust
Definition: rottrim.h:62
virtual ~RotorTrimGeneric(void)
Definition: rottrim.cc:334
doublereal dC
Definition: rottrim.h:69
virtual void GetData(doublereal &dThrust, doublereal &dRollMoment, doublereal &dPitchMoment, doublereal &dRho, doublereal &dOmega, doublereal &dMu) const =0
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &, const VectorHandler &)
Definition: rottrim.cc:106
doublereal dRadius
Definition: rottrim.h:60
virtual std::ostream & Restart(std::ostream &out) const
Definition: rottrim.cc:341
DriveOwner Omega
Definition: rottrim.h:192
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: rottrim.cc:98
virtual void GetData(doublereal &dThrust, doublereal &dRollMoment, doublereal &dPitchMoment, doublereal &dRho, doublereal &dOmega, doublereal &dMu) const
Definition: rottrim.cc:347
RotorTrimGeneric(unsigned int uL, const DofOwner *pDO, const StructNode *pStrNode, const DriveCaller *pThrust, const DriveCaller *pRollMoment, const DriveCaller *pPitchMoment, const AirProperties *pAP, doublereal dRadius, const DriveCaller *pOmega, const DriveCaller *pMu, const ScalarDifferentialNode *pNode1, const ScalarDifferentialNode *pNode2, const ScalarDifferentialNode *pNode3, const DriveCaller *pDThrust, const DriveCaller *pDRollMoment, const DriveCaller *pDPitchMoment, const doublereal &dG, const doublereal &dp, const doublereal &dT0, const doublereal &dT1, const doublereal &dK0, const doublereal &dK1, const DriveCaller *pTrigger, flag fOut)
Definition: rottrim.cc:295
DriveOwner Mu
Definition: rottrim.h:192
doublereal dTau1
Definition: rottrim.h:73
DriveOwner DPitchMoment
Definition: rottrim.h:62
DriveOwner Trigger
Definition: rottrim.h:63
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &, const VectorHandler &)
Definition: rottrim.cc:139
doublereal dTau0
Definition: rottrim.h:72
doublereal dGamma
Definition: rottrim.h:65
Definition: genel.h:45
virtual void GetData(doublereal &dThrust, doublereal &dRollMoment, doublereal &dPitchMoment, doublereal &dRho, doublereal &dOmega, doublereal &dMu) const
Definition: rottrim.cc:269
virtual Genel::Type GetGenelType(void) const
Definition: rottrim.h:109
DriveOwner RollMoment
Definition: rottrim.h:190
doublereal dP
Definition: rottrim.h:66
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: rottrim.cc:209
doublereal dP2
Definition: rottrim.h:68
Definition: elem.h:75
DriveOwner DRollMoment
Definition: rottrim.h:62
const Rotor * pRotor
Definition: rottrim.h:143
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: rottrim.cc:285
const StructNode * pStrNode
Definition: rottrim.h:189
DriveOwner Thrust
Definition: rottrim.h:190
RotorTrim(unsigned int uL, const DofOwner *pDO, const Rotor *pRot, const ScalarDifferentialNode *pNode1, const ScalarDifferentialNode *pNode2, const ScalarDifferentialNode *pNode3, const DriveCaller *pDThrust, const DriveCaller *pDRollMoment, const DriveCaller *pDPitchMoment, const doublereal &dG, const doublereal &dp, const doublereal &dT0, const doublereal &dT1, const doublereal &dK0, const doublereal &dK1, const DriveCaller *pTrigger, flag fOut)
Definition: rottrim.cc:221
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual ~RotorTrim(void)
Definition: rottrim.cc:256
const AirProperties * pAP
Definition: rottrim.h:191
doublereal dKappa0
Definition: rottrim.h:74
Definition: rotor.h:43
const ScalarDifferentialNode * pvNodes[3]
Definition: rottrim.h:61