MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
bulk.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/bulk.cc,v 1.31 2017/01/12 14:46:09 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 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
33 
34 #include "bulk.h"
35 #include "dataman.h"
36 
37 /* Legge un elemento bulk */
38 
39 Elem* ReadBulk(DataManager* pDM, MBDynParser& HP, unsigned int uLabel)
40 {
41  DEBUGCOUTFNAME("ReadBulk");
42 
43  const char* sKeyWords[] = {
44  "spring" "support",
45  NULL
46  };
47 
48  /* enum delle parole chiave */
49  enum KeyWords {
50  UNKNOWN = -1,
51  SPRINGSUPPORT = 0,
53  };
54 
55  /* tabella delle parole chiave */
56  KeyTable K(HP, sKeyWords);
57 
58  /* lettura del tipo di elemento elettrico */
59  KeyWords CurrKeyWord = KeyWords(HP.GetWord());
60 
61 #ifdef DEBUG
62  if (CurrKeyWord >= 0) {
63  std::cout << "bulk element type: "
64  << sKeyWords[CurrKeyWord] << std::endl;
65  }
66 #endif
67 
68  Elem* pEl = NULL;
69 
70  switch (CurrKeyWord) {
71  /* */
72  case SPRINGSUPPORT: {
73  ScalarDof SD = ReadScalarDof(pDM, HP, true, false);
74  DriveCaller* pDC = HP.GetDriveCaller();
75  flag fOut = pDM->fReadOutput(HP, Elem::BULK);
76 
79  BulkSpringSupport(uLabel, pDC, SD, fOut));
80 
81  break;
82  }
83 
84  /* Aggiungere altri elementi elettrici */
85 
86  default: {
87  silent_cerr("unknown bulk element type in bulk element " << uLabel
88  << " at line " << HP.GetLineData() << std::endl);
90  }
91  }
92 
93  /* Se non c'e' il punto e virgola finale */
94  if (HP.IsArg()) {
95  silent_cerr("semicolon expected at line "
96  << HP.GetLineData() << std::endl);
98  }
99 
100  return pEl;
101 } /* End of ReadBulk() */
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
long int flag
Definition: mbdyn.h:43
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define DEBUGCOUTFNAME(fname)
Definition: myassert.h:256
KeyWords
Definition: dataman4.cc:94
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
virtual int GetWord(void)
Definition: parser.cc:1083
Elem * ReadBulk(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: bulk.cc:39
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
ScalarDof ReadScalarDof(const DataManager *pDM, MBDynParser &HP, bool bDof, bool bOrder)
Definition: dataman3.cc:2423