MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
dataman.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/dataman.h,v 1.202 2017/09/09 09:20:12 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 /* gestore dei dati */
33 
34 #ifndef DATAMAN_H
35 #define DATAMAN_H
36 
37 #include <iostream>
38 #include <list>
39 #include <map>
40 #include <string>
41 
42 #include "myassert.h"
43 #include "mynewmem.h"
44 #include "except.h"
45 #include "demangle.h"
46 
47 #include "mbpar.h"
48 #include "constltp.h"
49 #include "shape.h"
50 
51 /* da elman.h */
52 #include "solman.h"
53 #include "submat.h"
54 #include "veciter.h"
55 
56 #include "elem.h" /* Classe di base di tutti gli elementi */
57 #include "driven.h"
58 #include "output.h"
59 
60 #include "drive.h" /* Drive vari */
61 #include "tpldrive.h" /* Drive vari */
62 
63 /* da nodeman.h */
64 #include "node.h"
65 #include "strnode.h"
66 #include "elecnode.h"
67 
68 #include "solverdiagnostics.h"
69 #include "nonlin.h"
70 #include "linsol.h"
71 #include "converged.h"
72 #include "invdyn.h"
73 
74 #ifdef USE_SOCKET
75 #include "usesock.h"
76 #endif // USE_SOCKET
77 
78 struct LoadableCalls;
79 class Solver;
80 
81 #include "datamanforward.h"
82 
83 /* DataManager - begin */
84 
86  public DataManagerErrors {
87 
88 protected:
89  void **ppCleanupData;
90 
91 #ifdef USE_MULTITHREAD
92  /* from input file, or auto-detected */
93  unsigned int nThreads;
94 #endif /* USE_MULTITHREAD */
95 
96  /* Handler vari */
97  MBDynParser& MBPar; /* Received from Solver */
98  MathParser& MathPar; /* Received from Solver */
100 
101  /* loadable elements */
102  std::map<std::string, const LoadableCalls *> MapOfLoadableElemHandlers;
103 
106 
107  /* Puntatori ai vettori soluzione durante il passo */
110 
111  /* used by inverse dynamics: */
114 
115  /* Parametri usati durante l'assemblaggio iniziale */
128 
131 
132  // inverse dynamics
136 
137 #ifdef USE_RUNTIME_LOADING
138  bool moduleInitialized;
139 #endif // USE_RUNTIME_LOADING
140 
141  enum PrintFlags {
142  PRINT_NONE = 0x00U,
143 
145 
149 
153 
154  PRINT_TO_FILE = 0x1000U
155  };
156  unsigned uPrintFlags;
157  /* Parametri vari */
159 
160 public:
162 protected:
163  /* soft-restart stuff */
167 
171 
174 
175  bool saveXSol;
177 
178  /* raw output stuff */
181 
182 #ifdef MBDYN_FDJAC
183 protected:
184  DriveCaller *pFDJacMeter;
185 
186 public:
187  bool bFDJac(void) const;
188 #endif // MBDYN_FDJAC
189 
190  /* specialized output stuff */
191 public:
192  enum ResType {
193  RES_NONE = 0x00,
194  RES_TEXT = 0x01,
195  RES_NETCDF = 0x02,
196  };
197 
198  bool bOutput(ResType t) const;
199 
200 protected:
201  int ResMode;
202 
203 #ifdef USE_NETCDF
204  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
205  /* NetCDF stuff */
206  bool bNetCDFsync;
207  bool bNetCDFnoText;
208  NcVar *Var_Step;
209  NcVar *Var_Time;
210  NcVar *Var_TimeStep;
211 
212  /* for eigenanalysis output */
213 
214  const NcDim *m_Dim_Eig_iSize;
215  const NcDim *m_Dim_Eig_iComplex;
216 
217  NcVar *Var_Eig_lStep;
218  NcVar *Var_Eig_dTime;
219  NcVar *Var_Eig_dCoef;
220  NcVar *Var_Eig_dAplus;
221  NcVar *Var_Eig_dAminus;
222  NcVar *Var_Eig_dAlpha;
223  NcVar *Var_Eig_Idx;
224  NcVar *Var_Eig_dVR;
225  NcVar *Var_Eig_dVL;
226 
227  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
228 #endif /* USE_NETCDF */
230 
231 protected:
232  /* chiamate dal costruttore per leggere i relativi articoli */
233  void ReadControl(MBDynParser& HP, const char* sInputFileName);
234  void ReadNodes(MBDynParser& HP);
235  void ReadDrivers(MBDynParser& HP);
236  void ReadElems(MBDynParser& HP);
237 
238  template <class T> T* Cast(Elem *pEl, bool bActive = false);
239 
240 public:
241  template <class T>
242  flag fReadOutput(MBDynParser& HP, const T& t) const;
243  doublereal dReadScale(MBDynParser& HP, enum DofOwner::Type t) const;
244 
245  bool bOutputAccelerations(void) const;
246  bool bOutputDriveCallers(void) const;
247  const doublereal& dGetInitialPositionStiffness(void) const;
248  const doublereal& dGetInitialVelocityStiffness(void) const;
249  bool bDoesOmegaRotate(void) const;
250 
251  void IncElemCount(Elem::Type type);
252 
253  /* additional CPU time, if any */
254  virtual clock_t GetCPUTime(void) const {
255  return 0;
256  };
257 
258 protected:
259  /* chiamate a funzioni di inizializzazione */
260  void InitialJointAssembly(void);
261 
262  void DofOwnerSet(void);
263  void DofOwnerInit(void);
264 
265  /* inverse dynamics: */
266  void IDDofOwnerSet(void);
267 
268 public:
269  /* costruttore - legge i dati e costruisce le relative strutture */
271  unsigned OF,
272  Solver* pS,
273  doublereal dInitialTime,
274  const char* sOutputFileName,
275  const char* sInputFileName,
276  bool bAbortAfterInput);
277 
278  /* distruttore */
279  virtual ~DataManager(void);
280 
281  int Cleanup(void);
282 
283  /* helpers */
284  int ReadScalarAlgebraicNode(MBDynParser& HP, unsigned int uLabel,
285  Node::Type type, doublereal& dX) const;
286  int ReadScalarDifferentialNode(MBDynParser& HP, unsigned int uLabel,
287  Node::Type type, doublereal& dX, doublereal& dXP) const;
288  Node* ReadNode(MBDynParser& HP, Node::Type type) const;
289  Elem* ReadElem(MBDynParser& HP, Elem::Type type) const;
290 
291  template <class Tbase, Node::Type type>
292  Tbase *ReadNode(MBDynParser& HP) const;
293  template <class Tder, class Tbase, Node::Type type>
294  Tder *ReadNode(MBDynParser& HP) const;
295  template <class Tbase, Elem::Type type>
296  Tbase *ReadElem(MBDynParser& HP) const;
297  template <class Tder, class Tbase, Elem::Type type>
298  Tder *ReadElem(MBDynParser& HP) const;
299 
300  /* Funzioni usate dal metodo di integrazione */
301 
302  /* Setta il valore della variabile tempo nella tabella dei simboli
303  * del DataManager e nel DriveHandler */
304  void SetTime(const doublereal& dTime, const doublereal& dTimeStep = -1.,
305  const integer& iStep = -1, bool bServePending = true);
306  doublereal dGetTime(void) const;
307 
308  NamedValue *InsertSym(const char* const s, const Real& v,
309  int redefine = 0);
310  NamedValue *InsertSym(const char* const s, const Int& v,
311  int redefine = 0);
312 
313  /* Collega il DataManager ed il DriveHandler ai vettori soluzione */
314  void LinkToSolution(VectorHandler& XCurr,
315  VectorHandler& XPrimeCurr);
316 
317  /* inverse dynamics: */
318  void LinkToSolution(VectorHandler& XCurr,
319  VectorHandler& XPrimeCurr,
320  VectorHandler& XPrimePrimeCurr,
321  VectorHandler& LambdaCurr);
322 
323  /* Restituisce l'ostream al file di output,
324  * usato dai vari metodi per scrivere il log del calcolo */
325  std::ostream& GetOutFile(void) const { return OutHdl.Output(); };
326  std::ostream& GetLogFile(void) const { return OutHdl.Log(); };
327 
328  /* required for binary NetCDF output access */
329  const OutputHandler* pGetOutHdl(void) const { return &OutHdl; };
330 
331  /* default orientation description */
334 
335  /* default beam output */
336  void SetOutput(Elem::Type t, unsigned, OrientationDescription);
337  void GetOutput(Elem::Type t, unsigned&, OrientationDescription&) const;
338 
339  /* Restituisce il DriveHandler */
340  const DriveHandler* pGetDrvHdl(void) const { return &DrvHdl; };
341  MathParser& GetMathParser(void) const { return MathPar; };
342  MBDynParser& GetMBDynParser(void) const { return MBPar; };
343  const Solver *GetSolver(void) const { return pSolver; };
344 
345  bool PushCurrData(const std::string& name, const TypedValue& value);
346  bool PopCurrData(const std::string& name);
347 
348  /* Assembla lo jacobiano */
349  virtual void AssJac(MatrixHandler& JacHdl, doublereal dCoef);
350 
351  /* Assembla le matrici per gli autovalori */
352  virtual void AssMats(MatrixHandler& A_Hdl, MatrixHandler& B_Hdl);
353 
354  /* Assembla il residuo */
355  virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef);
356 
357  // inverse dynamics
358  /* Constraints residual, switch iOrder*/
359  virtual void AssConstrRes(VectorHandler& ResHdl,
360  InverseDynamics::Order iOrder);
361 
362  /* Elem residual, equilibrium with no constraints */
363  virtual void AssRes(VectorHandler& ResHdl);
364 
365  /* Constraint Jacobian matrix*/
366  virtual void AssConstrJac(MatrixHandler& JacHdl);
367  // end of inverse dynamics
368 
369 protected:
370  /* specialized functions, called by above general helpers */
371  virtual void AssJac(MatrixHandler& JacHdl, doublereal dCoef,
373  VariableSubMatrixHandler& WorkMat);
374  virtual void AssMats(MatrixHandler& A_Hdl, MatrixHandler& B_Hdl,
376  VariableSubMatrixHandler& WorkMatA,
377  VariableSubMatrixHandler& WorkMatB);
378  virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef,
380  SubVectorHandler& WorkVec);
381 
382  // inverse dynamics
383  void AssConstrJac(MatrixHandler& JacHdl,
385  VariableSubMatrixHandler& WorkMat);
386 
387  void AssConstrRes(VectorHandler& ResHdl,
389  SubVectorHandler& WorkVec,
390  InverseDynamics::Order iOrder);
391 
392  void AssRes(VectorHandler& ResHdl,
394  SubVectorHandler& WorkVec);
395  // end of inverse dynamics
396 
397 protected:
398  typedef std::vector<Converged::State> Converged_t;
400 
401 public:
402  // returns an idx to a newly created slot for convergence
403  unsigned ConvergedRegister(void);
404  // set the value of a slot; elements that register
405  // using ConvergedRegister() should set to false
406  // at first iteration, and set to true when convergence
407  // is allowed
408  void ConvergedSet(unsigned idx, Converged::State s);
409  // returns true only if all slots are true
410  bool IsConverged(void) const;
411  bool EndOfSimulation(void) const;
412 
413 public:
414  virtual void OutputPrepare(void);
415  virtual void OutputEigPrepare(const integer iNumAnalyses,
416  const integer iSize);
417 
418  /* stampa i risultati */
419  virtual bool
420  Output(long lStep, const doublereal& dTime,
421  const doublereal& dTimeStep, bool force = false) const;
422  virtual void
423  Output(const VectorHandler& X, const VectorHandler& XP) const;
424 
425  void OutputOpen(const OutputHandler::OutFiles out);
426 
427  /* Eigenanalysis output */
428  void OutputEigOpen(const std::string& postfix);
429  void
430  OutputEigParams(const doublereal& dTime,
431  const doublereal& dCoef,
432  const unsigned uCurrEigSol,
433  const int iResultsPrecision);
434  void
435  OutputEigFullMatrices(const MatrixHandler* pmMatA,
436  const MatrixHandler* pmMatB,
437  const unsigned uCurrEigSol,
438  const int iMatrixPrecision);
439  void
441  const MatrixHandler* pmMatB,
442  const unsigned uCurrEigSol,
443  const int iMatrixPrecision);
444  void
446  const MatrixHandler* pmMatB,
447  const unsigned uCurrEigSol,
448  const int iMatrixPrecision);
449  void
450  OutputEigenvectors(const VectorHandler *pBeta,
451  const VectorHandler& R, const VectorHandler& I,
452  const doublereal& dShiftR,
453  const MatrixHandler *pVL, const MatrixHandler& VR,
454  const std::vector<bool>& vOut,
455  const unsigned uCurrEigSol,
456  const int iResultsPrecision);
457 
458  void OutputEigGeometry(const unsigned uCurrSol,
459  const int iResultsPrecision);
460  bool OutputEigClose(void);
461 
462  /* Prepara la soluzione con i valori iniziali */
463  void SetValue(VectorHandler& X, VectorHandler& XP);
464 
465  /* Funzioni di aggiornamento dati durante la simulazione */
466  virtual void MakeRestart(void);
467  virtual void DerivativesUpdate(void) const;
468  virtual void BeforePredict(VectorHandler& X, VectorHandler& XP,
469  VectorHandler& XPrev, VectorHandler& XPPrev) const;
470  virtual void AfterPredict(void) const;
471  virtual void Update(void) const;
472  virtual void AfterConvergence(void) const;
473 
474  /* Inverse Dynamics: */
475  virtual void Update(InverseDynamics::Order iOrder) const;
476  virtual void IDAfterConvergence(void) const;
477  virtual void IDSetTest(NonlinearSolverTestRange *pResTest, NonlinearSolverTestRange *pSolTest, bool bFullResTest);
478 
479  void bSetStaticModel(bool b) {
480  bStaticModel = b;
481  };
482  bool bIsStaticModel(void) const {
483  return bStaticModel;
484  };
485  const RigidBodyKinematics *pGetRBK(void) const {
486  return pRBK;
487  };
488 
489  /* Inverse Dynamics: */
490  void bSetInverseDynamics(bool b) {
491  bInverseDynamics = b;
492  };
493  bool bIsInverseDynamics(void) const {
494  return bInverseDynamics;
495  };
496 
497  /* socket select stuff */
498 #ifdef USE_SOCKET
499 protected:
500  std::map<int, UseSocket *> SocketUsers;
501  time_t SocketUsersTimeout;
502 
503  void WaitSocketUsers(void);
504  void DeleteSocketUsers(void);
505 
506 public:
507  void RegisterSocketUser(UseSocket *pUS);
508 #endif // USE_SOCKET
509 
510  /* da ElemManager */
511  friend class InitialAssemblyIterator;
512 
517  };
518 
519  /* loadable elements */
520  const LoadableCalls *GetLoadableElemModule(std::string) const;
521  void SetLoadableElemModule(std::string, const LoadableCalls *,
523 
524 public:
525  /* FIXME: will be eliminated */
527  ELEM = 0x0U, // pleonastico
528  DOFOWNER = 0x1U,
529  GRAVITYOWNER = 0x2U,
530  AIRPROPOWNER = 0x4U,
532  };
533  /* end of FIXME: will be eliminated */
534 
535  enum DataFlags {
536  NONE = 0x00U,
537  ISUNIQUE = 0x01U,
541  DEFAULTOUT = 0x10U
542  };
543 
544  /* element read functional object prototype */
545  struct ElemRead {
546  virtual ~ElemRead( void ) { NO_OP; };
547  virtual Elem *
548  Read(const DataManager *pDM, MBDynParser& HP,
549  unsigned int uLabel, int CurrType) const = 0;
550  };
551 
552  typedef std::map<std::string, DataManager::ElemRead *, ltstrcase> ElemReadType;
553  typedef std::pair<unsigned, Elem*> KeyElemPair;
554  typedef std::list<KeyElemPair> ElemContainerType;
555  typedef std::map<unsigned, ElemContainerType::iterator> ElemMapToListType;
556 
557 protected:
558 
559  /* struttura dei dati fondamentali degli elementi */
561  unsigned int iExpectedNum; // numero di elementi del tipo
562  const char *Desc;
563  const char *ShortDesc;
564 
565  DofOwner::Type DofOwnerType; // Tipo di DofOwner
566  unsigned int iDerivation; // Tabella delle derivazioni
567 
568  OutputHandler::OutFiles OutFile; // Tipo di file in output
569 
570  unsigned uFlags; // flags
571 
572  unsigned uOutputFlags;
574 
575 
576  /* helpers */
577  void IsUnique(bool b) { if (b) { uFlags |= ISUNIQUE; } else { uFlags &= ~ISUNIQUE; } };
578  void ToBeUsedInAssembly(bool b) { if (b) { uFlags |= TOBEUSEDINASSEMBLY; } else { uFlags &= ~TOBEUSEDINASSEMBLY; } };
580  void UsesAirProperties(bool b) { if (b) { uFlags |= USESAIRPROPERTIES; } else { uFlags &= ~USESAIRPROPERTIES; } };
581  void DefaultOut(bool b) { if (b) { uFlags |= DEFAULTOUT; } else { uFlags &= ~DEFAULTOUT; } };
582 
583  bool bIsUnique(void) const { return (uFlags & ISUNIQUE) == ISUNIQUE; };
586  bool bUsesAirProperties(void) const { return (uFlags & USESAIRPROPERTIES) == USESAIRPROPERTIES; };
587  bool bDefaultOut(void) const { return (uFlags & DEFAULTOUT) == DEFAULTOUT; };
588 
589  /* element read map */
594 
595  Elem ** InsertElem(ElemDataStructure& eldata, unsigned int uLabel, Elem * pE) {
596  eldata.ElemContainer.push_back(ElemContainerType::value_type(uLabel, pE));
597  eldata.ElemMapToList[uLabel] = --eldata.ElemContainer.end();
598  return &eldata.ElemContainer.back().second;
599  };
600 
601 #if 0
602  /* element type map; will replace ElemData */
603  typedef std::map<std::string, ElemDataStructure *, ltstrcase> ElemDataMapType;
604  ElemDataMapType ElemDataMap;
605 #endif
606 
607  /* array of elements */
608  typedef std::vector<Elem *> ElemVecType;
610 
611  /* NOTE: will be removed? */
613  /* end of NOTE: will be removed? */
614 
615  /* struttura dei drivers */
616  struct {
618  unsigned int iNum;
620 
621  Drive** ppDrive; /* puntatore ai drivers */
622  unsigned int iTotDrive; /* numero totale dei drivers */
623 
624  /* dati di lavoro */
625  integer iMaxWorkNumRowsRes; // the maximum number of rows of the residual subvector
626  integer iMaxWorkNumRowsJac; // the maximum number of rows in a full Jacobian submatrix
627  integer iMaxWorkNumColsJac; // the maximum number of columns in a full Jacobian submatrix
628  integer iMaxWorkNumItemsJac; // the maximum number of items in a sparse Jacobian submatrix
629 
630  VariableSubMatrixHandler *pWorkMatA; /* SubMatrix di lavoro */
634 
635  /* ricerca elementi */
636  Elem* pFindElem(Elem::Type Typ, unsigned int uElem,
637  unsigned int iDeriv) const;
638  Elem* pChooseElem(Elem* p, unsigned int iDeriv) const;
639 
640  Elem** ppFindElem(Elem::Type Typ, unsigned int uElem) const;
641 
642  flag fGetDefaultOutputFlag(const Elem::Type& t) const;
643 
645  unsigned int uLabel,
646  const std::string& sName,
647  int CurrType);
648 
649 public:
650  /* ricerca drives */
651  Drive* pFindDrive(Drive::Type Typ, unsigned int uL) const;
652 
653  /* ricerca elementi*/
654  Elem* pFindElem(Elem::Type Typ, unsigned int uElem = unsigned(-1)) const;
655 
656  template <class Tbase, Elem::Type type>
657  Tbase *pFindElem(unsigned int uElem = unsigned(-1)) const;
658  template <class Tder, class Tbase, Elem::Type type>
659  Tder *pFindElem(unsigned int uElem = unsigned(-1)) const;
660 
662 
663  /* buffer per accesso a input/output speciali */
664  std::vector<doublereal>& GetBufIn(unsigned uL);
665  const std::vector<doublereal>& GetBufOut(unsigned uL) const;
666 
667  /* low-level variant (use at own risk) */
668  doublereal * GetBufInRaw(unsigned uL);
669  void SetBufInRaw(unsigned uL, integer n, const doublereal *p);
670  const doublereal * GetBufOutRaw(unsigned uL) const;
671  void SetBufOutRaw(unsigned uL, integer n, const doublereal *p);
672 
673  /* pseudocostruttore */
674  void ElemManager(void);
675  void ElemManagerDestructor(void);
676 
677  /* Funzioni di inizializzazione */
678 
679  /* Inizializzatore */
680  void ElemDataInit(void);
681 
682  /* Preassemblaggio */
683  void ElemAssInit(void);
684 
685  /* Funzioni di routine */
686 
687  /* Scrive i risultati */
689  void ElemOutput(OutputHandler& OH) const;
690  void ElemOutput(OutputHandler& OH,
691  const VectorHandler& X, const VectorHandler& XP) const;
692  void DriveOutput(OutputHandler& OH) const;
693  void DriveTrace(OutputHandler& OH) const;
694  DataManager::ElemContainerType::const_iterator begin(Elem::Type t) const;
695  DataManager::ElemContainerType::const_iterator end(Elem::Type t) const;
696 
697  /* da NodeManager */
698 public:
699  /* element read functional object prototype */
700  struct NodeRead {
701  virtual ~NodeRead(void) { NO_OP; };
702  virtual Elem *
703  Read(const DataManager *pDM, MBDynParser& HP,
704  unsigned int uLabel, int CurrType) const = 0;
705  };
706 
707  typedef std::map<std::string, DataManager::NodeRead *, ltstrcase> NodeReadType;
708  typedef std::pair<unsigned, Node*> KeyNodePair;
709  typedef std::list<KeyNodePair> NodeContainerType;
710  typedef std::map<unsigned, NodeContainerType::iterator> NodeMapToListType;
711 
712 protected:
713 
714  /* struttura dei dati dei nodi. Per ogni tipo:
715  * puntatore al puntatore al primo dato, numero degli item per tipo */
717  unsigned int iExpectedNum; // numero di nodi del tipo
718  unsigned uFlags; // flags
719  const char *Desc;
720  const char *ShortDesc;
721 
722  /* helpers */
723  void DefaultOut(bool b) { if (b) { uFlags |= DEFAULTOUT; } else { uFlags &= ~DEFAULTOUT; } };
724 
725  bool bDefaultOut(void) const { return (uFlags & DEFAULTOUT) == DEFAULTOUT; };
726 
727  OutputHandler::OutFiles OutFile; /* Tipo di file in output */
728 
729  /* element read map */
734 
735  Node ** InsertNode(NodeDataStructure& nodedata, unsigned int uLabel, Node * pN) {
736  nodedata.NodeContainer.push_back(NodeContainerType::value_type(uLabel, pN));
737  nodedata.NodeMapToList[uLabel] = --nodedata.NodeContainer.end();
738  return &nodedata.NodeContainer.back().second;
739  };
740 
741  /* array of nodes */
742  typedef std::vector<Node *> NodeVecType;
744 
745  /* dati dei nodi: numero totale e puntatore all'array dei dati
746  * (ogni nodo ha il suo formato caratteristico, comunque derivato
747  * dalla classe Node) */
748  unsigned int iTotNodes;
749 
750 public:
751  Node** ppFindNode(Node::Type Typ, unsigned int uNode) const;
752  /* ricerca di nodi */
753  Node* pFindNode(Node::Type Typ, unsigned int uNode) const;
754 
755  template <class Tbase, Node::Type type>
756  Tbase *pFindNode(unsigned int uNode) const;
757  template <class Tder, class Tbase, Node::Type type>
758  Tder *pFindNode(unsigned int uNode) const;
759 
760 protected:
761  flag fGetDefaultOutputFlag(const Node::Type& t) const;
762 
763 public:
764  /* Pseudocostruttore */
765  void NodeManager(void);
766  void NodeManagerDestructor(void);
767 
768  /* inizializza le matrici ed alloca memoria */
769  void NodeDataInit(void);
770 
771  DataManager::NodeContainerType::const_iterator begin(Node::Type t) const;
772  DataManager::NodeContainerType::const_iterator end(Node::Type t) const;
773 
774  /* scrive i dati dei nodi */
776  void NodeOutput(OutputHandler& OH) const;
777  void NodeOutput(OutputHandler& OH,
778  const VectorHandler& X, const VectorHandler& XP) const;
779 
780  /* da DofManager */
781 protected:
782 
783  /* struttura dei dati generali dei dof: numero totale per tipo,
784  * dimensione caratteristica (se esiste), puntatore al primo del tipo */
785  struct {
786  DofOwner* pFirstDofOwner; /* punt. al 1o di ogni tipo */
787  integer iNum; /* n. DofOwners per ogni tipo */
788  integer iSize; /* n. Dof (se fisso, es. nodi) */
791 
792  /* struttura dei dati dei dof di ogni ente possessore:
793  * totale dei possessori; per ognuno: indice del primo dof,
794  * numero di dof posseduti */
795  integer iTotDofOwners; /* numero totale di DofOwners */
796  std::vector<DofOwner> DofOwners; /* DofOwner container */
797 
798 public:
799  /* struttura dei dati di ogni singolo dof: totale dei dof; per ognuno:
800  * indice e tipo (algebrico o differenziale) */
801  typedef std::vector<Dof> DofVecType;
802  typedef DofVecType::const_iterator DofIterator_const;
803  typedef DofVecType::iterator DofIterator;
804 
805  /* Restituisce il puntatore alla struttura dei dof */
806  const DofVecType& GetDofs(void) const { return Dofs; };
807 
808  /* Restituisce il numero di dof per la costruzione delle matrici ecc. */
809  integer iGetNumDofs(void) const { return iTotDofs; };
810 
811 protected:
812  integer iTotDofs; /* numero totale di Dof */
814 
815  DofOwner DummyDofOwner; /* Per quelli che non hanno dof */
816 
818 
819 public:
820  /* pseudocostruttore */
821  void DofManager(void);
822  void DofManagerDestructor(void);
823 
824  /* funzioni di inizializzazione */
825  void DofDataInit(void);
826  void DofInit(void);
827 
828  /* Inverse Dynamics: */
829  void IDDofInit(void);
830 
831  int iIDGetNodeTotNumDofs(void) const;
832  int iIDGetJointTotNumDofs(void) const;
833  int iIDGetTotNumDofs(void) const;
834 
835  void SetScale(VectorHandler& XScale) const;
836 
837 #if 0
838  /* DataOut: entita' che richiedono solo l'output */
839 protected:
840  struct {
841  DataOut *pFirstDataOut;
842  integer iNum;
843  } OutData[OutData::LASTDATAOUTTYPE];
844  integer iTotDataOut;
845  DataOut **pDataOut;
846 
847 public:
848  void OutManager(void);
849  void OutManagerDestructor(void);
850 #endif /* 0 */
851 
852 public:
853  const VectorHandler* GetpXCurr(void) const {
854  return pXCurr;
855  };
856 
857  const VectorHandler* GetpXPCurr(void) const {
858  return pXPrimeCurr;
859  }
860 
861 public:
862  virtual void PrintResidual(const VectorHandler& Res, integer iIterCnt) const;
863  virtual void PrintSolution(const VectorHandler& Sol, integer iIterCnt) const;
864 
865  virtual const std::string& GetDofDescription(int i) const;
866  virtual const std::string& GetEqDescription(int i) const;
867  virtual DofOrder::Order GetDofType(int i) const;
868  virtual DofOrder::Order GetEqType(int i) const;
869 };
870 
871 // if bActive is true, the cast only succeeds when driven element is active
872 // otherwise it always succeeds
873 template <class T>
874 T*
875 DataManager::Cast(Elem *pEl, bool bActive)
876 {
877  ASSERT(pEl != NULL);
878 
879  T *pT = dynamic_cast<T *>(pEl);
880 
881  if (pT == 0) {
882  DrivenElem *pDE = dynamic_cast<DrivenElem *>(pEl);
883  if (pDE == 0) {
884  silent_cerr("unable to cast "
885  << psElemNames[pEl->GetElemType()]
886  << "(" << pEl->GetLabel() << ") as \"" << mbdyn_demangle<T>() << "\" (not driven)" << std::endl);
888  }
889 
890  if (bActive && !pDE->bIsActive()) {
891  pedantic_cerr("unable to cast "
892  << psElemNames[pEl->GetElemType()]
893  << "(" << pEl->GetLabel() << ") as \"" << mbdyn_demangle<T>() << "\""
894  " (driven but currently inactive)" << std::endl);
895  return 0;
896  }
897 
898  pT = dynamic_cast<T *>(pDE->pGetElem());
899  if (pT == 0) {
900  pedantic_cerr("unable to cast "
901  << psElemNames[pEl->GetElemType()]
902  << "(" << pEl->GetLabel() << ") as \"" << mbdyn_demangle<T>() << "\""
903  " (driven but cast failed)" << std::endl);
904  }
905  }
906 
907  return pT;
908 }
909 
910 template <class Tbase, Node::Type type>
911 Tbase *
912 DataManager::pFindNode(unsigned int uNode) const
913 {
914  /* verifica di esistenza del nodo */
915  Node* pNode = pFindNode(type, uNode);
916  if (pNode == 0) {
917  silent_cerr("DataManager::pFindNode: " << psNodeNames[type] << "(" << uNode << ") not found" << std::endl);
918  return 0;
919  }
920 
921  Tbase *pNodeBase = dynamic_cast<Tbase *>(pNode);
922  if (pNodeBase == 0) {
923  silent_cerr("DataManager::pFindNode: unable to cast " << psNodeNames[type] << "(" << pNode->GetLabel() << ") "
924  "to \"" << mbdyn_demangle<Tbase>() << "\"" << std::endl);
925  return 0;
926  }
927 
928  return pNodeBase;
929 }
930 
931 template <class Tder, class Tbase, Node::Type type>
932 Tder *
933 DataManager::pFindNode(unsigned int uNode) const
934 {
935  Tbase *pNodeBase = pFindNode<Tbase, type>(uNode);
936  if (pNodeBase == 0) {
937  return 0;
938  }
939 
940  Tder *pNodeDer = dynamic_cast<Tder *>(pNodeBase);
941  if (pNodeDer == 0) {
942  silent_cerr("DataManager::pFindNode: unable to cast " << psNodeNames[type] << "(" << pNodeBase->GetLabel() << ") "
943  "from \"" << mbdyn_demangle<Tbase>() << "\" "
944  "to \"" << mbdyn_demangle<Tder>() << "\"" << std::endl);
945  return 0;
946  }
947 
948  return pNodeDer;
949 }
950 
951 template <class Tbase, Elem::Type type>
952 Tbase *
953 DataManager::pFindElem(unsigned int uElem) const
954 {
955  /* verifica di esistenza dell'elemento */
956  Elem* pElem = pFindElem(type, uElem);
957  if (pElem == 0) {
958  silent_cerr("DataManager::pFindElem: " << psElemNames[type] << "(" << uElem << ") not found" << std::endl);
959  return 0;
960  }
961 
962  Tbase *pElemBase = dynamic_cast<Tbase *>(pElem);
963  if (pElemBase == 0) {
964  silent_cerr("DataManager::pFindElem: unable to cast " << psElemNames[type] << "(" << pElem->GetLabel() << ") "
965  "to \"" << mbdyn_demangle<Tbase>() << "\"" << std::endl);
966  return 0;
967  }
968 
969  return pElemBase;
970 }
971 
972 template <class Tder, class Tbase, Elem::Type type>
973 Tder *
974 DataManager::pFindElem(unsigned int uElem) const
975 {
976  Tbase *pElemBase = pFindElem<Tbase, type>(uElem);
977  if (pElemBase == 0) {
978  return 0;
979  }
980 
981  Tder *pElemDer = dynamic_cast<Tder *>(pElemBase);
982  if (pElemDer == 0) {
983  silent_cerr("DataManager::pFindElem: unable to cast " << psElemNames[type] << "(" << pElemBase->GetLabel() << ") "
984  "from \"" << mbdyn_demangle<Tbase>() << "\" "
985  "to \"" << mbdyn_demangle<Tder>() << "\"" << std::endl);
986  return 0;
987  }
988 
989  return pElemDer;
990 }
991 
992 template <class Tbase, Node::Type type>
993 Tbase *
995 {
996  Node *pNode = ReadNode(HP, type);
997  ASSERT(pNode != 0);
998 
999  Tbase *pNodeBase = dynamic_cast<Tbase *>(pNode);
1000  if (pNodeBase == 0) {
1001  silent_cerr("DataManager::ReadNode: unable to cast " << psNodeNames[type] << "(" << pNode->GetLabel() << ") "
1002  "to \"" << mbdyn_demangle<Tbase>() << "\" at line " << HP.GetLineData() << std::endl);
1004  }
1005 
1006  return pNodeBase;
1007 }
1008 
1009 template <class Tder, class Tbase, Node::Type type>
1010 Tder *
1012 {
1013  Tbase *pNodeBase = ReadNode<Tbase, type>(HP);
1014  ASSERT(pNodeBase != 0);
1015 
1016  Tder *pNodeDer = dynamic_cast<Tder *>(pNodeBase);
1017  if (pNodeDer == 0) {
1018  silent_cerr("DataManager::ReadNode: unable to cast " << psNodeNames[type] << "(" << pNodeBase->GetLabel() << ") "
1019  "from \"" << mbdyn_demangle<Tbase>() << "\" "
1020  "to \"" << mbdyn_demangle<Tder>() << "\" at line " << HP.GetLineData() << std::endl);
1022  }
1023 
1024  return pNodeDer;
1025 }
1026 
1027 template <class Tbase, Elem::Type type>
1028 Tbase *
1030 {
1031  Elem *pElem = ReadElem(HP, type);
1032  ASSERT(pElem != 0);
1033 
1034  Tbase *pElemBase = dynamic_cast<Tbase *>(pElem);
1035  if (pElemBase == 0) {
1036  silent_cerr("DataManager::ReadElem: unable to cast " << psElemNames[type] << "(" << pElem->GetLabel() << ") "
1037  "to \"" << mbdyn_demangle<Tbase>() << "\" at line " << HP.GetLineData() << std::endl);
1039  }
1040 
1041  return pElemBase;
1042 }
1043 
1044 template <class Tder, class Tbase, Elem::Type type>
1045 Tder *
1047 {
1048  Tbase *pElemBase = ReadElem<Tbase, type>(HP);
1049  ASSERT(pElemBase != 0);
1050 
1051  Tder *pElemDer = dynamic_cast<Tder *>(pElemBase);
1052  if (pElemBase == 0) {
1053  silent_cerr("DataManager::ReadElem: unable to cast " << psElemNames[type] << "(" << pElemBase->GetLabel() << ") "
1054  "from \"" << mbdyn_demangle<Tbase>() << "\" "
1055  "to \"" << mbdyn_demangle<Tder>() << "\" at line " << HP.GetLineData() << std::endl);
1057  }
1058 
1059  return pElemDer;
1060 }
1061 
1062 template <class T>
1063 flag
1065 {
1066  flag fDef = fGetDefaultOutputFlag(t);
1067  if (!HP.IsKeyWord("output")) {
1068  return fDef;
1069  }
1070 
1071  if (HP.IsKeyWord("no")) {
1072  return flag(0);
1073  }
1074 
1075  if (HP.IsKeyWord("yes")) {
1076  return flag(1);
1077  }
1078 
1079  if (HP.IsKeyWord("default")) {
1080  return fDef;
1081  }
1082 
1083  return HP.GetBool(fDef);
1084 }
1085 
1086 /* DataManager - end */
1087 
1088 
1089 /* Usato per iterare sugli elementi che partecipano
1090  * all'assemblaggio iniziale dei vincoli */
1091 
1092 /* InitialAssemblyIterator - begin */
1093 
1095 private:
1098  mutable DataManager::ElemContainerType::const_iterator m_CurrElem;
1100 
1101 public:
1103  (*pED)[Elem::LASTELEMTYPE]);
1104  InitialAssemblyElem* GetFirst(void) const;
1105  InitialAssemblyElem* GetNext(void) const;
1106 };
1107 
1108 /* InitialAssemblyIterator - end */
1109 
1110 extern "C" int
1111 datamanager_cleanup(void *);
1112 
1113 extern ScalarDof
1114 ReadScalarDof(const DataManager* pDM, MBDynParser& HP, bool bDof, bool bOrder);
1115 
1118 
1121 
1122 #endif /* DATAMAN_H */
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
void SetScale(VectorHandler &XScale) const
Definition: dofman.cc:159
integer iTotDofOwners
Definition: dataman.h:795
bool IsConverged(void) const
Definition: dataman2.cc:2692
eRestart RestartEvery
Definition: dataman.h:164
integer iMaxWorkNumItemsJac
Definition: dataman.h:628
DataManager(MBDynParser &HP, unsigned OF, Solver *pS, doublereal dInitialTime, const char *sOutputFileName, const char *sInputFileName, bool bAbortAfterInput)
Definition: dataman.cc:90
virtual void IDSetTest(NonlinearSolverTestRange *pResTest, NonlinearSolverTestRange *pSolTest, bool bFullResTest)
Definition: invdataman.cc:1111
bool bOutputDriveCallers(void) const
Definition: dataman.cc:884
void bSetInverseDynamics(bool b)
Definition: dataman.h:490
ElemVecType Elems
Definition: dataman.h:609
DofVecType::iterator DofIterator
Definition: dataman.h:803
Drive * pFindDrive(Drive::Type Typ, unsigned int uL) const
Definition: elman.cc:705
ElemContainerType ElemContainer
Definition: dataman.h:591
void OutputEigParams(const doublereal &dTime, const doublereal &dCoef, const unsigned uCurrEigSol, const int iResultsPrecision)
Definition: dataman2.cc:1525
std::vector< doublereal > & GetBufIn(unsigned uL)
Definition: dataman2.cc:2720
doublereal dEpsilon
Definition: dataman.h:126
VariableSubMatrixHandler * pWorkMatA
Definition: dataman.h:630
T * Cast(Elem *pEl, bool bActive=false)
Definition: dataman.h:875
long int flag
Definition: mbdyn.h:43
char * sSimulationTitle
Definition: dataman.h:158
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const doublereal * GetBufOutRaw(unsigned uL) const
Definition: dataman2.cc:2792
void NodeOutput(OutputHandler &OH) const
Definition: nodeman.cc:152
Definition: node.h:67
MathParser & MathPar
Definition: dataman.h:98
DofOwner::Type DofOwnerType
Definition: dataman.h:565
Drive ** ppFirstDrive
Definition: dataman.h:617
const doublereal & dGetInitialVelocityStiffness(void) const
Definition: dataman2.cc:117
OrientationDescription od
Definition: dataman.h:573
std::map< std::string, DataManager::ElemRead *, ltstrcase > ElemReadType
Definition: dataman.h:552
Elem::Type m_FirstType
Definition: dataman.h:1097
DofVecType Dofs
Definition: dataman.h:813
unsigned ConvergedRegister(void)
Definition: dataman2.cc:2675
virtual DofOrder::Order GetEqType(int i) const
Definition: dataman2.cc:2656
Elem * ReadElem(MBDynParser &HP, Elem::Type type) const
Definition: dataman3.cc:2334
integer iMaxWorkNumRowsRes
Definition: dataman.h:625
Definition: drive.h:89
int iIDNodeTotNumDofs
Definition: dataman.h:134
const DataManager::ElemDataStructure(* pElemData)[Elem::LASTELEMTYPE]
Definition: dataman.h:1096
struct DataManager::@29 DriveData[Drive::LASTDRIVETYPE]
void ElemManager(void)
Definition: elman.cc:51
void ReadControl(MBDynParser &HP, const char *sInputFileName)
Definition: dataman3.cc:68
void OutputEigOpen(const std::string &postfix)
Definition: dataman.cc:685
bool OutputEigClose(void)
Definition: dataman2.cc:2348
flag fGetDefaultOutputFlag(const Elem::Type &t) const
Definition: elman.cc:727
Elem ** InsertElem(ElemDataStructure &eldata, unsigned int uLabel, Elem *pE)
Definition: dataman.h:595
std::vector< Dof > DofVecType
Definition: dataman.h:801
MathParser & GetMathParser(void) const
Definition: dataman.h:341
NodeVecType Nodes
Definition: dataman.h:743
doublereal dInitialPositionStiffness
Definition: dataman.h:121
bool EndOfSimulation(void) const
Definition: dataman2.cc:2706
bool bOmegaRotates
Definition: dataman.h:123
DofOwner DummyDofOwner
Definition: dataman.h:815
doublereal dGetTime(void) const
Definition: dataman2.cc:165
integer iCurrRestartTime
Definition: dataman.h:170
OutputHandler OutHdl
Definition: dataman.h:105
virtual bool GetBool(bool bDefval=false)
Definition: parser.cc:1010
virtual const std::string & GetDofDescription(int i) const
Definition: dataman2.cc:2635
unsigned int iTotNodes
Definition: dataman.h:748
virtual bool Output(long lStep, const doublereal &dTime, const doublereal &dTimeStep, bool force=false) const
Definition: dataman2.cc:2355
virtual void BeforePredict(VectorHandler &X, VectorHandler &XP, VectorHandler &XPrev, VectorHandler &XPPrev) const
Definition: dataman2.cc:2454
Converged_t m_IsConverged
Definition: dataman.h:399
void DofManagerDestructor(void)
Definition: dofman.cc:56
MySubVectorHandler * pWorkVec
Definition: dataman.h:633
bool bDefaultOut(void) const
Definition: dataman.h:725
void ReadNodes(MBDynParser &HP)
Definition: dataman3.cc:1557
OrientationDescription
Definition: matvec3.h:1597
void ConvergedSet(unsigned idx, Converged::State s)
Definition: dataman2.cc:2684
doublereal dGetDefaultScale(DofOwner::Type t) const
Definition: dofman.cc:64
void DriveTrace(OutputHandler &OH) const
Definition: dataman2.cc:2415
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
void DofOwnerSet(void)
Definition: dataman2.cc:1368
Type
Definition: drive.h:92
virtual void AssRes(VectorHandler &ResHdl, doublereal dCoef)
Definition: elman.cc:498
VariableSubMatrixHandler * pWorkMatB
Definition: dataman.h:631
void NodeDataInit(void)
Definition: nodeman.cc:98
void GetOutput(Elem::Type t, unsigned &, OrientationDescription &) const
Definition: dataman.cc:871
unsigned int iTotDrive
Definition: dataman.h:622
doublereal * GetBufInRaw(unsigned uL)
Definition: dataman2.cc:2750
const OutputHandler * pGetOutHdl(void) const
Definition: dataman.h:329
void SetOrientationDescription(OrientationDescription)
Definition: dataman.cc:851
#define NO_OP
Definition: myassert.h:74
OrientationDescription ReadOptionalOrientationDescription(DataManager *pDM, MBDynParser &HP)
Definition: dataman3.cc:2531
integer iMaxInitialIterations
Definition: dataman.h:125
void SetLoadableElemModule(std::string, const LoadableCalls *, ModuleInsertMode=MIM_FAIL)
Definition: dataman2.cc:73
virtual Elem::Type GetElemType(void) const =0
virtual ~ElemRead(void)
Definition: dataman.h:546
int iIDJointTotNumDofs
Definition: dataman.h:135
void OutputEigFullMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
Definition: dataman2.cc:1565
void OutputEigGeometry(const unsigned uCurrSol, const int iResultsPrecision)
Definition: dataman2.cc:1880
virtual void DerivativesUpdate(void) const
Definition: dataman2.cc:2587
std::vector< DofOwner > DofOwners
Definition: dataman.h:796
std::map< std::string, const LoadableCalls * > MapOfLoadableElemHandlers
Definition: dataman.h:102
const std::vector< doublereal > & GetBufOut(unsigned uL) const
Definition: dataman2.cc:2738
bool bIsStaticModel(void) const
Definition: dataman.h:482
void ElemOutput(OutputHandler &OH) const
Definition: elman.cc:583
OrientationDescription ReadOrientationDescription(MBDynParser &HP)
Definition: dataman3.cc:2502
void DofOwnerInit(void)
Definition: dataman2.cc:182
void InitialJointAssembly(void)
Definition: dataman2.cc:679
virtual DofOrder::Order GetDofType(int i) const
Definition: dataman2.cc:2649
const LoadableCalls * GetLoadableElemModule(std::string) const
Definition: dataman2.cc:58
Elem * pChooseElem(Elem *p, unsigned int iDeriv) const
Definition: elman.cc:674
DataManager::ElemContainerType::const_iterator m_CurrElem
Definition: dataman.h:1098
int Int
Definition: mathtyp.h:40
bool bInverseDynamics
Definition: dataman.h:133
NodeContainerType NodeContainer
Definition: dataman.h:731
bool bDefaultOut(void) const
Definition: dataman.h:587
virtual void AfterConvergence(void) const
Definition: dataman2.cc:2527
void DofDataInit(void)
Definition: dofman.cc:69
bool bGeneratesInertiaForces(void) const
Definition: dataman.h:585
bool bToBeUsedInAssembly(void) const
Definition: dataman.h:584
int ReadScalarDifferentialNode(MBDynParser &HP, unsigned int uLabel, Node::Type type, doublereal &dX, doublereal &dXP) const
Definition: dataman3.cc:1539
integer iTotDofs
Definition: dataman.h:809
Definition: linsol.h:39
int ReadScalarAlgebraicNode(MBDynParser &HP, unsigned int uLabel, Node::Type type, doublereal &dX) const
Definition: dataman3.cc:1510
std::map< unsigned, ElemContainerType::iterator > ElemMapToListType
Definition: dataman.h:555
bool bSkipInitialJointAssembly
Definition: dataman.h:117
virtual void IDAfterConvergence(void) const
Definition: invdataman.cc:834
bool saveXSol
Definition: dataman.h:175
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
Definition: elman.cc:650
bool bIsUnique(void) const
Definition: dataman.h:583
virtual void AfterPredict(void) const
Definition: dataman2.cc:2472
void ReadDrivers(MBDynParser &HP)
Definition: dataman3.cc:2187
doublereal dReadScale(MBDynParser &HP, enum DofOwner::Type t) const
Definition: dataman3.cc:1491
VectorHandler * pXPrimePrimeCurr
Definition: dataman.h:112
virtual void OutputEigPrepare(const integer iNumAnalyses, const integer iSize)
Definition: dataman2.cc:1474
void SetValue(VectorHandler &X, VectorHandler &XP)
Definition: dataman2.cc:1404
void IDDofOwnerSet(void)
Definition: invdataman.cc:852
virtual void PrintSolution(const VectorHandler &Sol, integer iIterCnt) const
Definition: dataman2.cc:2619
void LinkToSolution(VectorHandler &XCurr, VectorHandler &XPrimeCurr)
Definition: dataman2.cc:172
void DofInit(void)
Definition: dofman.cc:111
virtual Elem * Read(const DataManager *pDM, MBDynParser &HP, unsigned int uLabel, int CurrType) const =0
doublereal dRestartTime
Definition: dataman.h:166
void SetOutput(Elem::Type t, unsigned, OrientationDescription)
Definition: dataman.cc:864
std::ostream & GetOutFile(void) const
Definition: dataman.h:325
void ** ppCleanupData
Definition: dataman.h:89
integer iMaxWorkNumRowsJac
Definition: dataman.h:626
std::pair< unsigned, Node * > KeyNodePair
Definition: dataman.h:708
DataManager::ElemContainerType::const_iterator begin(Elem::Type t) const
Definition: dataman.cc:902
void IncElemCount(Elem::Type type)
Definition: dataman2.cc:129
void IDDofInit(void)
Definition: invdataman.cc:895
void ElemManagerDestructor(void)
Definition: elman.cc:196
int iIDGetJointTotNumDofs(void) const
Definition: invdataman.cc:1086
std::vector< Elem * > ElemVecType
Definition: dataman.h:599
Solver * pSolver
Definition: dataman.h:99
int ResMode
Definition: dataman.h:201
DriveCaller * pOutputMeter
Definition: dataman.h:179
void NodeManagerDestructor(void)
Definition: nodeman.cc:84
virtual void MakeRestart(void)
Definition: dataman.cc:699
DofOwner * pFirstDofOwner
Definition: dataman.h:786
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
Elem::Type m_CurrType
Definition: dataman.h:1099
doublereal dLastRestartTime
Definition: dataman.h:173
RigidBodyKinematics * pRBK
Definition: dataman.h:129
InitialAssemblyIterator(const DataManager::ElemDataStructure(*pED)[Elem::LASTELEMTYPE])
Definition: elman.cc:737
const VectorHandler * GetpXPCurr(void) const
Definition: dataman.h:857
virtual Elem * Read(const DataManager *pDM, MBDynParser &HP, unsigned int uLabel, int CurrType) const =0
void NodeManager(void)
Definition: nodeman.cc:44
void OutputEigSparseMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
Definition: dataman2.cc:1651
struct DataManager::NodeDataStructure NodeData[Node::LASTNODETYPE]
void bSetStaticModel(bool b)
Definition: dataman.h:479
integer iNum
Definition: dataman.h:787
bool bDoesOmegaRotate(void) const
Definition: dataman2.cc:123
Type
Definition: node.h:71
std::pair< unsigned, Elem * > KeyElemPair
Definition: dataman.h:553
virtual void OutputPrepare(void)
Definition: dataman2.cc:1451
virtual void AssJac(MatrixHandler &JacHdl, doublereal dCoef)
Definition: elman.cc:392
std::vector< Converged::State > Converged_t
Definition: dataman.h:398
int iIDGetNodeTotNumDofs(void) const
Definition: invdataman.cc:1080
integer iMaxWorkNumColsJac
Definition: dataman.h:627
void ReadElems(MBDynParser &HP)
Definition: dataman4.cc:157
VectorHandler * pXPrimeCurr
Definition: dataman.h:109
bool PushCurrData(const std::string &name, const TypedValue &value)
Definition: dataman.cc:930
NamedValue * InsertSym(const char *const s, const Real &v, int redefine=0)
Definition: dataman.cc:838
bool bOutputFrames
Definition: dataman.h:118
doublereal dInitialAssemblyTol
Definition: dataman.h:124
integer iRestartIterations
Definition: dataman.h:165
virtual clock_t GetCPUTime(void) const
Definition: dataman.h:254
DofVecType::const_iterator DofIterator_const
Definition: dataman.h:802
#define ASSERT(expression)
Definition: colamd.c:977
Elem ** ppFindElem(Elem::Type Typ, unsigned int uElem) const
Definition: elman.cc:629
VecIter< Elem * > ElemIter
Definition: dataman.h:612
OrientationDescription od
Definition: dataman.h:229
ElemMapToListType ElemMapToList
Definition: dataman.h:592
Definition: veciter.h:52
OrientationDescription GetOrientationDescription(void) const
Definition: dataman.cc:857
bool PopCurrData(const std::string &name)
Definition: dataman.cc:941
bool bInitialJointAssemblyToBeDone
Definition: dataman.h:116
const VectorHandler * GetpXCurr(void) const
Definition: dataman.h:853
VectorHandler * pLambdaCurr
Definition: dataman.h:113
doublereal dInitialVelocityStiffness
Definition: dataman.h:122
virtual void AssConstrJac(MatrixHandler &JacHdl)
Definition: invdataman.cc:94
const DofVecType & GetDofs(void) const
Definition: dataman.h:806
bool bOutput(ResType t) const
Definition: dataman.cc:694
integer iOutputCount
Definition: dataman.h:180
integer iSize
Definition: dataman.h:788
void SetTime(const doublereal &dTime, const doublereal &dTimeStep=-1., const integer &iStep=-1, bool bServePending=true)
Definition: dataman2.cc:139
bool bOutputDriveCaller
Definition: dataman.h:120
integer iCurrRestartIter
Definition: dataman.h:172
unsigned int iNum
Definition: dataman.h:618
InitialAssemblyElem * GetNext(void) const
Definition: elman.cc:791
Elem ** ReadOneElem(MBDynParser &HP, unsigned int uLabel, const std::string &sName, int CurrType)
Definition: dataman4.cc:1255
Definition: solver.h:78
char * solArrFileName
Definition: dataman.h:176
const DataManager::ElemDataStructure & GetElemDataStructure(Elem::Type Typ) const
Definition: dataman.h:661
void ElemOutputPrepare(OutputHandler &OH)
Definition: elman.cc:545
void OutputEigenvectors(const VectorHandler *pBeta, const VectorHandler &R, const VectorHandler &I, const doublereal &dShiftR, const MatrixHandler *pVL, const MatrixHandler &VR, const std::vector< bool > &vOut, const unsigned uCurrEigSol, const int iResultsPrecision)
Definition: dataman2.cc:1999
virtual void PrintResidual(const VectorHandler &Res, integer iIterCnt) const
Definition: dataman2.cc:2603
Drive ** ppDrive
Definition: dataman.h:621
const char * psNodeNames[]
Definition: enums.cc:372
OutputHandler::OutFiles OutFile
Definition: dataman.h:568
const RigidBodyKinematics * pGetRBK(void) const
Definition: dataman.h:485
void DofManager(void)
Definition: dofman.cc:40
doublereal dDefScale
Definition: dataman.h:789
Definition: elem.h:75
std::ostream & Output(void) const
Definition: output.h:390
Type
Definition: elem.h:91
doublereal * pdRestartTimes
Definition: dataman.h:168
int Cleanup(void)
Definition: dataman.cc:668
const char * psElemNames[]
Definition: enums.cc:39
const doublereal & dGetInitialPositionStiffness(void) const
Definition: dataman2.cc:111
void ToBeUsedInAssembly(bool b)
Definition: dataman.h:578
NodeMapToListType NodeMapToList
Definition: dataman.h:732
std::map< unsigned, NodeContainerType::iterator > NodeMapToListType
Definition: dataman.h:710
void SetBufOutRaw(unsigned uL, integer n, const doublereal *p)
Definition: dataman2.cc:2804
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
bool bStaticModel
Definition: dataman.h:130
MBDynParser & MBPar
Definition: dataman.h:97
LinSol CurrSolver
Definition: dataman.h:127
Node ** InsertNode(NodeDataStructure &nodedata, unsigned int uLabel, Node *pN)
Definition: dataman.h:735
const Solver * GetSolver(void) const
Definition: dataman.h:343
OutputHandler::OutFiles OutFile
Definition: dataman.h:725
void GeneratesInertiaForces(bool b)
Definition: dataman.h:579
MBDynParser & GetMBDynParser(void) const
Definition: dataman.h:342
virtual void Update(void) const
Definition: dataman2.cc:2511
void DriveOutput(OutputHandler &OH) const
Definition: dataman2.cc:2429
integer iNumRestartTimes
Definition: dataman.h:169
std::ostream & Log(void) const
Definition: output.h:541
int datamanager_cleanup(void *)
Definition: dataman.cc:914
ModuleInsertMode
Definition: dataman.h:513
void UsesAirProperties(bool b)
Definition: dataman.h:580
InitialAssemblyElem * GetFirst(void) const
Definition: elman.cc:763
DriveHandler DrvHdl
Definition: dataman.h:104
void SetBufInRaw(unsigned uL, integer n, const doublereal *p)
Definition: dataman2.cc:2769
void OutputOpen(const OutputHandler::OutFiles out)
Definition: dataman.cc:677
struct DataManager::@30 DofData[DofOwner::LASTDOFTYPE]
std::map< std::string, DataManager::NodeRead *, ltstrcase > NodeReadType
Definition: dataman.h:707
virtual void AssMats(MatrixHandler &A_Hdl, MatrixHandler &B_Hdl)
Definition: elman.cc:447
virtual void AssConstrRes(VectorHandler &ResHdl, InverseDynamics::Order iOrder)
Definition: invdataman.cc:303
std::vector< Node * > NodeVecType
Definition: dataman.h:739
double doublereal
Definition: colamd.c:52
virtual Elem * pGetElem(void) const
Definition: nestedelem.cc:60
bool bUsesAirProperties(void) const
Definition: dataman.h:586
void ElemDataInit(void)
Definition: elman.cc:248
std::list< KeyElemPair > ElemContainerType
Definition: dataman.h:554
long int integer
Definition: colamd.c:51
Node ** ppFindNode(Node::Type Typ, unsigned int uNode) const
void NodeOutputPrepare(OutputHandler &OH)
Definition: nodeman.cc:119
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
virtual ~NodeRead(void)
Definition: dataman.h:701
double Real
Definition: mathtyp.h:39
unsigned int GetLabel(void) const
Definition: withlab.cc:62
struct DataManager::ElemDataStructure ElemData[Elem::LASTELEMTYPE]
void OutputEigNaiveMatrices(const MatrixHandler *pmMatA, const MatrixHandler *pmMatB, const unsigned uCurrEigSol, const int iMatrixPrecision)
Definition: dataman2.cc:1754
Node * pFindNode(Node::Type Typ, unsigned int uNode) const
Definition: nodeman.cc:179
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
DataManager::ElemContainerType::const_iterator end(Elem::Type t) const
Definition: dataman.cc:908
virtual const std::string & GetEqDescription(int i) const
Definition: dataman2.cc:2642
unsigned uPrintFlags
Definition: dataman.h:156
virtual ~DataManager(void)
Definition: dataman.cc:618
VariableSubMatrixHandler * pWorkMat
Definition: dataman.h:632
std::list< KeyNodePair > NodeContainerType
Definition: dataman.h:709
ScalarDof ReadScalarDof(const DataManager *pDM, MBDynParser &HP, bool bDof, bool bOrder)
Definition: dataman3.cc:2423
integer iGetNumDofs(void) const
Definition: dataman.h:809
virtual bool bIsActive(void) const
Definition: driven.cc:74
Mat3x3 R
bool bOutputAccels
Definition: dataman.h:119
VectorHandler * pXCurr
Definition: dataman.h:108
bool bIsInverseDynamics(void) const
Definition: dataman.h:493
bool bOutputAccelerations(void) const
Definition: dataman.cc:878
void ElemAssInit(void)
Definition: elman.cc:318
int iIDGetTotNumDofs(void) const
Definition: invdataman.cc:1092