MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
TimeStepControl.cc File Reference
#include "mbconfig.h"
#include "TimeStepControl.h"
#include "solver_impl.h"
Include dependency graph for TimeStepControl.cc:

Go to the source code of this file.

Classes

struct  TimeStepWordSetType
 
struct  NoChangeTSR
 
class  ChangeStepTSR
 
class  FactorTSR
 

Typedefs

typedef std::map< std::string,
TimeStepRead * > 
TimeStepFuncMapType
 

Functions

bool SetTimeStepData (const char *name, TimeStepRead *sr)
 
void InitTimeStepData (void)
 
void DestroyTimeStepData (void)
 
TimeStepControlReadTimeStepData (Solver *s, MBDynParser &HP)
 

Variables

TimeStepFuncMapType TimeStepReadMap
 
TimeStepWordSetType TimeStepWordSet
 

Typedef Documentation

typedef std::map<std::string, TimeStepRead *> TimeStepFuncMapType

Definition at line 41 of file TimeStepControl.cc.

Function Documentation

void DestroyTimeStepData ( void  )

Definition at line 371 of file TimeStepControl.cc.

References TimeStepReadMap.

Referenced by Solver::~Solver().

372 {
373  for (TimeStepFuncMapType::iterator it = TimeStepReadMap.begin(); it != TimeStepReadMap.end(); ++it) {
374  delete it->second;
375  }
376  TimeStepReadMap.clear();
377 }
TimeStepFuncMapType TimeStepReadMap
void InitTimeStepData ( void  )

Definition at line 363 of file TimeStepControl.cc.

References SetTimeStepData().

Referenced by Solver::Solver().

364 {
365  SetTimeStepData("no" "change", new NoChangeTSR);
366  SetTimeStepData("change", new ChangeStepTSR);
367  SetTimeStepData("factor", new FactorTSR);
368 }
bool SetTimeStepData(const char *name, TimeStepRead *sr)

Here is the call graph for this function:

TimeStepControl* ReadTimeStepData ( Solver s,
MBDynParser HP 
)

Definition at line 380 of file TimeStepControl.cc.

References ASSERT, func(), HighParser::IsWord(), and TimeStepReadMap.

Referenced by InverseSolver::ReadData(), and Solver::ReadData().

381 {
382  const char *str = HP.IsWord(TimeStepWordSet);
383  TimeStepFuncMapType::iterator func = TimeStepReadMap.find(std::string(str));
384  if (func == TimeStepReadMap.end()) {
385  silent_cerr("unknown TimeStepControl type " << s << "; using \"no change\"" << std::endl);
386  func = TimeStepReadMap.find(std::string("no" "change"));
387  }
388  ASSERT(func != TimeStepReadMap.end());
389  return func->second->Read(s, HP);
390 }
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
TimeStepFuncMapType TimeStepReadMap
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
#define ASSERT(expression)
Definition: colamd.c:977
TimeStepWordSetType TimeStepWordSet

Here is the call graph for this function:

bool SetTimeStepData ( const char *  name,
TimeStepRead sr 
)

Definition at line 54 of file TimeStepControl.cc.

References TimeStepReadMap.

Referenced by InitTimeStepData().

54  {
55  return TimeStepReadMap.insert(std::make_pair(name, sr)).second;
56 }
TimeStepFuncMapType TimeStepReadMap

Variable Documentation

TimeStepWordSetType TimeStepWordSet

Definition at line 51 of file TimeStepControl.cc.