MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
modalmappingext.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/modalmappingext.cc,v 1.37 2017/01/12 14:46:43 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 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
33 
34 #include "dataman.h"
35 #include "extedge.h"
36 #include "modaledge.h"
37 #include "modalmappingext.h"
38 
39 /* ModalMappingExt - begin */
40 
41 /* Costruttore */
44  const StructNode *pRefNode,
45  std::vector<const StructNode *>& n,
47  bool bOutputAccelerations,
48  ExtFileHandlerBase *pEFH,
49  ExtModalForceBase* pEMF,
50  bool bSendAfterPredict,
51  int iCoupling,
53  bool bUseReferenceNodeForces,
54  bool bRotateReferenceNodeForces,
55  flag fOut)
56 : Elem(uL, fOut),
57 ExtForce(uL, pDM, pEFH, bSendAfterPredict, iCoupling, fOut),
58 pEMF(pEMF),
59 uFlags(ExtModalForceBase::EMF_NONE),
60 bOutputAccelerations(bOutputAccelerations),
61 bUseReferenceNodeForces(bUseReferenceNodeForces),
62 bRotateReferenceNodeForces(bRotateReferenceNodeForces),
63 pRefNode(pRefNode),
64 pH(pH),
65 F0(Zero3), M0(Zero3),
66 F1(Zero3), M1(Zero3),
67 F2(Zero3), M2(Zero3)
68 {
69  ASSERT(pEMF != 0);
70 
71  ASSERT(pH != 0);
72 
74  ASSERT((bm & ~ExtModalForceBase::EMF_ALL) == 0);
75 
76  ASSERT(n.size() > 0);
77 
79  f.resize(6*n.size());
80  fill(f.begin(), f.end(), 0.);
81  p.resize(pH->iGetNumRows());
82  fill(p.begin(), p.end(), 0.);
83 
84  x.resize(6*n.size());
85  fill(x.begin(), x.end(), 0.);
86  xP.resize(6*n.size());
87  fill(xP.begin(), xP.end(), 0.);
88  q.resize(pH->iGetNumRows());
89  fill(q.begin(), q.end(), 0.);
90  qP.resize(pH->iGetNumRows());
91  fill(qP.begin(), qP.end(), 0.);
92 
94 
95  } else {
96  f.resize(0);
97  p.resize(0);
98 
99  x.resize(0);
100  xP.resize(0);
101  q.resize(0);
102  qP.resize(0);
103  }
104 
105  if (bm & ExtModalForceBase::EMF_RIGID) {
106  ASSERT(pRefNode != 0);
108  }
109 
110  Nodes.resize(n.size());
111  for (unsigned i = 0; i < n.size(); i++) {
112  Nodes[i].pNode = n[i];
113  ASSERT(Nodes[i].pNode != 0);
114 
115  if (pRefNode) {
116  Nodes[i].X0 = pRefNode->GetRCurr().MulTV(Nodes[i].pNode->GetXCurr() - pRefNode->GetXCurr());
117  Nodes[i].R0 = pRefNode->GetRCurr().MulTM(Nodes[i].pNode->GetRCurr());
118 
119  } else {
120  Nodes[i].X0 = Nodes[i].pNode->GetXCurr();
121  Nodes[i].R0 = Nodes[i].pNode->GetRCurr();
122  }
123 
124  Nodes[i].F = Zero3;
125  Nodes[i].M = Zero3;
126  }
127 }
128 
130 {
131  if (pEMF) {
132  SAFEDELETE(pEMF);
133  }
134 
135  if (pH) {
136  SAFEDELETE(pH);
137  }
138 }
139 
140 bool
142 {
143  return pEMF->Prepare(pEFH, GetLabel(),
145  pH->iGetNumRows());
146 }
147 
148 /*
149  * Send output to companion software
150  */
151 void
153 {
154  Vec3 X;
155  Mat3x3 R;
156  Vec3 V;
157  Vec3 W;
158 
160  X = pRefNode->GetXCurr();
161  R = pRefNode->GetRCurr();
162  V = pRefNode->GetVCurr();
163  W = pRefNode->GetWCurr();
164 
165  } else {
166  X = Zero3;
167  R = Eye3;
168  V = Zero3;
169  W = Zero3;
170  }
171 
172  if (pRefNode) {
173  for (unsigned i = 0; i < Nodes.size(); i++) {
174  Vec3 XRel = Nodes[i].pNode->GetXCurr() - X;
175 
176  x.Put(6*i + 1, R.MulTV(XRel) - Nodes[i].X0);
177  x.Put(6*i + 4, MatR2LinParam(R.MulTM(Nodes[i].pNode->GetRCurr().MulMT(Nodes[i].R0))));
178 
179  xP.Put(6*i + 1, R.MulTV(Nodes[i].pNode->GetVCurr() - V + XRel.Cross(W)));
180  xP.Put(6*i + 4, R.MulTV(Nodes[i].pNode->GetWCurr() - W));
181  }
182 
183  } else {
184  for (unsigned i = 0; i < Nodes.size(); i++) {
185  x.Put(6*i + 1, Nodes[i].pNode->GetXCurr() - Nodes[i].X0);
186  x.Put(6*i + 4, MatR2LinParam(Nodes[i].pNode->GetRCurr().MulMT(Nodes[i].R0)));
187 
188  xP.Put(6*i + 1, Nodes[i].pNode->GetVCurr());
189  xP.Put(6*i + 4, Nodes[i].pNode->GetWCurr());
190  }
191  }
192 
193  pH->MatVecMul(q, x);
194  pH->MatVecMul(qP, xP);
195 
196  pEMF->Send(pEFH, uFlags, GetLabel(), X, R, V, W, q, qP);
197 }
198 
199 void
201 {
202  unsigned uLabel = 0;
203  unsigned uOutFlags = pEMF->Recv(pEFH, uFlags, uLabel, F0, M0, p);
204 
205  if (uOutFlags & ExtModalForceBase::EMF_ERR) {
206  silent_cerr("ModalMappingExt(" << GetLabel() << "): "
207  "error while reading modal force data" << std::endl);
209  }
210 
211  if (uFlags != uOutFlags) {
212  silent_cerr("ModalMappingExt(" << GetLabel() << "): "
213  "error while reading modal force data "
214  "(" << uOutFlags << "!=" << uFlags << ")"
215  << std::endl);
217  }
218 
219  pH->MatTVecMul(f, p);
220 
221  if (pRefNode) {
222  const Vec3& XRef(pRefNode->GetXCurr());
223  const Mat3x3& RRef(pRefNode->GetRCurr());
224 
226  // initialize rigid body forces with values provided by peer
228  F1 = RRef*F0;
229  M1 = RRef*M0;
230 
231  } else {
232  F1 = F0;
233  M1 = M0;
234  }
235  }
236 
237  F2 = Zero3;
238  M2 = Zero3;
239  for (unsigned i = 0; i < Nodes.size(); i++) {
240  Nodes[i].F = RRef*Vec3(&f[6*i]);
241  Nodes[i].M = RRef*Vec3(&f[6*i + 3]);
242 
243  if ((bUseReferenceNodeForces || bToBeOutput()) && Nodes[i].pNode != pRefNode) {
244  F2 += Nodes[i].F;
245  M2 += Nodes[i].M + (Nodes[i].pNode->GetXCurr() - XRef).Cross(Nodes[i].F);
246  }
247  }
248 
250  F1 -= F2;
251  M1 -= M2;
252  }
253 
254  } else {
255  for (unsigned i = 0; i < Nodes.size(); i++) {
256  Nodes[i].F = Vec3(&f[6*i]);
257  Nodes[i].M = Vec3(&f[6*i + 3]);
258  }
259  }
260 }
261 
264 {
265  return Force::EXTERNALMODAL;
266 }
267 
268 void
269 ModalMappingExt::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
270 {
271  if (iCoupling == COUPLING_NONE) {
272  *piNumRows = 0;
273  *piNumCols = 0;
274 
275  } else {
276  *piNumRows = (pRefNode ? 6 : 0) + 6*Nodes.size();
277  *piNumCols = 1;
278  }
279 }
280 
283  doublereal dCoef,
284  const VectorHandler& XCurr,
285  const VectorHandler& XPrimeCurr)
286 {
287  ExtForce::Recv();
288 
289  if (iCoupling == COUPLING_NONE) {
290  WorkVec.Resize(0);
291  return WorkVec;
292  }
293 
294  integer iR, iC;
295  WorkSpaceDim(&iR, &iC);
296  WorkVec.ResizeReset(iR);
297 
298  integer iIdx = 0;
300  integer iFirstIndex = pRefNode->iGetFirstMomentumIndex();
301 
302  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
303  WorkVec.PutRowIndex(iCnt, iFirstIndex + iCnt);
304  }
305 
306  WorkVec.Put(1, F1);
307  WorkVec.Put(4, M1);
308  }
309 
310  if (pRefNode) {
311  iIdx += 6;
312  }
313 
315  for (unsigned i = 0; i < Nodes.size(); i++) {
316  integer iIndex = Nodes[i].pNode->iGetFirstMomentumIndex();
317  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
318  WorkVec.PutRowIndex(iIdx + iCnt, iIndex + iCnt);
319  }
320 
321  WorkVec.Put(iIdx + 1, Nodes[i].F);
322  WorkVec.Put(iIdx + 4, Nodes[i].M);
323 
324  iIdx += 6;
325  }
326  }
327 
328  return WorkVec;
329 }
330 
331 void
333 {
334  if (bToBeOutput()) {
335  if (OH.UseText(OutputHandler::FORCES)) {
336  std::ostream& out = OH.Forces();
337 
339  out << GetLabel() << "@" << pRefNode->GetLabel()
340  << " " << F0 << " " << M0
341  << " " << F1 << " " << M1
342  << " " << F2 << " " << M2
343  << std::endl;
344  }
345 
347  for (unsigned i = 0; i < p.size(); i++) {
348  out << GetLabel() << '.' << i + 1
349  << " " << p[i]
350  << " " << q[i]
351  << " " << qP[i]
352  << std::endl;
353  }
354 
355  for (unsigned i = 0; i < Nodes.size(); i++) {
356  const double *px = &x[6*i];
357  const double *pxP = &xP[6*i];
358  out << GetLabel() << '#' << Nodes[i].pNode->GetLabel()
359  << " " << Nodes[i].F
360  << " " << Nodes[i].M
361  << " " << px[0]
362  << " " << px[1]
363  << " " << px[2]
364  << " " << px[3]
365  << " " << px[4]
366  << " " << px[5]
367  << " " << pxP[0]
368  << " " << pxP[1]
369  << " " << pxP[2]
370  << " " << pxP[3]
371  << " " << pxP[4]
372  << " " << pxP[5]
373  << std::endl;
374  }
375  }
376  }
377 
378  /* TODO: NetCDF */
379  }
380 }
381 
382 void
383 ModalMappingExt::GetConnectedNodes(std::vector<const Node *>& connectedNodes) const
384 {
385  unsigned iOff = 0;
386  if (pRefNode) {
387  iOff = 1;
388  }
389 
390  connectedNodes.resize(iOff + Nodes.size());
391 
392  if (iOff) {
393  connectedNodes[0] = pRefNode;
394  }
395 
396  for (unsigned i = 0; i < Nodes.size(); i++) {
397  connectedNodes[iOff + i] = Nodes[i].pNode;
398  }
399 }
400 
403 {
404  bool bSparse;
405  if (HP.IsKeyWord("full" "mapping" "file")) {
406  bSparse = false;
407 
408  } else if (HP.IsKeyWord("sparse" "mapping" "file")) {
409  bSparse = true;
410 
411  } else {
412  silent_cerr("mapping file expected "
413  "at line " << HP.GetLineData() << std::endl);
415  }
416 
417  doublereal dThreshold = 0.;
418  if (HP.IsKeyWord("threshold")) {
419  dThreshold = HP.GetReal();
420  if (dThreshold < 0.) {
421  silent_cerr("invalid threshold " << dThreshold
422  << " at line " << HP.GetLineData() << std::endl);
424  }
425  }
426 
427  const char *sFileName = HP.GetFileName();
428  if (sFileName == 0) {
429  silent_cerr("unable to read mapping file name "
430  "at line " << HP.GetLineData() << std::endl);
432  }
433 
434  std::ifstream in(sFileName);
435  if (!in) {
436  silent_cerr("unable to open mapping file "
437  "\"" << sFileName << "\" "
438  "at line " << HP.GetLineData() << std::endl);
440  }
441 
442  char c = in.get();
443  while (c == '#') {
444  do {
445  c = in.get();
446  } while (c != '\n');
447  c = in.get();
448  }
449  in.putback(c);
450 
451  bool bComputeRows(nRows < 0);
452  bool bComputeCols(nCols < 0);
453 
454  if (bComputeRows || bComputeCols) {
455  std::streampos pos = in.tellg();
456  integer nVals;
457 
458  if (bSparse) {
459  for (nVals = 0; !in.eof(); nVals++) {
460  integer ir, ic;
461  doublereal d;
462  in >> ir >> ic >> d;
463 
464  if (bComputeRows) {
465  if (ir > nRows) {
466  nRows = ir;
467  }
468 
469  } else {
470  if (ir > nRows) {
471  silent_cerr("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
472  "inconsistent row=" << ir << " for coefficient #" << nVals << std::endl);
474  }
475  }
476 
477  if (bComputeCols) {
478  if (ic > nCols) {
479  nCols = ic;
480  }
481 
482  } else {
483  if (ic > nCols) {
484  silent_cerr("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
485  "inconsistent col=" << ic << " for coefficient #" << nVals << std::endl);
487  }
488  }
489  }
490  nVals--;
491 
492  } else {
493  if (bComputeRows && bComputeCols) {
494  silent_cerr("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
495  "cannot compute both row and col numbers" << std::endl);
497  }
498 
499  for (nVals = 0; !in.eof(); nVals++) {
500  doublereal d;
501 
502  in >> d;
503  }
504  nVals--;
505 
506  if (bComputeRows) {
507  if ((nVals % nCols) != 0) {
508  silent_cerr("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
509  "vals=" << nVals << " is not a multiple of cols=" << nCols << std::endl);
511  }
512 
513  nRows = nVals/nCols;
514 
515  } else if (bComputeCols) {
516  if ((nVals % nRows) != 0) {
517  silent_cerr("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
518  "vals=" << nVals << " is not a multiple of rows=" << nRows << std::endl);
520  }
521 
522  nCols = nVals/nRows;
523  }
524  }
525 
526  in.clear();
527  in.seekg(pos);
528 
529  silent_cout("ReadSparseMappingMatrix(\"" << sFileName << "\"): "
530  "rows=" << nRows
531  << " cols=" << nCols
532  << " vals=" << nVals
533  << std::endl);
534  }
535 
536  SpMapMatrixHandler *pH = 0;
538  SpMapMatrixHandler(nRows, nCols));
539 
540  if (bSparse) {
541  integer ir, ic, cnt = 0, nzcnt = 0;
542  doublereal d;
543  while (in >> ir >> ic >> d) {
544  if (ir <= 0 || ir > nRows || ic <= 0 || ic > nCols) {
545  silent_cerr("invalid row(=" << ir << ")/col(=" << ic <<") number for coefficient #" << cnt << " "
546  "from file \"" << sFileName << "\"" << std::endl);
548  }
549 
550  if (std::abs(d) > dThreshold) {
551  (*pH)(ir, ic) = d;
552  nzcnt++;
553  }
554 
555  cnt++;
556  }
557 
558  pedantic_cout("got " << cnt << " nonzeros (" << nzcnt << " actually stored) from file \"" << sFileName << "\"" << std::endl);
559 
560  } else {
561  int nzcnt = 0;
562  for (integer ir = 1; ir <= nRows; ir++) {
563  for (integer ic = 1; ic <= nCols; ic++) {
564  doublereal d;
565  in >> d;
566  if (!in) {
567  silent_cerr("unable to read coefficient(" << ir << ", " << ic << ") "
568  "from file \"" << sFileName << "\"" << std::endl);
570  }
571  if (std::abs(d) > dThreshold) {
572  (*pH)(ir, ic) = d;
573  nzcnt++;
574  }
575  }
576  }
577  pedantic_cout("got " << nzcnt << " nonzeros from file \"" << sFileName << "\"" << std::endl);
578  }
579 
580  return pH;
581 }
582 
583 Elem*
585  MBDynParser& HP,
586  unsigned int uLabel)
587 {
588  ExtFileHandlerBase *pEFH = 0;
589  int iCoupling = -1;
590  bool bSendAfterPredict = false;
591  ReadExtForce(pDM, HP, uLabel, pEFH, bSendAfterPredict, iCoupling);
592 
593  const StructNode *pRefNode = 0;
594  if (HP.IsKeyWord("reference" "node")) {
595  pRefNode = pDM->ReadNode<const StructNode, Node::STRUCTURAL>(HP);
596  }
597 
598  bool bUseReferenceNodeForces(pRefNode != 0 ? true : false);
599  bool bRotateReferenceNodeForces(true);
600  if (pRefNode != 0 && HP.IsKeyWord("use" "rigid" "body" "forces")) {
601  if (!HP.GetYesNo(bUseReferenceNodeForces)) {
602  silent_cerr("ModalMappingExt(" << uLabel << "): "
603  "\"use rigid body forces\" must be either \"yes\" or \"no\" "
604  "at line " << HP.GetLineData() << std::endl);
606  }
607 
608  if (bUseReferenceNodeForces && HP.IsKeyWord("rotate" "rigid" "body" "forces")) {
609  if (!HP.GetYesNo(bRotateReferenceNodeForces)) {
610  silent_cerr("ModalMappingExt(" << uLabel << "): "
611  "\"rotate rigid body forces\" must be either \"yes\" or \"no\" "
612  "at line " << HP.GetLineData() << std::endl);
614  }
615  }
616  }
617 
618  bool bOutputAccelerations(false);
619  if (HP.IsKeyWord("accelerations")) {
620  bOutputAccelerations = true;
621  }
622 
623  // safe default: both rigid and modal
625  if (HP.IsKeyWord("type")) {
626  if (HP.IsKeyWord("rigid")) {
628  } else if (HP.IsKeyWord("modal")) {
630  } else if (HP.IsKeyWord("all")) {
632  } else {
633  silent_cerr("ModalMappingExt(" << uLabel << "): unknown ModalMappingExt type "
634  " at line " << HP.GetLineData() << std::endl);
636  }
637  }
638 
639  ExtModalForceBase *pEMF = 0;
640  if (dynamic_cast<ExtFileHandlerEDGE *>(pEFH) != 0) {
641  // EDGE needs two separate ModalMappingExt elements,
642  // one for the rigid part and one for the modal part
643 
644  switch (bm & ExtModalForceBase::EMF_ALL) {
647  ExtRigidForceEDGE(pDM));
648  break;
649 
652  ExtModalForceEDGE(pDM));
653  break;
654 
655  case ExtModalForceBase::EMF_ALL:
656  silent_cerr("ModalMappingExt(" << uLabel << "): "
657  "EDGE ExtFileHandler can only be used "
658  "when ModalMappingExt is either \"rigid\" "
659  "or \"modal\" but not when it is \"all\" "
660  " at line " << HP.GetLineData() << std::endl);
662 
663  default:
664  ASSERT(0);
665  throw ErrGeneric(MBDYN_EXCEPT_ARGS);
666  }
667 
668 #ifdef USE_SOCKET
669  } else if (dynamic_cast<ExtSocketHandler *>(pEFH) != 0) {
670  SAFENEW(pEMF, ExtModalForce);
671 #endif // USE_SOCKET
672 
673  // add more types
674 
675  } else {
676  silent_cerr("ModalMappingExt(" << uLabel << "): "
677  "unknown external force type" << std::endl);
679  }
680 
681  if (!HP.IsKeyWord("nodes" "number")) {
682  silent_cerr("ModalMappingExt(" << uLabel << "): "
683  "\"nodes number\" keyword expected "
684  "at line " << HP.GetLineData() << std::endl);
686  }
687  int nNodes = HP.GetInt();
688  if (nNodes <= 0) {
689  silent_cerr("ModalMappingExt(" << uLabel << "): "
690  "invalid nodes number "
691  "at line " << HP.GetLineData() << std::endl);
693  }
694  std::vector<const StructNode *> n(nNodes);
695  for (int i = 0; i < nNodes; i++) {
696  n[i] = pDM->ReadNode<const StructNode, Node::STRUCTURAL>(HP);
697  }
698 
699  if (!HP.IsKeyWord("modes" "number")) {
700  silent_cerr("ModalMappingExt(" << uLabel << "): "
701  "\"modes number\" keyword expected "
702  "at line " << HP.GetLineData() << std::endl);
704  }
705  int nModes = -1;
706  if (!HP.IsKeyWord("from" "file")) {
707  nModes = HP.GetInt();
708  if (nModes <= 0) {
709  silent_cerr("ModalMappingExt(" << uLabel << "): "
710  "invalid modes number "
711  "at line " << HP.GetLineData() << std::endl);
713  }
714  }
715 
716  integer nCols = 6*nNodes;
717  SpMapMatrixHandler *pH = ReadSparseMappingMatrix(HP, nModes, nCols);
718  ASSERT(nCols == 6*nNodes);
719 
720  flag fOut = pDM->fReadOutput(HP, Elem::FORCE);
721 
722  if (HP.IsArg()) {
723  silent_cerr("ModalMappingExt(" << uLabel << "): "
724  "semicolon expected at line "
725  << HP.GetLineData() << std::endl);
726  SAFEDELETE(pH);
728  }
729 
730  Elem *pEl = 0;
732  ModalMappingExt(uLabel, pDM, pRefNode, n, pH,
733  bOutputAccelerations,
734  pEFH, pEMF, bSendAfterPredict, iCoupling, bm,
735  bUseReferenceNodeForces, bRotateReferenceNodeForces, fOut));
736 
737  return pEl;
738 }
739 
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
SpMapMatrixHandler * pH
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
bool bUseReferenceNodeForces
long int flag
Definition: mbdyn.h:43
virtual bool bToBeOutput(void) const
Definition: output.cc:890
STLVectorHandler x
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
void Recv(void)
Definition: extforce.cc:798
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
virtual void Output(OutputHandler &OH) const
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
Type
Definition: force.h:50
integer iGetNumRows(void) const
Definition: spmh.h:113
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
virtual const char * GetFileName(enum Delims Del=DEFAULTDELIM)
Definition: parsinc.cc:673
virtual bool Prepare(ExtFileHandlerBase *pEFH, unsigned uLabel, bool bRigid, unsigned uModes)=0
void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Elem * ReadModalMappingExtForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
virtual Force::Type GetForceType(void) const
ExtModalForceBase * pEMF
STLVectorHandler p
STLVectorHandler q
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
#define SAFENEW(pnt, item)
Definition: mynewmem.h:695
DataManager * pDM
Definition: mbpar.h:252
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual void Put(integer iRow, const Vec3 &v)
Definition: stlvh.cc:181
void Send(ExtFileHandlerBase *pEFH, ExtFileHandlerBase::SendWhen when)
virtual integer iGetFirstMomentumIndex(void) const =0
virtual void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
unsigned int uLabel
Definition: withlab.h:44
#define ASSERT(expression)
Definition: colamd.c:977
STLVectorHandler f
virtual unsigned Recv(ExtFileHandlerBase *pEFH, unsigned uFlags, unsigned &uLabel, Vec3 &f, Vec3 &m, std::vector< doublereal > &fv)=0
Mat3x3 MulTM(const Mat3x3 &m) const
Definition: matvec3.cc:500
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
const StructNode * pRefNode
bool bRotateReferenceNodeForces
Vec3 MatR2LinParam(const Mat3x3 &m)
Definition: matvec3.cc:772
static std::stack< cleanup * > c
Definition: cleanup.cc:59
virtual ~ModalMappingExt(void)
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
ModalMappingExt(unsigned int uL, DataManager *pDM, const StructNode *pRefNode, std::vector< const StructNode * > &n, SpMapMatrixHandler *pH, bool bOutputAccelerations, ExtFileHandlerBase *pEFH, ExtModalForceBase *pEMF, bool bSendAfterPredict, int iCoupling, ExtModalForceBase::BitMask bm, bool bUseReferenceNodeForces, bool bRotateReferenceNodeForces, flag fOut)
virtual bool GetYesNo(bool &bRet)
Definition: parser.cc:1022
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
std::vector< NodeData > Nodes
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
STLVectorHandler qP
virtual VectorHandler & MatTVecMul(VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:341
STLVectorHandler xP
double doublereal
Definition: colamd.c:52
int iCoupling
Definition: extforce.h:212
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
bool Prepare(ExtFileHandlerBase *pEFH)
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
virtual VectorHandler & MatVecMul(VectorHandler &out, const VectorHandler &in) const
Definition: mh.cc:332
void ReadExtForce(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, ExtFileHandlerBase *&pEFH, bool &bSendAfterPredict, int &iCoupling)
Definition: extforce.cc:1141
virtual void Send(ExtFileHandlerBase *pEFH, unsigned uFlags, unsigned uLabel, const Vec3 &x, const Mat3x3 &R, const Vec3 &v, const Vec3 &w, const std::vector< doublereal > &q, const std::vector< doublereal > &qP)=0
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
virtual void Resize(integer iNewSize)=0
std::ostream & Forces(void) const
Definition: output.h:450
Mat3x3 R
bool UseText(int out) const
Definition: output.cc:446
SpMapMatrixHandler * ReadSparseMappingMatrix(MBDynParser &HP, integer &nRows, integer &nCols)
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056