MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
strmappingext.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/strmappingext.h,v 1.11 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 STREXTMAPPING_H
35 #define STREXTMAPPING_H
36 
37 #include <vector>
38 #include <string>
39 
40 #include "extforce.h"
41 #include "spmapmh.h"
42 #include "stlvh.h"
43 
44 /* StructMappingExtForce - begin */
45 
46 class StructMappingExtForce : virtual public Elem, public ExtForce {
47 protected:
54 
55  // Mapping matrix
57 
58  struct OffsetData {
59  unsigned uLabel;
62  };
63 
64  struct NodeData {
66  std::vector<OffsetData> Offsets;
69  };
70 
71  unsigned m_uResSize;
72 
73  std::vector<NodeData> Nodes;
74  unsigned uPoints;
75  unsigned uMappedPoints;
76 
77  bool bLabels;
79 
80  unsigned uRRot;
81 
82  std::vector<uint32_t> m_qlabels;
83 
90 
93 
97 
98  virtual void SendToStream(std::ostream& outf, ExtFileHandlerBase::SendWhen when);
99  virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when);
100  virtual void RecvFromStream(std::istream& inf);
101  virtual void RecvFromFileDes(int infd);
102 
103 public:
104  /* Costruttore */
105  StructMappingExtForce(unsigned int uL,
106  DataManager *pDM,
107  const StructNode *pRefNode,
110  std::vector<const StructDispNode *>& Nodes,
111  std::vector<Vec3>& Offsets,
112  std::vector<unsigned>& Labels,
114  std::vector<uint32_t>& MappedLabels,
115  bool bLabels,
117  unsigned uRRot,
119  bool bSendAfterPredict,
120  int iCoupling,
121  flag fOut);
122 
123  virtual ~StructMappingExtForce(void);
124 
125  /* Tipo di forza */
126  virtual Force::Type GetForceType(void) const {
128  };
129 
130  void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
131 
133  doublereal dCoef,
134  const VectorHandler& XCurr,
135  const VectorHandler& XPrimeCurr);
136 
137  virtual void Output(OutputHandler& OH) const;
138 
139  /* *******PER IL SOLUTORE PARALLELO******** */
140  /* Fornisce il tipo e la label dei nodi che sono connessi all'elemento
141  * utile per l'assemblaggio della matrice di connessione fra i dofs */
142  virtual void
143  GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
144  /* ************************************************ */
145 };
146 
147 /* StructMappingExtForce - end */
148 
149 /* StructMembraneMappingExtForce - begin */
150 
152 public:
153  struct NodeConnData {
157  };
158 
159 protected:
160  std::vector<NodeConnData> NodesConn;
161 
162  virtual void SendToStream(std::ostream& outf, ExtFileHandlerBase::SendWhen when);
163  virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when);
164  virtual void RecvFromStream(std::istream& inf);
165  virtual void RecvFromFileDes(int infd);
166 
167 public:
168  /* Costruttore */
169  StructMembraneMappingExtForce(unsigned int uL,
170  DataManager *pDM,
171  const StructNode *pRefNode,
174  std::vector<const StructDispNode *>& Nodes,
175  std::vector<Vec3>& Offsets,
176  std::vector<unsigned>& Labels,
177  std::vector<NodeConnData>& NodesConn,
179  std::vector<uint32_t>& MappedLabels,
180  bool bLabels,
182  unsigned uRRot,
184  bool bSendAfterPredict,
185  int iCoupling,
186  flag fOut);
187 
188  virtual ~StructMembraneMappingExtForce(void);
189 };
190 
191 /* StructMembraneMappingExtForce - end */
192 
193 class DataManager;
194 class MBDynParser;
195 
196 extern Elem*
198  MBDynParser& HP,
199  unsigned int uLabel);
200 
201 #endif // STREXTMAPPING_H
202 
STLVectorHandler m_xPP
Definition: strmappingext.h:86
long int flag
Definition: mbdyn.h:43
STLVectorHandler m_qPP
Definition: strmappingext.h:89
Definition: matvec3.h:98
void Recv(void)
Definition: extforce.cc:798
Type
Definition: force.h:50
virtual void RecvFromStream(std::istream &inf)
virtual ~StructMappingExtForce(void)
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
bool bSendAfterPredict
Definition: extforce.h:196
StructMappingExtForce(unsigned int uL, DataManager *pDM, const StructNode *pRefNode, bool bUseReferenceNodeForces, bool bRotateReferenceNodeForces, std::vector< const StructDispNode * > &Nodes, std::vector< Vec3 > &Offsets, std::vector< unsigned > &Labels, SpMapMatrixHandler *pH, std::vector< uint32_t > &MappedLabels, bool bLabels, bool bOutputAccelerations, unsigned uRRot, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, flag fOut)
std::vector< uint32_t > m_qlabels
Definition: strmappingext.h:82
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
STLVectorHandler m_x
Definition: strmappingext.h:84
std::vector< NodeData > Nodes
Definition: strmappingext.h:73
virtual void SendToStream(std::ostream &outf, ExtFileHandlerBase::SendWhen when)
virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when)
bool Prepare(ExtFileHandlerBase *pEFH)
std::vector< OffsetData > Offsets
Definition: strmappingext.h:66
virtual void RecvFromFileDes(int infd)
DataManager * pDM
Definition: mbpar.h:252
ExtFileHandlerBase * pEFH
Definition: extforce.h:193
virtual void Output(OutputHandler &OH) const
virtual void SendToStream(std::ostream &outf, ExtFileHandlerBase::SendWhen when)
std::vector< NodeConnData > NodesConn
virtual Force::Type GetForceType(void) const
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
STLVectorHandler m_q
Definition: strmappingext.h:87
virtual void RecvFromStream(std::istream &inf)
Definition: elem.h:75
virtual ~StructMembraneMappingExtForce(void)
void Send(ExtFileHandlerBase *pEFH, ExtFileHandlerBase::SendWhen when)
STLVectorHandler m_p
Definition: strmappingext.h:92
StructMembraneMappingExtForce(unsigned int uL, DataManager *pDM, const StructNode *pRefNode, bool bUseReferenceNodeForces, bool bRotateReferenceNodeForces, std::vector< const StructDispNode * > &Nodes, std::vector< Vec3 > &Offsets, std::vector< unsigned > &Labels, std::vector< NodeConnData > &NodesConn, SpMapMatrixHandler *pH, std::vector< uint32_t > &MappedLabels, bool bLabels, bool bOutputAccelerations, unsigned uRRot, ExtFileHandlerBase *pEFH, bool bSendAfterPredict, int iCoupling, flag fOut)
SpMapMatrixHandler * pH
Definition: strmappingext.h:56
Elem * ReadStructMappingExtForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
virtual void RecvFromFileDes(int infd)
double doublereal
Definition: colamd.c:52
int iCoupling
Definition: extforce.h:212
long int integer
Definition: colamd.c:51
const StructDispNode * pNode
Definition: strmappingext.h:65
const StructNode * pRefNode
Definition: strmappingext.h:48
STLVectorHandler m_xP
Definition: strmappingext.h:85
virtual void SendToFileDes(int outfd, ExtFileHandlerBase::SendWhen when)
STLVectorHandler m_qP
Definition: strmappingext.h:88
STLVectorHandler m_f
Definition: strmappingext.h:91