MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
FileDrive Class Referenceabstract

#include <filedrv.h>

Inheritance diagram for FileDrive:
Collaboration diagram for FileDrive:

Public Member Functions

 FileDrive (unsigned int uL, const DriveHandler *pDH, const std::string &s, integer nd, const std::vector< doublereal > &v0)
 
virtual ~FileDrive (void)
 
virtual Drive::Type GetDriveType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const =0
 
virtual integer iGetNumDrives (void) const
 
virtual doublereal dGet (const doublereal &t, int i=1) const
 
- Public Member Functions inherited from Drive
 Drive (unsigned int uL, const DriveHandler *pDH)
 
virtual ~Drive (void)
 
virtual void ServePending (const doublereal &t)=0
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 

Protected Attributes

std::string sFileName
 
integer iNumDrives
 
doublerealpdVal
 
- Protected Attributes inherited from Drive
const DriveHandlerpDrvHdl
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Additional Inherited Members

- Public Types inherited from Drive
enum  Type { UNKNOWN = -1, FILEDRIVE = 0, LASTDRIVETYPE }
 
enum  Bailout { BO_NONE = 0x0, BO_UPPER = 0x1, BO_LOWER = 0x2, BO_ANY = (BO_UPPER | BO_LOWER) }
 
- Static Protected Attributes inherited from Drive
static doublereal dReturnValue = 0.
 

Detailed Description

Definition at line 44 of file filedrv.h.

Constructor & Destructor Documentation

FileDrive::FileDrive ( unsigned int  uL,
const DriveHandler pDH,
const std::string &  s,
integer  nd,
const std::vector< doublereal > &  v0 
)

Definition at line 52 of file filedrv.cc.

References ASSERT, MBDYN_FILE_DRIVE_CHECK, pdVal, and SAFENEWARR.

55 : Drive(uL, pDH), sFileName(s), iNumDrives(nd), pdVal(0)
56 {
57  SAFENEWARR(pdVal, doublereal, nd + 1);
59  if (v0.empty()) {
60  for (int iCntm1 = 1; iCntm1 <= nd; iCntm1++) {
61  pdVal[iCntm1] = 0.;
62  }
63 
64  } else {
65  ASSERT(v0.size() == unsigned(nd));
66  for (int iCnt = 0; iCnt < nd; iCnt++) {
67  pdVal[iCnt + 1] = v0[iCnt];
68  }
69  }
70 }
std::string sFileName
Definition: filedrv.h:46
#define MBDYN_FILE_DRIVE_CHECK
Definition: filedrv.h:40
integer iNumDrives
Definition: filedrv.h:47
doublereal * pdVal
Definition: filedrv.h:48
Drive(unsigned int uL, const DriveHandler *pDH)
Definition: drive.cc:43
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
static const std::vector< doublereal > v0
Definition: fixedstep.cc:45
double doublereal
Definition: colamd.c:52
FileDrive::~FileDrive ( void  )
virtual

Definition at line 73 of file filedrv.cc.

References pdVal, and SAFEDELETEARR.

74 {
75  if (pdVal != NULL) {
77  }
78 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdVal
Definition: filedrv.h:48

Member Function Documentation

doublereal FileDrive::dGet ( const doublereal t,
int  i = 1 
) const
virtual

Definition at line 88 of file filedrv.cc.

References ASSERT, iNumDrives, and pdVal.

Referenced by FileDriveCaller::dGet().

89 {
90  ASSERT(i > 0 && i <= iNumDrives);
91  return pdVal[i];
92 }
integer iNumDrives
Definition: filedrv.h:47
doublereal * pdVal
Definition: filedrv.h:48
#define ASSERT(expression)
Definition: colamd.c:977
Drive::Type FileDrive::GetDriveType ( void  ) const
virtual

Implements Drive.

Definition at line 82 of file filedrv.cc.

References Drive::FILEDRIVE.

83 {
84  return Drive::FILEDRIVE;
85 }
integer FileDrive::iGetNumDrives ( void  ) const
inlinevirtual

Definition at line 72 of file filedrv.h.

References iNumDrives.

Referenced by FileDCR::Read().

73 {
74  return iNumDrives;
75 }
integer iNumDrives
Definition: filedrv.h:47
virtual std::ostream& FileDrive::Restart ( std::ostream &  out) const
pure virtual

Member Data Documentation

std::string FileDrive::sFileName
protected

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