MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
px.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/elec/px.cc,v 1.22 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 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
33 
34 #include "px.h"
35 
36 
37 /* PersistentExcitation - begin */
38 
40 : iNumDrives(i)
41 {
42  NO_OP;
43 }
44 
45 
47 {
48  NO_OP;
49 }
50 
51 
53 {
54  return iNumDrives;
55 }
56 
57 /* PersistentExcitation - end */
58 
59 
60 
63 {
64  NO_OP;
65 }
66 
67 
69 {
70  NO_OP;
71 }
72 
73 
75 {
76  NO_OP;
77 }
78 
79 
81 : PersistentExcitation(1), pDrive(NULL)
82 {
83  ASSERT(p != NULL);
85 }
86 
87 
89 {
91 }
92 
93 
95 {
96  pd[0] += pDrive->dGet();
97 }
98 
99 
101 : PersistentExcitation(i), pvDrives(NULL)
102 {
103 #ifdef DEBUG
104  ASSERT(iNumDrives > 0);
105  ASSERT(pp != NULL);
106  for (int i = iNumDrives; i-- > 0; ) {
107  ASSERT(pp[i] != NULL);
108  }
109 #endif // DEBUG
110 
112 
113  for (int i = iNumDrives; i-- > 0; ) {
114  pvDrives[i] = NULL;
116  }
117 
118  SAFEDELETEARR(pp);
119 }
120 
121 
123 {
124  for (int i = iNumDrives; i-- > 0; ) {
125  SAFEDELETE(pvDrives[i]);
126  }
128 }
129 
130 
132 {
133  for (int i = iNumDrives; i-- > 0; ) {
134  pd[i] += pvDrives[i]->dGet();
135  }
136 }
137 
virtual ~ScalarPX(void)
Definition: px.cc:88
virtual void AddInput(doublereal *pd) const
Definition: px.cc:131
ScalarPX(DriveCaller *p)
Definition: px.cc:80
virtual ~NullPX(void)
Definition: px.cc:68
virtual void AddInput(doublereal *pd) const
Definition: px.cc:94
int iNumDrives
Definition: px.h:39
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
#define NO_OP
Definition: myassert.h:74
DriveOwner ** pvDrives
Definition: px.h:70
virtual void AddInput(doublereal *pd) const
Definition: px.cc:74
virtual int iGetNumDrives(void) const
Definition: px.cc:52
virtual ~PersistentExcitation(void)
Definition: px.cc:46
PersistentExcitation(int i)
Definition: px.cc:39
VectorPX(int i, DriveCaller **p)
Definition: px.cc:100
#define ASSERT(expression)
Definition: colamd.c:977
NullPX(void)
Definition: px.cc:61
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual ~VectorPX(void)
Definition: px.cc:122
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
DriveOwner * pDrive
Definition: px.h:59
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710