MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
tpldrive.h File Reference
#include "drive.h"
#include "matvec3.h"
#include "matvec6.h"
Include dependency graph for tpldrive.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TplDriveCaller< T >
 
class  TplDriveOwner< T >
 
struct  TplDriveCallerRead< T >
 

Functions

TplDriveCaller< doublereal > * ReadDC1D (const DataManager *pDM, MBDynParser &HP)
 
TplDriveCaller< Vec3 > * ReadDC3D (const DataManager *pDM, MBDynParser &HP)
 
TplDriveCaller< Vec6 > * ReadDC6D (const DataManager *pDM, MBDynParser &HP)
 
TplDriveCaller< Mat3x3 > * ReadDC3x3D (const DataManager *pDM, MBDynParser &HP)
 
TplDriveCaller< Mat6x6 > * ReadDC6x6D (const DataManager *pDM, MBDynParser &HP)
 
TplDriveCaller< Vec3 > * ReadDCVecRel (const DataManager *pDM, MBDynParser &HP, const ReferenceFrame &rf)
 
TplDriveCaller< Vec3 > * ReadDCVecAbs (const DataManager *pDM, MBDynParser &HP, const ReferenceFrame &rf)
 
bool SetDC1D (const char *name, TplDriveCallerRead< doublereal > *rf)
 
bool SetDC3D (const char *name, TplDriveCallerRead< Vec3 > *rf)
 
bool SetDC6D (const char *name, TplDriveCallerRead< Vec6 > *rf)
 
bool SetDC3x3D (const char *name, TplDriveCallerRead< Mat3x3 > *rf)
 
bool SetDC6x6D (const char *name, TplDriveCallerRead< Mat6x6 > *rf)
 
void InitTplDC (void)
 
void DestroyTplDC (void)
 

Function Documentation

void DestroyTplDC ( void  )

Definition at line 980 of file tpldrive_impl.cc.

References DC1DFuncMap, DC3DFuncMap, DC3x3DFuncMap, DC6DFuncMap, DC6x6DFuncMap, done, and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::~MBDynParser().

981 {
982  if (::done == 0) {
983  silent_cerr("DestroyTplDC() called once too many" << std::endl);
985  }
986 
987  if (--::done > 0) {
988  return;
989  }
990 
991  /* free stuff */
992  for (DC1DFuncMapType::iterator i = DC1DFuncMap.begin(); i != DC1DFuncMap.end(); ++i) {
993  delete i->second;
994  }
995  DC1DFuncMap.clear();
996 
997  for (DC3DFuncMapType::iterator i = DC3DFuncMap.begin(); i != DC3DFuncMap.end(); ++i) {
998  delete i->second;
999  }
1000  DC3DFuncMap.clear();
1001 
1002  for (DC6DFuncMapType::iterator i = DC6DFuncMap.begin(); i != DC6DFuncMap.end(); ++i) {
1003  delete i->second;
1004  }
1005  DC6DFuncMap.clear();
1006 
1007  for (DC3x3DFuncMapType::iterator i = DC3x3DFuncMap.begin(); i != DC3x3DFuncMap.end(); ++i) {
1008  delete i->second;
1009  }
1010  DC3x3DFuncMap.clear();
1011 
1012  for (DC6x6DFuncMapType::iterator i = DC6x6DFuncMap.begin(); i != DC6x6DFuncMap.end(); ++i) {
1013  delete i->second;
1014  }
1015  DC6x6DFuncMap.clear();
1016 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
static DC6x6DFuncMapType DC6x6DFuncMap
static DC3x3DFuncMapType DC3x3DFuncMap
static unsigned done
static DC6DFuncMapType DC6DFuncMap
static DC1DFuncMapType DC1DFuncMap
static DC3DFuncMapType DC3DFuncMap
void InitTplDC ( void  )

Definition at line 931 of file tpldrive_impl.cc.

References done, SetDC1D(), SetDC3D(), SetDC3x3D(), SetDC6D(), and SetDC6x6D().

Referenced by MBDynParser::MBDynParser().

932 {
933  if (::done++ > 0) {
934  return;
935  }
936 
937  /* null */
938  SetDC1D("null", new NullTDCR<doublereal>);
939  SetDC3D("null", new NullTDCR<Vec3>);
940  SetDC6D("null", new NullTDCR<Vec6>);
941 
942  SetDC3x3D("null", new NullTDCR<Mat3x3>);
943  SetDC6x6D("null", new NullTDCR<Mat6x6>);
944 
945  /* zero (deprecated) */
946  SetDC1D("zero", new ZeroTDCR<doublereal>);
947  SetDC3D("zero", new ZeroTDCR<Vec3>);
948  SetDC6D("zero", new ZeroTDCR<Vec6>);
949 
950  SetDC3x3D("zero", new ZeroTDCR<Mat3x3>);
951  SetDC6x6D("zero", new ZeroTDCR<Mat6x6>);
952 
953  /* single */
954  SetDC1D("single", new SingleTDCR<doublereal>);
955  SetDC3D("single", new SingleTDCR<Vec3>);
956  SetDC6D("single", new SingleTDCR<Vec6>);
957 
958  SetDC3x3D("single", new SingleTDCR<Mat3x3>);
959  SetDC6x6D("single", new SingleTDCR<Mat6x6>);
960 
961  /* component */
962  /* in the scalar case, "single" and "component" are identical */
963  SetDC1D("component", new SingleTDCR<doublereal>);
964  SetDC3D("component", new CompTDCR<Vec3>);
965  SetDC6D("component", new CompTDCR<Vec6>);
966 
967  SetDC3x3D("component", new CompTDCR<Mat3x3>);
968  SetDC6x6D("component", new CompTDCR<Mat6x6>);
969 
970  /* array */
971  SetDC1D("array", new ArrayTDCR<doublereal>);
972  SetDC3D("array", new ArrayTDCR<Vec3>);
973  SetDC6D("array", new ArrayTDCR<Vec6>);
974 
975  SetDC3x3D("array", new ArrayTDCR<Mat3x3>);
976  SetDC6x6D("array", new ArrayTDCR<Mat6x6>);
977 }
bool SetDC3D(const char *name, TplDriveCallerRead< Vec3 > *rf)
static unsigned done
bool SetDC3x3D(const char *name, TplDriveCallerRead< Mat3x3 > *rf)
bool SetDC1D(const char *name, TplDriveCallerRead< doublereal > *rf)
bool SetDC6D(const char *name, TplDriveCallerRead< Vec6 > *rf)
bool SetDC6x6D(const char *name, TplDriveCallerRead< Mat6x6 > *rf)

Here is the call graph for this function:

TplDriveCaller<doublereal>* ReadDC1D ( const DataManager pDM,
MBDynParser HP 
)

Definition at line 812 of file tpldrive_impl.cc.

References DC1DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetTplDriveCaller().

813 {
814  const char *s = HP.IsWord(DC1DWordSet);
815  if (s == 0) {
816  s = "single";
817  }
818 
819  DC1DFuncMapType::iterator func = DC1DFuncMap.find(std::string(s));
820  if (func == DC1DFuncMap.end()) {
821  silent_cerr("unknown template drive caller 1D type \"" << s << "\" "
822  "at line " << HP.GetLineData() << std::endl);
824  }
825 
826  return func->second->Read(pDM, HP);
827 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static DC1DFuncMapType DC1DFuncMap
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
static DC1DWordSetType DC1DWordSet

Here is the call graph for this function:

TplDriveCaller<Vec3>* ReadDC3D ( const DataManager pDM,
MBDynParser HP 
)

Definition at line 830 of file tpldrive_impl.cc.

References DC3DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetTplDriveCaller(), ReadAirstreamData(), DataManager::ReadControl(), ReadForce(), and ReadGravity().

831 {
832  const char *s = HP.IsWord(DC3DWordSet);
833  if (s == 0) {
834  s = "single";
835  }
836 
837  DC3DFuncMapType::iterator func = DC3DFuncMap.find(std::string(s));
838  if (func == DC3DFuncMap.end()) {
839  silent_cerr("unknown template drive caller 3D type \"" << s << "\" "
840  "at line " << HP.GetLineData() << std::endl);
842  }
843 
844  return func->second->Read(pDM, HP);
845 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static DC3DWordSetType DC3DWordSet
static DC3DFuncMapType DC3DFuncMap
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

TplDriveCaller<Mat3x3>* ReadDC3x3D ( const DataManager pDM,
MBDynParser HP 
)

Definition at line 866 of file tpldrive_impl.cc.

References DC3x3DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetTplDriveCaller().

867 {
868  const char *s = HP.IsWord(DC3x3DWordSet);
869  if (s == 0) {
870  s = "single";
871  }
872 
873  DC3x3DFuncMapType::iterator func = DC3x3DFuncMap.find(std::string(s));
874  if (func == DC3x3DFuncMap.end()) {
875  silent_cerr("unknown template drive caller 3x3D type \"" << s << "\" "
876  "at line " << HP.GetLineData() << std::endl);
878  }
879 
880  return func->second->Read(pDM, HP);
881 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
static DC3x3DWordSetType DC3x3DWordSet
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
static DC3x3DFuncMapType DC3x3DFuncMap
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

TplDriveCaller<Vec6>* ReadDC6D ( const DataManager pDM,
MBDynParser HP 
)

Definition at line 848 of file tpldrive_impl.cc.

References DC6DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetTplDriveCaller().

849 {
850  const char *s = HP.IsWord(DC6DWordSet);
851  if (s == 0) {
852  s = "single";
853  }
854 
855  DC6DFuncMapType::iterator func = DC6DFuncMap.find(std::string(s));
856  if (func == DC6DFuncMap.end()) {
857  silent_cerr("unknown template drive caller 6D type \"" << s << "\" "
858  "at line " << HP.GetLineData() << std::endl);
860  }
861 
862  return func->second->Read(pDM, HP);
863 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
static DC6DWordSetType DC6DWordSet
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static DC6DFuncMapType DC6DFuncMap
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

TplDriveCaller<Mat6x6>* ReadDC6x6D ( const DataManager pDM,
MBDynParser HP 
)

Definition at line 884 of file tpldrive_impl.cc.

References DC6x6DFuncMap, func(), IncludeParser::GetLineData(), HighParser::IsWord(), and MBDYN_EXCEPT_ARGS.

Referenced by MBDynParser::GetTplDriveCaller().

885 {
886  const char *s = HP.IsWord(DC6x6DWordSet);
887  if (s == 0) {
888  s = "single";
889  }
890 
891  DC6x6DFuncMapType::iterator func = DC6x6DFuncMap.find(std::string(s));
892  if (func == DC6x6DFuncMap.end()) {
893  silent_cerr("unknown template drive caller 6x6D type \"" << s << "\" "
894  "at line " << HP.GetLineData() << std::endl);
896  }
897 
898  return func->second->Read(pDM, HP);
899 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
static DC6x6DFuncMapType DC6x6DFuncMap
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
static DC6x6DWordSetType DC6x6DWordSet
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

TplDriveCaller<Vec3>* ReadDCVecAbs ( const DataManager pDM,
MBDynParser HP,
const ReferenceFrame rf 
)

Definition at line 923 of file tpldrive_impl.cc.

Referenced by ReadStructuralForce().

924 {
925  return ReadDCVec<MBDynParser::VecAbsManip>(pDM, HP, rf);
926 }
TplDriveCaller<Vec3>* ReadDCVecRel ( const DataManager pDM,
MBDynParser HP,
const ReferenceFrame rf 
)

Definition at line 917 of file tpldrive_impl.cc.

Referenced by ModuleIMUConstraint::ModuleIMUConstraint(), DataManager::ReadControl(), and ReadStructuralForce().

918 {
919  return ReadDCVec<MBDynParser::VecRelManip>(pDM, HP, rf);
920 }
bool SetDC1D ( const char *  name,
TplDriveCallerRead< doublereal > *  rf 
)

Definition at line 771 of file tpldrive_impl.cc.

References DC1DFuncMap.

Referenced by InitTplDC(), and mbdyn_octave_set().

772 {
773  pedantic_cout("registering template drive caller 1D \"" << name << "\""
774  << std::endl );
775  return DC1DFuncMap.insert(DC1DFuncMapType::value_type(name, rf)).second;
776 }
static DC1DFuncMapType DC1DFuncMap
bool SetDC3D ( const char *  name,
TplDriveCallerRead< Vec3 > *  rf 
)

Definition at line 779 of file tpldrive_impl.cc.

References DC3DFuncMap.

Referenced by InitTplDC(), mbdyn_octave_set(), and module_init().

780 {
781  pedantic_cout("registering template drive caller 3D \"" << name << "\""
782  << std::endl );
783  return DC3DFuncMap.insert(DC3DFuncMapType::value_type(name, rf)).second;
784 }
static DC3DFuncMapType DC3DFuncMap
bool SetDC3x3D ( const char *  name,
TplDriveCallerRead< Mat3x3 > *  rf 
)

Definition at line 795 of file tpldrive_impl.cc.

References DC3x3DFuncMap.

Referenced by InitTplDC(), and mbdyn_octave_set().

796 {
797  pedantic_cout("registering template drive caller 3x3D \"" << name << "\""
798  << std::endl );
799  return DC3x3DFuncMap.insert(DC3x3DFuncMapType::value_type(name, rf)).second;
800 }
static DC3x3DFuncMapType DC3x3DFuncMap
bool SetDC6D ( const char *  name,
TplDriveCallerRead< Vec6 > *  rf 
)

Definition at line 787 of file tpldrive_impl.cc.

References DC6DFuncMap.

Referenced by InitTplDC(), and mbdyn_octave_set().

788 {
789  pedantic_cout("registering template drive caller 6D \"" << name << "\""
790  << std::endl );
791  return DC6DFuncMap.insert(DC6DFuncMapType::value_type(name, rf)).second;
792 }
static DC6DFuncMapType DC6DFuncMap
bool SetDC6x6D ( const char *  name,
TplDriveCallerRead< Mat6x6 > *  rf 
)

Definition at line 803 of file tpldrive_impl.cc.

References DC6x6DFuncMap.

Referenced by InitTplDC(), and mbdyn_octave_set().

804 {
805  pedantic_cout("registering template drive caller 6x6D \"" << name << "\""
806  << std::endl );
807  return DC6x6DFuncMap.insert(DC6x6DFuncMapType::value_type(name, rf)).second;
808 }
static DC6x6DFuncMapType DC6x6DFuncMap