MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
dofown.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/dofown.h,v 1.32 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 /* Strutture e classi relative ai Dof */
33 
34 #ifndef DOFOWN_H
35 #define DOFOWN_H
36 
37 #include <ac/f2c.h>
38 #include <myassert.h>
39 
40 extern const char* psDofOwnerNames[];
41 
42 /* ordine dei dof */
43 class DofOrder {
44  public:
45  enum Order {
46  UNKNOWN = -1,
47  ALGEBRAIC = 0,
49 
51  };
52 };
53 
54 
55 /* strutture per i Dof */
56 
57 class VectorHandler;
58 
59 struct Dof {
63  std::string Description;
64  std::string EqDescription;
65 };
66 
67 
68 struct DofOwner {
69 /* Tipi di DofOwner */
70  public:
71  enum Type {
72  UNKNOWN = -1,
78 
90 
92  };
93 
95  unsigned int iNumDofs;
97 
98  doublereal dGetScale(void) const;
99  void SetScale(const doublereal& d);
100 };
101 
102 /* Da questa classe derivano tutti gli elementi che possiedono Dof
103  * e che quindi sono esplicitamente costretti a dichiarare il metodo
104  * con cui inizializzano i vettori della soluzione */
106  private:
108 
109  public:
110  DofOwnerOwner(const DofOwner* pDO);
111  virtual ~DofOwnerOwner() { NO_OP; };
112 
113  virtual inline const DofOwner* pGetDofOwner(void) const {
114  ASSERT(pDofOwner != NULL);
115  return pDofOwner;
116  };
117 
118  /*
119  * Restituisce l'indice (-1) del primo Dof del nodo. Per ipotesi,
120  * gli indici di eventuali altri Dof sono consecutivi.
121  * Il primo Dof viene indirizzato nel modo seguente:
122  * - doublereal::X[Node::iGetFirstIndex()] se si usa un array c,
123  * - VectorHandler::operator()(Node::iGetFirstIndex()+1) se si usa un handler
124  * questa convenzione e' stata assunta per compatibilita' con le
125  * porzioni di codice scritte in FORTRAN
126  */
127  virtual inline integer iGetFirstIndex(void) const {
128  return pDofOwner->iFirstIndex;
129  };
130 
137  virtual void SetInitialValue(VectorHandler& X);
138 };
139 
140 #endif /* DOFOWN_H */
141 
DofOrder::Order Order
Definition: dofown.h:61
unsigned int iNumDofs
Definition: dofown.h:95
std::string Description
Definition: dofown.h:63
DofOwnerOwner(const DofOwner *pDO)
Definition: dofown.cc:49
virtual ~DofOwnerOwner()
Definition: dofown.h:111
virtual void SetInitialValue(VectorHandler &X)
Definition: dofown.cc:56
#define NO_OP
Definition: myassert.h:74
std::string EqDescription
Definition: dofown.h:64
integer iFirstIndex
Definition: dofown.h:94
virtual const DofOwner * pGetDofOwner(void) const
Definition: dofown.h:113
void SetScale(const doublereal &d)
Definition: dofown.cc:44
doublereal dGetScale(void) const
Definition: dofown.cc:38
const char * psDofOwnerNames[]
Definition: enums.cc:423
#define ASSERT(expression)
Definition: colamd.c:977
integer iIndex
Definition: dofown.h:60
const DofOwner * pDofOwner
Definition: dofown.h:107
DofOrder::Order EqOrder
Definition: dofown.h:62
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
Definition: dofown.h:59
doublereal dScale
Definition: dofown.h:96