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

#include <drive.h>

Inheritance diagram for DriveCallerRead:

Public Member Functions

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

Static Public Member Functions

static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 

Protected Member Functions

void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Detailed Description

Definition at line 739 of file drive.h.

Constructor & Destructor Documentation

DriveCallerRead::~DriveCallerRead ( void  )
virtual

Definition at line 1364 of file drive_.cc.

References NO_OP.

1365 {
1366  NO_OP;
1367 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void DriveCallerRead::NeedDM ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred,
const char *const  name 
)
protected
void DriveCallerRead::ReadOutput ( DriveCaller pDC,
const DataManager pDM,
MBDynParser HP 
)
static

Definition at line 1369 of file drive_.cc.

References DriveCaller::bIsDifferentiable(), DataManager::bOutputDriveCallers(), WithLabel::GetLabel(), IncludeParser::GetLineData(), HighParser::GetYesNoOrBool(), HighParser::IsKeyWord(), ToBeOutput::OUTPUT, DriveCaller::OUTPUT_DERIVATIVE, DriveCaller::OUTPUT_VALUE, ToBeOutput::SetOutputFlag(), Traceable::SetTraceFlag(), Traceable::TRACE, DriveCaller::TRACE_DERIVATIVE, and DriveCaller::TRACE_VALUE.

Referenced by MBDynParser::DriveCaller_int().

1370 {
1371  flag fOutput = pDM->bOutputDriveCallers()
1373  : 0;
1374 
1375  if (HP.IsKeyWord("output")) {
1376  bool bGotKeyWord = false;
1377 
1378  if (HP.IsKeyWord("value")) {
1379  bGotKeyWord = true;
1380 
1381  if (HP.GetYesNoOrBool()) {
1382  fOutput |= DriveCaller::OUTPUT_VALUE;
1383  } else {
1384  fOutput &= ~DriveCaller::OUTPUT_VALUE;
1385  }
1386  }
1387 
1388  if (HP.IsKeyWord("derivative")) {
1389  bGotKeyWord = true;
1390 
1391  if (HP.GetYesNoOrBool()) {
1392  fOutput |= DriveCaller::OUTPUT_DERIVATIVE;
1393  } else {
1394  fOutput &= ~DriveCaller::OUTPUT_DERIVATIVE;
1395  }
1396  }
1397 
1398  if (!bGotKeyWord) {
1399  if (HP.GetYesNoOrBool()) {
1400  fOutput |= DriveCaller::OUTPUT_VALUE;
1401 
1402  if (pDC->bIsDifferentiable()) {
1403  fOutput |= DriveCaller::OUTPUT_DERIVATIVE;
1404  }
1405  } else {
1406  fOutput = flag(0);
1407  }
1408  }
1409  }
1410 
1411  if (fOutput & DriveCaller::OUTPUT_DERIVATIVE) {
1412  if (!pDC->bIsDifferentiable()) {
1413  silent_cerr("warning invalid output flag: drive caller(" << pDC->GetLabel()
1414  << ") is not differentiable at line "
1415  << HP.GetLineData() << std::endl);
1416 
1417  fOutput &= ~DriveCaller::OUTPUT_DERIVATIVE;
1418  }
1419  }
1420 
1421  if (fOutput) {
1422  fOutput |= DriveCaller::OUTPUT;
1423  }
1424 
1425  pDC->SetOutputFlag(fOutput);
1426 
1427  flag fTrace = 0;
1428 
1429  if (HP.IsKeyWord("output" "trace")) {
1430  bool bGotKeyWord = false;
1431 
1432  if (HP.IsKeyWord("value")) {
1433  bGotKeyWord = true;
1434 
1435  if (HP.GetYesNoOrBool()) {
1436  fTrace |= DriveCaller::TRACE_VALUE;
1437  } else {
1438  fTrace &= ~DriveCaller::TRACE_VALUE;
1439  }
1440  }
1441 
1442  if (HP.IsKeyWord("derivative")) {
1443  bGotKeyWord = true;
1444 
1445  if (HP.GetYesNoOrBool()) {
1447  } else {
1448  fTrace &= ~DriveCaller::TRACE_DERIVATIVE;
1449  }
1450  }
1451 
1452  if (!bGotKeyWord) {
1453  if (HP.GetYesNoOrBool()) {
1454  fTrace |= DriveCaller::TRACE_VALUE;
1455 
1456  if (pDC->bIsDifferentiable()) {
1458  }
1459  } else {
1460  fTrace = flag(0);
1461  }
1462  }
1463  }
1464 
1465  if (fTrace & DriveCaller::TRACE_DERIVATIVE) {
1466  if (!pDC->bIsDifferentiable()) {
1467  silent_cerr("warning invalid trace flag: drive caller (" << pDC->GetLabel()
1468  << ") is not differentiable at line "
1469  << HP.GetLineData() << std::endl);
1470 
1471  fTrace &= ~DriveCaller::TRACE_DERIVATIVE;
1472  }
1473  }
1474 
1475  if (fTrace) {
1476  fTrace |= DriveCaller::TRACE;
1477  }
1478 
1479  pDC->SetTraceFlag(fTrace);
1480 }
bool bOutputDriveCallers(void) const
Definition: dataman.cc:884
long int flag
Definition: mbdyn.h:43
virtual bool GetYesNoOrBool(bool bDefval=false)
Definition: parser.cc:1038
virtual bool bIsDifferentiable(void) const
Definition: drive.h:495
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual void SetTraceFlag(flag f=TRACE)
Definition: output.cc:919
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:


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