MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
strext.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/strext.h,v 1.35 2017/01/12 14:46:44 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 2007-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 /* Forza */
33 
34 #ifndef STREXT_H
35 #define STREXT_H
36 
37 #include <vector>
38 #include <string>
39 
40 #include "extforce.h"
41 
42 /* StructExtForce - begin */
43 
44 class StructExtForce : virtual public Elem, public ExtForce {
45  // hack to recycle SendToStream for echo
46  friend Elem* ReadStructExtForce(DataManager* pDM, MBDynParser& HP, unsigned int uLabel);
47 
48 protected:
55  unsigned uOutputFlags;
56 
57 public:
58  struct PointData {
59  unsigned uLabel;
60  const StructNode *pNode;
64  };
65 
66 protected:
67  std::vector<PointData> m_Points;
68 
69  bool bLabels;
70  bool bSorted;
71  std::vector<bool> done;
72 
73  unsigned uRot;
75 
76  // buffer for filedes I/O
77  unsigned dynamics_size;
78  std::vector<char> iobuf;
79  uint32_t *iobuf_labels;
90 
94 
95  virtual void SendToStream(std::ostream& outf, ExtFileHandlerBase::SendWhen when);
96  virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when);
97  virtual void RecvFromStream(std::istream& inf);
98  virtual void RecvFromFileDes(int infd);
99 
100 public:
101  /* Costruttore */
102  StructExtForce(unsigned int uL,
103  DataManager *pDM,
104  const StructNode *pRefNode,
107  std::vector<unsigned>& Labels,
108  std::vector<const StructNode *>& Nodes,
109  std::vector<Vec3>& Offsets,
110  bool bSorted,
111  bool bLabels,
113  unsigned bRot,
115  bool bSendAfterPredict,
116  int iCoupling,
117  unsigned uOutputFlags,
118  flag fOut);
119 
120  virtual ~StructExtForce(void);
121 
122  /* Tipo di forza */
123  virtual Force::Type GetForceType(void) const {
125  };
126 
127  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
128 
130  doublereal dCoef,
131  const VectorHandler& XCurr,
132  const VectorHandler& XPrimeCurr);
133 
134  virtual void Output(OutputHandler& OH) const;
135 
136  /* *******PER IL SOLUTORE PARALLELO******** */
137  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
138  * utile per l'assemblaggio della matrice di connessione fra i dofs */
139  virtual void
140  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
141  /* ************************************************ */
142 };
143 
144 /* StructExtForce - end */
145 
146 class DataManager;
147 class MBDynParser;
148 
149 extern Elem*
151  MBDynParser& HP,
152  unsigned int uLabel);
153 
154 #endif // STREXT_H
155 
doublereal * iobuf_R
Definition: strext.h:81
virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when)
Definition: strext.cc:644
doublereal * iobuf_m
Definition: strext.h:89
long int flag
Definition: mbdyn.h:43
doublereal * iobuf_xp
Definition: strext.h:84
Definition: matvec3.h:98
std::vector< char > iobuf
Definition: strext.h:78
void Recv(void)
Definition: extforce.cc:798
doublereal * iobuf_euler_123
Definition: strext.h:83
Type
Definition: force.h:50
bool bSendAfterPredict
Definition: extforce.h:196
const StructNode * pNode
Definition: strext.h:60
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: strext.cc:1344
std::vector< bool > done
Definition: strext.h:71
StructExtForce(unsigned int uL, DataManager *pDM, const StructNode *pRefNode, bool bUseReferenceNodeForces, bool bRotateReferenceNodeForces, std::vector< unsigned > &Labels, std::vector< const StructNode * > &Nodes, std::vector< Vec3 > &Offsets, bool bSorted, bool bLabels, bool bOutputAccelerations, unsigned bRot, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, unsigned uOutputFlags, flag fOut)
Definition: strext.cc:47
bool bLabels
Definition: strext.h:69
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: strext.cc:253
void Send(ExtFileHandlerBase *pEFH, ExtFileHandlerBase::SendWhen when)
Definition: strext.cc:430
bool Prepare(ExtFileHandlerBase *pEFH)
Definition: strext.cc:266
friend Elem * ReadStructExtForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: strext.cc:1352
virtual void Output(OutputHandler &OH) const
Definition: strext.cc:1238
virtual ~StructExtForce(void)
Definition: strext.cc:247
bool bOutputAccelerations
Definition: strext.h:74
bool bSorted
Definition: strext.h:70
DataManager * pDM
Definition: mbpar.h:252
std::vector< PointData > m_Points
Definition: strext.h:67
doublereal * iobuf_theta
Definition: strext.h:82
doublereal * iobuf_xpp
Definition: strext.h:86
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
bool bUseReferenceNodeForces
Definition: strext.h:50
unsigned int uLabel
Definition: withlab.h:44
Elem * ReadStructExtForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: strext.cc:1352
virtual void SendToStream(std::ostream &outf, ExtFileHandlerBase::SendWhen when)
Definition: strext.cc:442
virtual void RecvFromStream(std::istream &inf)
Definition: strext.cc:833
virtual Force::Type GetForceType(void) const
Definition: strext.h:123
Definition: elem.h:75
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: strext.cc:1126
unsigned uRot
Definition: strext.h:73
doublereal * iobuf_omegap
Definition: strext.h:87
unsigned dynamics_size
Definition: strext.h:77
double doublereal
Definition: colamd.c:52
uint32_t * iobuf_labels
Definition: strext.h:79
int iCoupling
Definition: extforce.h:212
long int integer
Definition: colamd.c:51
doublereal * iobuf_omega
Definition: strext.h:85
bool bRotateReferenceNodeForces
Definition: strext.h:51
unsigned uOutputFlags
Definition: strext.h:55
const StructNode * pRefNode
Definition: strext.h:49
doublereal * iobuf_x
Definition: strext.h:80
doublereal * iobuf_f
Definition: strext.h:88
virtual void RecvFromFileDes(int infd)
Definition: strext.cc:961