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

Public Member Functions

DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)
 
- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from DriveCallerRead
static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 
- Protected Member Functions inherited from DriveCallerRead
void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Detailed Description

Definition at line 2070 of file drive_.cc.

Member Function Documentation

DriveCaller * FourierSeriesDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred 
)
virtual

Implements DriveCallerRead.

Definition at line 2076 of file drive_.cc.

References a, DEBUGCOUT, HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetReal(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, DriveCallerRead::NeedDM(), DataManager::pGetDrvHdl(), and SAFENEWWITHCONSTRUCTOR.

2077 {
2078  NeedDM(pDM, HP, bDeferred, "Fourier series");
2079 
2080  const DriveHandler* pDrvHdl = 0;
2081  if (pDM != 0) {
2082  pDrvHdl = pDM->pGetDrvHdl();
2083  }
2084 
2085  DriveCaller *pDC = 0;
2086 
2087  doublereal dInitialTime = HP.GetReal();
2088  DEBUGCOUT("Initial time: " << dInitialTime << std::endl);
2089 
2090  doublereal dOmega = HP.GetReal(1.);
2091  DEBUGCOUT("Omega: " << dOmega << std::endl);
2092 
2093  int n = HP.GetInt();
2094  if (n <= 0) {
2095  silent_cerr("FourierSeriesDriveCaller: invalid order " << n
2096  << " at line " << HP.GetLineData() << std::endl);
2098  }
2099 
2100  std::vector<doublereal> a(1 + 2*n);
2101  for (unsigned i = 0; i < 1 + 2*unsigned(n); i++) {
2102  a[i] = HP.GetReal();
2103  }
2104 
2105  /* don't remember why, but the series starts with a_0/2 */
2106  a[0] /= 2.;
2107 
2108  integer iNumCycles;
2109  if (HP.IsKeyWord("forever")) {
2110  iNumCycles = 0;
2111 
2112  } else if (HP.IsKeyWord("one")) {
2113  iNumCycles = 1;
2114 
2115  } else {
2116  iNumCycles = HP.GetInt();
2117  }
2118  DEBUGCOUT("Number of cycles: " << iNumCycles << std::endl);
2119  if (iNumCycles < 0) {
2120  silent_cerr("FourierSeriesDriveCaller: invalid number of cycles "
2121  << iNumCycles << " at line " << HP.GetLineData() << std::endl);
2123  }
2124 
2125  doublereal dInitialValue = HP.GetReal();
2126  DEBUGCOUT("InitialValue: " << dInitialValue << std::endl);
2127 
2130  FourierSeriesDriveCaller(pDrvHdl,
2131  dInitialTime,
2132  dOmega,
2133  a,
2134  iNumCycles,
2135  dInitialValue));
2136 
2137  return pDC;
2138 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
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
static const doublereal a
Definition: hfluid_.h:289
void NeedDM(const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
Definition: drive_.cc:1354
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
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: