MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
GRAALLDamperConstitutiveLaw Class Reference
Inheritance diagram for GRAALLDamperConstitutiveLaw:
Collaboration diagram for GRAALLDamperConstitutiveLaw:

Public Member Functions

 GRAALLDamperConstitutiveLaw (const DriveCaller *pDC, const doublereal &rla, const char *const filename)
 
virtual ~GRAALLDamperConstitutiveLaw (void)
 
ConstLawType::Type GetConstLawType (void) const
 
virtual ConstitutiveLaw
< doublereal, doublereal > * 
pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void Update (const doublereal &Eps, const doublereal &EpsPrime=0.)
 
- Public Member Functions inherited from ConstitutiveLaw< doublereal, doublereal >
 ConstitutiveLaw (void)
 
virtual ~ConstitutiveLaw (void)
 
virtual void AfterConvergence (const doublereal &Eps, const doublereal &EpsPrime=mb_zero< doublereal >())
 
virtual const doublerealGetEpsilon (void) const
 
virtual const doublerealGetEpsilonPrime (void) const
 
virtual const doublerealGetF (void) const
 
virtual const doublerealGetFDE (void) const
 
virtual const doublerealGetFDEPrime (void) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 

Private Types

enum  {
  RLA = 1, PNTR = 2, P0 = 3, A0 = 4,
  RL0 = 5, PLTREX = 6, TCOST = 7, TLIN = 8,
  TEMPORIF = 9, VELRIF = 10, CORONA = 11, TRIFVUOTO = 12,
  T = 13, TRIFTEMP = 14, RNURIF = 15, ASTNT = 16,
  R0 = 17, TIME = 18
}
 

Private Attributes

doublereal v [TIME]
 
integer NPDMR
 
integer NPDMA
 
integer NPCVR
 
integer NPCVA
 
integer NPVT
 
doublerealTBDMR
 
doublerealTBDMA
 
doublerealTBCVR
 
doublerealTBCVA
 
doublerealVETVIS
 
doublereal dT0
 
DriveOwner Time
 
flag fWorking
 

Additional Inherited Members

- Public Types inherited from ConstitutiveLaw< doublereal, doublereal >
typedef ConstitutiveLaw
< doublereal, doublereal >
::ErrNotAvailable 
Err
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Protected Attributes inherited from ConstitutiveLaw< doublereal, doublereal >
doublereal Epsilon
 
doublereal EpsilonPrime
 
doublereal F
 
doublereal FDE
 
doublereal FDEPrime
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Detailed Description

Definition at line 63 of file module-damper-graall.cc.

Member Enumeration Documentation

anonymous enum
private
Enumerator
RLA 
PNTR 
P0 
A0 
RL0 
PLTREX 
TCOST 
TLIN 
TEMPORIF 
VELRIF 
CORONA 
TRIFVUOTO 
TRIFTEMP 
RNURIF 
ASTNT 
R0 
TIME 

Definition at line 66 of file module-damper-graall.cc.

66  {
67  RLA = 1,
68  PNTR = 2,
69  P0 = 3,
70  A0 = 4,
71  RL0 = 5,
72  PLTREX = 6,
73  TCOST = 7,
74  TLIN = 8,
75  TEMPORIF = 9,
76  VELRIF = 10,
77  CORONA = 11,
78  TRIFVUOTO = 12,
79  T = 13,
80  TRIFTEMP = 14,
81  RNURIF = 15,
82  ASTNT = 16,
83  R0 = 17,
84  TIME = 18
85  };

Constructor & Destructor Documentation

GRAALLDamperConstitutiveLaw::GRAALLDamperConstitutiveLaw ( const DriveCaller pDC,
const doublereal rla,
const char *const  filename 
)
inline

Definition at line 130 of file module-damper-graall.cc.

References A0, ASTNT, CORONA, DEBUGLCOUT, DriveOwner::dGet(), MYDEBUG_INPUT, NPCVA, NPCVR, NPDMA, NPDMR, NPVT, P0, PLTREX, PNTR, R0, RL0, RLA, RNURIF, SAFENEWARR, T, TBCVA, TBCVR, TBDMA, TBDMR, TCOST, TEMPORIF, TIME, Time, TLIN, TRIFTEMP, TRIFVUOTO, v, VELRIF, and VETVIS.

134  NPDMR(0), NPDMA(0), NPCVR(0), NPCVA(0), NPVT(0),
135  TBDMR(NULL), TBDMA(NULL), TBCVR(NULL), TBCVA(NULL), VETVIS(NULL),
136  dT0(0.), Time(pDC), fWorking(0)
137  {
138  char s[1024];
139 
140  /* Si assume che il drive che viene passato sia in realta'
141  * un drive di tipo Time, che verra' usato per conoscere
142  * il tempo della simulazione */
143 
144  /* apre il file di ingresso in formato graal */
145  std::ifstream in(filename);
146 
147  /* legge alcuni parametri */
148  in.getline(s, sizeof(s));
149  DEBUGLCOUT(MYDEBUG_INPUT, "Skipping ... (remark: \"" << s
150  << "\")" << std::endl);
151 
152  in >> v[P0-1];
153  in.getline(s, sizeof(s));
154  DEBUGLCOUT(MYDEBUG_INPUT, "Reading P0 (=" << v[P0-1]
155  << ", remark: \"" << s << "\")" << std::endl);
156 
157  in >> v[A0-1];
158  in.getline(s, sizeof(s));
159  DEBUGLCOUT(MYDEBUG_INPUT, "Reading A0 (=" << v[A0-1]
160  << ", remark: \"" << s << "\")" << std::endl);
161 
162  in >> v[PNTR-1];
163  in.getline(s, sizeof(s));
164  DEBUGLCOUT(MYDEBUG_INPUT, "Reading PNTR (=" << v[PNTR-1]
165  << ", remark: \"" << s << "\")" << std::endl);
166 
167  in >> v[RL0-1];
168  in.getline(s, sizeof(s));
169  DEBUGLCOUT(MYDEBUG_INPUT, "Reading RL0 (=" << v[RL0-1]
170  << ", remark: \"" << s << "\")" << std::endl);
171 
172  in >> v[PLTREX-1];
173  in.getline(s, sizeof(s));
174  DEBUGLCOUT(MYDEBUG_INPUT, "Reading PLTREX (=" << v[PLTREX-1]
175  << ", remark: \"" << s << "\")" << std::endl);
176 
177  in.getline(s, sizeof(s));
178  DEBUGLCOUT(MYDEBUG_INPUT, "Skipping ... (remark: \"" << s
179  << "\")" << std::endl);
180 
181  in >> v[ASTNT-1];
182  in.getline(s, sizeof(s));
183  DEBUGLCOUT(MYDEBUG_INPUT, "Reading ASTNT (=" << v[ASTNT-1]
184  << ", remark: \"" << s << "\")" << std::endl);
185 
186  in >> v[R0-1];
187  in.getline(s, sizeof(s));
188  DEBUGLCOUT(MYDEBUG_INPUT, "Reading R0 (=" << v[R0-1]
189  << ", remark: \"" << s << "\")" << std::endl);
190 
191  in >> v[TCOST-1];
192  in.getline(s, sizeof(s));
193  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TCOST (=" << v[TCOST-1]
194  << ", remark: \"" << s << "\")" << std::endl);
195 
196  in >> v[TLIN-1];
197  in.getline(s, sizeof(s));
198  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TLIN (=" << v[TLIN-1]
199  << ", remark: \"" << s << "\")" << std::endl);
200 
201  in >> v[TEMPORIF-1];
202  in.getline(s, sizeof(s));
203  DEBUGLCOUT(MYDEBUG_INPUT, "Reading A0 (=" << v[TEMPORIF-1]
204  << ", remark: \"" << s << "\")" << std::endl);
205 
206  in >> v[VELRIF-1];
207  in.getline(s, sizeof(s));
208  DEBUGLCOUT(MYDEBUG_INPUT, "Reading VELRIF (=" << v[VELRIF-1]
209  << ", remark: \"" << s << "\")" << std::endl);
210 
211  in >> v[CORONA-1];
212  in.getline(s, sizeof(s));
213  DEBUGLCOUT(MYDEBUG_INPUT, "Reading CORONA (=" << v[CORONA-1]
214  << ", remark: \"" << s << "\")" << std::endl);
215 
216  in >> v[TRIFVUOTO-1];
217  in.getline(s, sizeof(s));
218  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TRIFVUOTO (=" << v[TRIFVUOTO-1]
219  << ", remark: \"" << s << "\")" << std::endl);
220 
221  in >> v[RNURIF-1];
222  in.getline(s, sizeof(s));
223  DEBUGLCOUT(MYDEBUG_INPUT, "Reading RNURIF (=" << v[RNURIF-1]
224  << ", remark: \"" << s << "\")" << std::endl);
225 
226  in >> v[TRIFTEMP-1];
227  in.getline(s, sizeof(s));
228  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TRIFTEMP (=" << v[TRIFTEMP-1]
229  << ", remark: \"" << s << "\")" << std::endl);
230 
231  /* legge le tabelle */
232 
233  /* legge TBDMR */
234  in.getline(s, sizeof(s));
235  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBDMR (remark: \"" << s
236  << "\")" << std::endl);
237 
238  in >> NPDMR;
239  in.getline(s, sizeof(s));
240  DEBUGLCOUT(MYDEBUG_INPUT, "NPDMR=" << NPDMR
241  << " (remark: \"" << s << "\")" << std::endl);
242 
243  SAFENEWARR(TBDMR, doublereal, 2*NPDMR);
244 
245  for (integer i = 0; i < NPDMR; i++) {
246  in >> TBDMR[i];
247  in >> TBDMR[NPDMR+i];
248  in.getline(s, sizeof(s));
249  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBDMR[" << i+1
250  << "]=(" << TBDMR[i]
251  << "," << TBDMR[NPDMR+i]
252  << ") (remark: \"" << s << "\")" << std::endl);
253  }
254 
255  /* legge TBDMA */
256  in.getline(s, sizeof(s));
257  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBDMA (remark: \"" << s
258  << "\")" << std::endl);
259 
260  in >> NPDMA;
261  in.getline(s, sizeof(s));
262  DEBUGLCOUT(MYDEBUG_INPUT, "NPDMA=" << NPDMA
263  << " (remark: \"" << s << "\")" << std::endl);
264 
265  SAFENEWARR(TBDMA, doublereal, 2*NPDMA);
266 
267  for (integer i = 0; i < NPDMA; i++) {
268  in >> TBDMA[i];
269  in >> TBDMA[NPDMA+i];
270  in.getline(s, sizeof(s));
271  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBDMA[" << i+1
272  << "]=(" << TBDMA[i]
273  << "," << TBDMA[NPDMA+i]
274  << ") (remark: \"" << s << "\")" << std::endl);
275  }
276 
277  /* legge TBCVR */
278  in.getline(s, sizeof(s));
279  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBCVR (remark: \"" << s
280  << "\")" << std::endl);
281 
282  in >> NPCVR;
283  in.getline(s, sizeof(s));
284  DEBUGLCOUT(MYDEBUG_INPUT, "NPCVR=" << NPCVR
285  << " (remark: \"" << s << "\")" << std::endl);
286 
287  SAFENEWARR(TBCVR, doublereal, 2*NPCVR);
288 
289  for (integer i = 0; i < NPCVR; i++) {
290  in >> TBCVR[i];
291  in >> TBCVR[NPCVR+i];
292  in.getline(s, sizeof(s));
293  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBCVR[" << i+1
294  << "]=(" << TBCVR[i]
295  << "," << TBCVR[NPCVR+i]
296  << ") (remark: \"" << s << "\")" << std::endl);
297  }
298 
299  /* legge TBCVA */
300  in.getline(s, sizeof(s));
301  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBCVA (remark: \"" << s
302  << "\")" << std::endl);
303 
304  in >> NPCVA;
305  in.getline(s, sizeof(s));
306  DEBUGLCOUT(MYDEBUG_INPUT, "NPCVA=" << NPCVA
307  << " (remark: \"" << s << "\")" << std::endl);
308 
309  SAFENEWARR(TBCVA, doublereal, 2*NPCVA);
310 
311  for (integer i = 0; i < NPCVA; i++) {
312  in >> TBCVA[i];
313  in >> TBCVA[NPCVA+i];
314  in.getline(s, sizeof(s));
315  DEBUGLCOUT(MYDEBUG_INPUT, "Reading TBCVA[" << i+1
316  << "]=(" << TBCVA[i]
317  << "," << TBCVA[NPCVA+i]
318  << ") (remark: \"" << s << "\")" << std::endl);
319  }
320 
321  /* legge VETVIS */
322  in.getline(s, sizeof(s));
323  DEBUGLCOUT(MYDEBUG_INPUT, "Reading VETVIS (remark: \"" << s
324  << "\")" << std::endl);
325 
326  in >> NPVT;
327  in.getline(s, sizeof(s));
328  DEBUGLCOUT(MYDEBUG_INPUT, "NPVT=" << NPVT
329  << " (remark: \"" << s << "\")" << std::endl);
330 
331  SAFENEWARR(VETVIS, doublereal, 2*NPVT);
332 
333  for (integer i = 0; i < NPVT; i++) {
334  in >> VETVIS[i];
335  in >> VETVIS[NPVT+i];
336  in.getline(s, sizeof(s));
337  DEBUGLCOUT(MYDEBUG_INPUT, "Reading VETVIS[" << i+1
338  << "]=(" << VETVIS[i]
339  << "," << VETVIS[NPVT+i]
340  << ") (remark: \"" << s << "\")" << std::endl);
341  }
342 
343  /* fine */
344  in.close();
345 
346  /* Inizializza altri dati */
347  v[RLA-1] = rla; // passato come argomento, per ora
348  v[T-1] = 273.16; // T assoluta ?!?
349  v[TIME-1] = Time.dGet();
350  };
static char * filename
Definition: ann_sf.c:71
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
#define DEBUGLCOUT(level, msg)
Definition: myassert.h:244

Here is the call graph for this function:

virtual GRAALLDamperConstitutiveLaw::~GRAALLDamperConstitutiveLaw ( void  )
inlinevirtual

Member Function Documentation

ConstLawType::Type GRAALLDamperConstitutiveLaw::GetConstLawType ( void  ) const
inlinevirtual
virtual ConstitutiveLaw<doublereal, doublereal>* GRAALLDamperConstitutiveLaw::pCopy ( void  ) const
inlinevirtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 364 of file module-damper-graall.cc.

364  {
365  return 0;
366  };
virtual std::ostream& GRAALLDamperConstitutiveLaw::Restart ( std::ostream &  out) const
inlinevirtual

Reimplemented from ConstitutiveLaw< doublereal, doublereal >.

Definition at line 368 of file module-damper-graall.cc.

368  {
369  return out << "GRAALLDamperConstitutiveLaw not implemented yet!" << std::endl;
370  };
virtual void GRAALLDamperConstitutiveLaw::Update ( const doublereal Eps,
const doublereal EpsPrime = 0. 
)
inlinevirtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 372 of file module-damper-graall.cc.

References DriveOwner::dGet(), dmpfr(), dT0, ConstitutiveLaw< doublereal, doublereal >::Epsilon, ConstitutiveLaw< doublereal, doublereal >::EpsilonPrime, ConstitutiveLaw< doublereal, doublereal >::F, grad::fabs(), ConstitutiveLaw< doublereal, doublereal >::FDE, ConstitutiveLaw< doublereal, doublereal >::FDEPrime, fWorking, NPCVA, NPCVR, NPDMA, NPDMR, NPVT, RLA, TBCVA, TBCVR, TBDMA, TBDMR, TIME, Time, v, and VETVIS.

372  {
373  Epsilon = Eps;
374  EpsilonPrime = EpsPrime;
375 
376  /* se non e' attivo, esegue un test sulla velocita' relativa;
377  * se si sta muovendo, allora setta il flag di stato su attivo,
378  * e calcola il tempo di inizio */
379  if (fWorking == 0) {
380  if (fabs(EpsPrime) < 1.e-6) {
381  F = 0.;
382  FDE = 0.;
383  FDEPrime = 0.;
384  return;
385  } else {
386  fWorking = 1;
387  dT0 = Time.dGet();
388  }
389  }
390 
391  v[TIME-1] = Time.dGet() - dT0;
392 
393  doublereal E = Epsilon*v[RLA-1];
394  doublereal EP = EpsilonPrime*v[RLA-1];
395 
396  __FC_DECL__(dmpfr) (
397  &E,
398  &EP,
399  v,
400  TBDMR,
401  TBDMA,
402  TBCVR,
403  TBCVA,
404  VETVIS,
405  &NPDMR,
406  &NPDMA,
407  &NPCVR,
408  &NPCVA,
409  &NPVT,
410  &F,
411  &FDE,
412  &FDEPrime);
413  };
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
int __FC_DECL__() dmpfr(doublereal *DL, doublereal *DLDT, doublereal *V, doublereal *TBDMR, doublereal *TBDMA, doublereal *TBCVR, doublereal *TBCVA, doublereal *VETVIS, integer *NPDMR, integer *NPDMA, integer *NPCVR, integer *NPCVA, integer *NPVT, doublereal *FTOT, doublereal *FVISDL, doublereal *FELDL)
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

Member Data Documentation

doublereal GRAALLDamperConstitutiveLaw::dT0
private

Definition at line 125 of file module-damper-graall.cc.

Referenced by Update().

flag GRAALLDamperConstitutiveLaw::fWorking
private

Definition at line 127 of file module-damper-graall.cc.

Referenced by Update().

integer GRAALLDamperConstitutiveLaw::NPCVA
private

Definition at line 118 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

integer GRAALLDamperConstitutiveLaw::NPCVR
private

Definition at line 118 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

integer GRAALLDamperConstitutiveLaw::NPDMA
private

Definition at line 118 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

integer GRAALLDamperConstitutiveLaw::NPDMR
private

Definition at line 118 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

integer GRAALLDamperConstitutiveLaw::NPVT
private

Definition at line 118 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

doublereal* GRAALLDamperConstitutiveLaw::TBCVA
private
doublereal* GRAALLDamperConstitutiveLaw::TBCVR
private
doublereal* GRAALLDamperConstitutiveLaw::TBDMA
private
doublereal* GRAALLDamperConstitutiveLaw::TBDMR
private
DriveOwner GRAALLDamperConstitutiveLaw::Time
private

Definition at line 126 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

doublereal GRAALLDamperConstitutiveLaw::v[TIME]
private

Definition at line 87 of file module-damper-graall.cc.

Referenced by GRAALLDamperConstitutiveLaw(), and Update().

doublereal* GRAALLDamperConstitutiveLaw::VETVIS
private

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