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

#include <rtsolver.h>

Inheritance diagram for RTSolverBase:
Collaboration diagram for RTSolverBase:

Public Types

enum  RTMode {
  MBRT_UNKNOWN = -1, MBRT_WAITPERIOD, MBRT_SEMAPHORE, MBRT_IO,
  MBRT_LASTMODE
}
 

Public Member Functions

 RTSolverBase (Solver *pS, RTMode eRTMode, unsigned long lRTPeriod, unsigned long RTStackSize, bool bRTAllowNonRoot, int RTCpuMap, bool bNoOutput=true)
 
virtual ~RTSolverBase (void)
 
virtual std::ostream & Restart (std::ostream &out) const =0
 
virtual void Setup (void)=0
 
virtual void Init (void)
 
virtual bool IsStopCommanded (void)
 
virtual void StopCommanded (void)=0
 
virtual void Log (void)=0
 
virtual void Wait (void)=0
 

Protected Member Functions

bool RTWaitPeriod (void) const
 
bool RTSemWait (void) const
 
bool RTBlockingIO (void) const
 

Protected Attributes

SolverpS
 
RTMode eRTMode
 
unsigned long lRTPeriod
 
unsigned long RTStackSize
 
bool bRTAllowNonRoot
 
int RTCpuMap
 
bool bNoOutput
 
volatile int RTSteps
 

Detailed Description

Definition at line 39 of file rtsolver.h.

Member Enumeration Documentation

Enumerator
MBRT_UNKNOWN 
MBRT_WAITPERIOD 
MBRT_SEMAPHORE 
MBRT_IO 
MBRT_LASTMODE 

Definition at line 41 of file rtsolver.h.

Constructor & Destructor Documentation

RTSolverBase::RTSolverBase ( Solver pS,
RTMode  eRTMode,
unsigned long  lRTPeriod,
unsigned long  RTStackSize,
bool  bRTAllowNonRoot,
int  RTCpuMap,
bool  bNoOutput = true 
)

Definition at line 44 of file rtsolver.cc.

References ASSERT.

51 : pS(pS),
56 RTCpuMap(RTCpuMap),
58 {
59  ASSERT(RTStackSize > 0);
60  ASSERT(lRTPeriod > 0);
61 }
unsigned long RTStackSize
Definition: rtsolver.h:59
unsigned long lRTPeriod
Definition: rtsolver.h:57
bool bNoOutput
Definition: rtsolver.h:63
RTMode eRTMode
Definition: rtsolver.h:54
#define ASSERT(expression)
Definition: colamd.c:977
int RTCpuMap
Definition: rtsolver.h:61
Solver * pS
Definition: rtsolver.h:52
bool bRTAllowNonRoot
Definition: rtsolver.h:60
RTSolverBase::~RTSolverBase ( void  )
virtual

Definition at line 63 of file rtsolver.cc.

References NO_OP.

64 {
65  NO_OP;
66 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

void RTSolverBase::Init ( void  )
virtual

Reimplemented in RTAISolver.

Definition at line 69 of file rtsolver.cc.

References bNoOutput, mbdyn_reserve_stack(), pS, RTStackSize, and SolverDiagnostics::SetNoOutput().

Referenced by RTAISolver::Init(), InverseSolver::Prepare(), and Solver::Start().

70 {
71  /* if using real-time, clear out any type of output */
72  if (bNoOutput) {
73  pS->SetNoOutput();
74  }
75 
77 }
unsigned long RTStackSize
Definition: rtsolver.h:59
bool bNoOutput
Definition: rtsolver.h:63
int mbdyn_reserve_stack(unsigned long size)
Definition: solver.cc:254
Solver * pS
Definition: rtsolver.h:52

Here is the call graph for this function:

bool RTSolverBase::IsStopCommanded ( void  )
virtual

Reimplemented in RTAISolver.

Definition at line 81 of file rtsolver.cc.

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

82 {
83  return false;
84 }
virtual void RTSolverBase::Log ( void  )
pure virtual

Implemented in RTAISolver.

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

virtual std::ostream& RTSolverBase::Restart ( std::ostream &  out) const
pure virtual

Implemented in RTAISolver.

bool RTSolverBase::RTBlockingIO ( void  ) const
inlineprotected

Definition at line 73 of file rtsolver.h.

References eRTMode, and MBRT_IO.

73  {
74  return (eRTMode == MBRT_IO);
75  };
RTMode eRTMode
Definition: rtsolver.h:54
bool RTSolverBase::RTSemWait ( void  ) const
inlineprotected

Definition at line 69 of file rtsolver.h.

References eRTMode, and MBRT_SEMAPHORE.

Referenced by RTAISolver::Init(), and RTAISolver::Wait().

69  {
70  return (eRTMode == MBRT_SEMAPHORE);
71  };
RTMode eRTMode
Definition: rtsolver.h:54
bool RTSolverBase::RTWaitPeriod ( void  ) const
inlineprotected

Definition at line 65 of file rtsolver.h.

References eRTMode, and MBRT_WAITPERIOD.

Referenced by RTAISolver::Init(), and RTAISolver::Wait().

65  {
66  return (eRTMode == MBRT_WAITPERIOD);
67  };
RTMode eRTMode
Definition: rtsolver.h:54
virtual void RTSolverBase::Setup ( void  )
pure virtual

Implemented in RTAISolver.

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

virtual void RTSolverBase::StopCommanded ( void  )
pure virtual

Implemented in RTAISolver.

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

virtual void RTSolverBase::Wait ( void  )
pure virtual

Implemented in RTAISolver.

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

Member Data Documentation

bool RTSolverBase::bNoOutput
protected

Definition at line 63 of file rtsolver.h.

Referenced by Init().

bool RTSolverBase::bRTAllowNonRoot
protected

Definition at line 60 of file rtsolver.h.

Referenced by RTAISolver::Init(), RTAISolver::Restart(), and RTAISolver::Setup().

RTMode RTSolverBase::eRTMode
protected

Definition at line 54 of file rtsolver.h.

Referenced by RTAISolver::Restart(), RTBlockingIO(), RTSemWait(), and RTWaitPeriod().

unsigned long RTSolverBase::lRTPeriod
protected

Definition at line 57 of file rtsolver.h.

Solver* RTSolverBase::pS
protected

Definition at line 52 of file rtsolver.h.

Referenced by Init().

int RTSolverBase::RTCpuMap
protected

Definition at line 61 of file rtsolver.h.

Referenced by RTAISolver::Init(), RTAISolver::Restart(), and RTAISolver::Setup().

unsigned long RTSolverBase::RTStackSize
protected

Definition at line 59 of file rtsolver.h.

Referenced by Init(), and RTAISolver::Restart().

volatile int RTSolverBase::RTSteps
protected

Definition at line 75 of file rtsolver.h.

Referenced by RTAISolver::Wait().


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