MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
CompTDCR< T > Class Template Reference
Inheritance diagram for CompTDCR< T >:
Collaboration diagram for CompTDCR< T >:

Public Member Functions

virtual TplDriveCaller< T > * Read (const DataManager *pDM, MBDynParser &HP)
 
- Public Member Functions inherited from TplDriveCallerRead< T >
virtual ~TplDriveCallerRead (void)
 

Detailed Description

template<class T>
class CompTDCR< T >

Definition at line 415 of file tpldrive_impl.cc.

Member Function Documentation

template<class T >
virtual TplDriveCaller<T>* CompTDCR< T >::Read ( const DataManager pDM,
MBDynParser HP 
)
inlinevirtual

Implements TplDriveCallerRead< T >.

Definition at line 418 of file tpldrive_impl.cc.

References MBDynParser::GetDriveCaller(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, DriveCaller::pCopy(), SAFENEW, and SAFENEWWITHCONSTRUCTOR.

418  {
419  std::vector<DriveCaller *> dc;
420  unsigned nr = 0, nc = 1;
421  if (typeid(T) == typeid(Vec3)) {
422  nr = 3;
423 
424  } else if (typeid(T) == typeid(Vec6)) {
425  nr = 6;
426 
427  } else if (typeid(T) == typeid(Mat3x3)) {
428  nr = 3;
429  nc = 3;
430 
431  } else if (typeid(T) == typeid(Mat6x6)) {
432  nr = 6;
433  nc = 6;
434 
435  } else {
436  silent_cerr("component template drive used with unknown type" << std::endl);
438  }
439 
440  dc.resize(nr*nc);
441 
442  if (nc > 1 && HP.IsKeyWord("sym")) {
443  for (unsigned ir = 0; ir < nr; ir++) {
444  for (unsigned ic = ir; ic < nc; ic++) {
445  if (HP.IsKeyWord("inactive")) {
446  dc[nc*ir + ic] = 0;
447  SAFENEW(dc[nc*ir + ic], NullDriveCaller);
448 
449  } else {
450  dc[nc*ir + ic] = HP.GetDriveCaller();
451  }
452 
453  if (ic > ir) {
454  dc[nc*ic + ir] = dc[nc*ir + ic]->pCopy();
455  }
456  }
457  }
458 
459  } else if (nc > 1 && HP.IsKeyWord("diag")) {
460  for (unsigned ir = 0; ir < nr; ir++) {
461  if (HP.IsKeyWord("inactive")) {
462  dc[nc*ir + ir] = 0;
463  SAFENEW(dc[nc*ir + ir], NullDriveCaller);
464 
465  } else {
466  dc[nc*ir + ir] = HP.GetDriveCaller();
467  }
468 
469  for (unsigned ic = ir + 1; ic < nc; ic++) {
470  dc[nc*ir + ic] = 0;
471  SAFENEW(dc[nc*ir + ic], NullDriveCaller);
472  dc[nc*ic + ir] = dc[nc*ir + ic]->pCopy();
473  }
474  }
475 
476  } else {
477  for (unsigned i = 0; i < dc.size(); i++) {
478  if (HP.IsKeyWord("inactive")) {
479  dc[i] = 0;
480  SAFENEW(dc[i], NullDriveCaller);
481 
482  } else {
483  dc[i] = HP.GetDriveCaller();
484  }
485  }
486  }
487 
488  TplDriveCaller<T>* pTplDC = 0;
489 
490  SAFENEWWITHCONSTRUCTOR(pTplDC,
493 
494  return pTplDC;
495  };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
Definition: matvec6.h:37
#define SAFENEW(pnt, item)
Definition: mynewmem.h:695
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual DriveCaller * pCopy(void) const =0
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033

Here is the call graph for this function:


The documentation for this class was generated from the following file: