MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
extforce.h File Reference
#include <vector>
#include <string>
#include "mbsleep.h"
#include "force.h"
#include "converged.h"
#include "mbc.h"
Include dependency graph for extforce.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ExtFileHandlerBase
 
class  ExtFileHandler
 
class  ExtForce
 

Functions

void ReadExtForce (DataManager *pDM, MBDynParser &HP, unsigned int uLabel, ExtFileHandlerBase *&pEFH, bool &bSendAfterPredict, int &iCoupling)
 
void ReadExtFileParams (DataManager *pDM, MBDynParser &HP, unsigned int uLabel, mbsleep_t &SleepTime, std::streamsize &Precision)
 

Function Documentation

void ReadExtFileParams ( DataManager pDM,
MBDynParser HP,
unsigned int  uLabel,
mbsleep_t SleepTime,
std::streamsize &  Precision 
)

Definition at line 845 of file extforce.cc.

References HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetTimeout(), HighParser::IsKeyWord(), and MBDYN_EXCEPT_ARGS.

Referenced by ReadExtFileHandler(), ReadExtFileHandlerEDGE(), and ReadExtSocketHandler().

850 {
851  mbsleep_t MinSleepTime = SleepTime;
852  if (HP.IsKeyWord("sleep" "time")) {
853  SleepTime = HP.GetTimeout(SleepTime);
854  if (SleepTime < MinSleepTime ) {
855  silent_cerr("ExtForce(" << uLabel << "): "
856  "invalid sleep time " << SleepTime
857  << " less than " << MinSleepTime
858  << " at line " << HP.GetLineData()
859  << std::endl);
861  }
862  }
863 
864  Precision = 6;
865  if (HP.IsKeyWord("precision")) {
866  if (!HP.IsKeyWord("default")) {
867  Precision = HP.GetInt();
868  if (Precision < 0) {
869  silent_cerr("ExtForce(" << uLabel << "): "
870  "invalid precision value "
871  "\"" << Precision << "\""
872  " at line " << HP.GetLineData()
873  << std::endl);
875  }
876  }
877  }
878 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
unsigned long mbsleep_t
Definition: mbsleep.h:51
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual mbsleep_t GetTimeout(const mbsleep_t &DefVal)
Definition: parser.cc:1062
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

void ReadExtForce ( DataManager pDM,
MBDynParser HP,
unsigned int  uLabel,
ExtFileHandlerBase *&  pEFH,
bool bSendAfterPredict,
int iCoupling 
)

Definition at line 1141 of file extforce.cc.

References ExtForce::COUPLING_LOOSE, ExtForce::COUPLING_NONE, ExtForce::COUPLING_STAGGERED, ExtForce::COUPLING_TIGHT, HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetYesNo(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, and ReadExtFileHandler().

Referenced by ReadModalExtForce(), ReadModalMappingExtForce(), ReadStructExtForce(), and ReadStructMappingExtForce().

1147 {
1148  pEFH = ReadExtFileHandler(pDM, HP, uLabel);
1149 
1150  iCoupling = ExtForce::COUPLING_LOOSE;
1151  if (HP.IsKeyWord("coupling")) {
1152  if (HP.IsKeyWord("none")) {
1153  iCoupling = ExtForce::COUPLING_NONE;
1154 
1155  } else if (HP.IsKeyWord("staggered")) {
1156  iCoupling = ExtForce::COUPLING_STAGGERED;
1157 
1158  } else if (HP.IsKeyWord("loose")) {
1159  iCoupling = ExtForce::COUPLING_LOOSE;
1160 
1161  } else if (HP.IsKeyWord("tight")) {
1162  iCoupling = ExtForce::COUPLING_TIGHT;
1163 
1164  } else {
1165  iCoupling = HP.GetInt();
1166  if (iCoupling < -1) {
1167  silent_cerr("ExtForce(" << uLabel << "): "
1168  "invalid coupling value "
1169  "\"" << iCoupling << "\""
1170  " at line " << HP.GetLineData()
1171  << std::endl);
1173  }
1174  }
1175  }
1176 
1177  if (iCoupling >= ExtForce::COUPLING_LOOSE) {
1178  bSendAfterPredict = true;
1179  if (HP.IsKeyWord("send" "after" "predict")) {
1180  if (!HP.GetYesNo(bSendAfterPredict)) {
1181  silent_cerr("ExtForce(" << uLabel << "): "
1182  "invalud \"send after predict\" value "
1183  "at line " << HP.GetLineData()
1184  << std::endl);
1186  }
1187  }
1188 
1189  } else {
1190  bSendAfterPredict = false;
1191  }
1192 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
static ExtFileHandlerBase * ReadExtFileHandler(DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
Definition: extforce.cc:1087
virtual bool GetYesNo(bool &bRet)
Definition: parser.cc:1022
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function: