MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
SineCosineDCR Struct Reference
Inheritance diagram for SineCosineDCR:

Protected Member Functions

virtual ~SineCosineDCR (void)
 
virtual DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred, bool bSine)
 

Detailed Description

Definition at line 1948 of file drive_.cc.

Constructor & Destructor Documentation

virtual SineCosineDCR::~SineCosineDCR ( void  )
inlineprotectedvirtual

Definition at line 1950 of file drive_.cc.

References NO_OP.

1950 { NO_OP; };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

DriveCaller * SineCosineDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred,
bool  bSine 
)
protectedvirtual

Definition at line 1956 of file drive_.cc.

References DEBUGCOUT, HighParser::GetInt(), HighParser::GetReal(), HighParser::IsKeyWord(), DataManager::pGetDrvHdl(), and SAFENEWWITHCONSTRUCTOR.

Referenced by SineDCR::Read(), and CosineDCR::Read().

1957 {
1958  const DriveHandler* pDrvHdl = 0;
1959  if (pDM != 0) {
1960  pDrvHdl = pDM->pGetDrvHdl();
1961  }
1962 
1963  DriveCaller *pDC = 0;
1964 
1965  /* Seno e coseno (limitati, illimitati, saturati) */
1966  doublereal dInitialTime = HP.GetReal();
1967  DEBUGCOUT("Initial time: " << dInitialTime << std::endl);
1968 
1969  doublereal dOmega = HP.GetReal(1.);
1970  DEBUGCOUT("Omega: " << dOmega << std::endl);
1971 
1972  doublereal dAmplitude = HP.GetReal();
1973  DEBUGCOUT("Amplitude: " << dAmplitude << std::endl);
1974 
1975  integer iNumCycles;
1976  if (HP.IsKeyWord("forever")) {
1977  iNumCycles = 0;
1978 
1979  } else if (HP.IsKeyWord("one")) {
1980  iNumCycles = 1;
1981 
1982  } else if (HP.IsKeyWord("half")) {
1983  iNumCycles = -1;
1984 
1985  } else {
1986  iNumCycles = HP.GetInt();
1987  }
1988  DEBUGCOUT("Number of cycles: " << iNumCycles << std::endl);
1989 
1990  doublereal dInitialValue = HP.GetReal();
1991  DEBUGCOUT("InitialValue: " << dInitialValue << std::endl);
1992 
1993  if (bSine) {
1996  SineDriveCaller(pDrvHdl, dInitialTime, dOmega, dAmplitude, iNumCycles, dInitialValue));
1997 
1998  } else {
2001  CosineDriveCaller(pDrvHdl, dInitialTime, dOmega, dAmplitude, iNumCycles, dInitialValue));
2002  }
2003 
2004  return pDC;
2005 }
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define DEBUGCOUT(msg)
Definition: myassert.h:232
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:


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