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

#include <node.h>

Inheritance diagram for ScalarDifferentialNode:
Collaboration diagram for ScalarDifferentialNode:

Public Member Functions

 ScalarDifferentialNode (unsigned int uL, const DofOwner *pDO, const doublereal &dx, const doublereal &dxp, flag fOut)
 
virtual ~ScalarDifferentialNode (void)
 
virtual Node::Type GetNodeType (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual const doublerealdGetDofValue (int iDof, int iOrder=0) const
 
virtual const doublerealdGetDofValuePrev (int iDof, int iOrder=0) const
 
virtual void SetDofValue (const doublereal &dValue, unsigned int iDof, unsigned int iOrder=0)
 
virtual void SetX (const doublereal &d)
 
virtual const doublerealdGetX (void) const
 
virtual void SetXPrime (const doublereal &d)
 
virtual const doublerealdGetXPrime (void) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void Update (const class VectorHandler &, const class VectorHandler &)
 
std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
- Public Member Functions inherited from ScalarNode
 ScalarNode (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ScalarNode (void)
 
virtual void Output (OutputHandler &OH) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
- Public Member Functions inherited from Node
 Node (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~Node (void)
 
const NodeGetNode (void) const
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual integer iGetFirstRowIndex (void) const
 
virtual integer iGetFirstColIndex (void) const
 
- 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
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
virtual void SetInitialValue (VectorHandler &X)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 

Protected Member Functions

virtual std::ostream & Output (std::ostream &out) const
 

Protected Attributes

doublereal dX
 
doublereal dXP
 
doublereal dXPrev
 
doublereal dXPPrev
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Additional Inherited Members

- Public Types inherited from Node
enum  Type {
  UNKNOWN = -1, ABSTRACT = 0, STRUCTURAL, ELECTRIC,
  THERMAL, PARAMETER, HYDRAULIC, LASTNODETYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 

Detailed Description

Definition at line 272 of file node.h.

Constructor & Destructor Documentation

ScalarDifferentialNode::ScalarDifferentialNode ( unsigned int  uL,
const DofOwner pDO,
const doublereal dx,
const doublereal dxp,
flag  fOut 
)

Definition at line 152 of file node.cc.

References NO_OP.

157 : ScalarNode(uL, pDO, fOut), dX(dx), dXP(dxp), dXPrev(dx), dXPPrev(dxp)
158 {
159  NO_OP;
160 }
doublereal dXPPrev
Definition: node.h:282
doublereal dX
Definition: node.h:275
#define NO_OP
Definition: myassert.h:74
ScalarNode(unsigned int uL, const DofOwner *pDO, flag fOut)
Definition: node.cc:110
doublereal dXPrev
Definition: node.h:280
doublereal dXP
Definition: node.h:277
ScalarDifferentialNode::~ScalarDifferentialNode ( void  )
virtual

Definition at line 162 of file node.cc.

References NO_OP.

163 {
164  NO_OP;
165 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

const doublereal & ScalarDifferentialNode::dGetDofValue ( int  iDof,
int  iOrder = 0 
) const
virtual

Implements Node.

Definition at line 189 of file node.cc.

References ASSERT, dX, and dXP.

190 {
191  ASSERT(iDof == 1);
192  ASSERT(iOrder == 0 || iOrder == 1);
193  if (iOrder == 0) {
194  return dX;
195  }
196  return dXP;
197 }
doublereal dX
Definition: node.h:275
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dXP
Definition: node.h:277
const doublereal & ScalarDifferentialNode::dGetDofValuePrev ( int  iDof,
int  iOrder = 0 
) const
virtual

Implements Node.

Definition at line 202 of file node.cc.

References ASSERT, dXPPrev, and dXPrev.

203 {
204  ASSERT(iDof == 1);
205  ASSERT(iOrder == 0 || iOrder == 1);
206  if (iOrder == 0) {
207  return dXPrev;
208  }
209  return dXPPrev;
210 }
doublereal dXPPrev
Definition: node.h:282
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dXPrev
Definition: node.h:280
doublereal ScalarDifferentialNode::dGetPrivData ( unsigned int  i) const
virtual

Reimplemented from Node.

Definition at line 328 of file node.cc.

References dX, dXP, and MBDYN_EXCEPT_ARGS.

329 {
330  switch (i) {
331  case 1:
332  return dX;
333 
334  case 2:
335  return dXP;
336 
337  }
338 
340 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
doublereal dX
Definition: node.h:275
doublereal dXP
Definition: node.h:277
const doublereal & ScalarDifferentialNode::dGetX ( void  ) const
inlinevirtual

Implements ScalarNode.

Definition at line 386 of file node.h.

References dX.

Referenced by ThermalResistance::AssRes(), DispMeasure::AssRes(), RotorTrimBase::AssRes(), TranslAccel::AssRes(), RotAccel::AssRes(), and Motor::dGetVoltage().

387 {
388  return dX;
389 }
doublereal dX
Definition: node.h:275
const doublereal & ScalarDifferentialNode::dGetXPrime ( void  ) const
inlinevirtual

Implements ScalarNode.

Definition at line 393 of file node.h.

References dXP.

Referenced by ThermalCapacitance::AssRes(), and RotorTrimBase::AssRes().

394 {
395  return dXP;
396 }
doublereal dXP
Definition: node.h:277
DofOrder::Order ScalarDifferentialNode::GetDofType ( unsigned int  i) const
virtual

Implements SimulationEntity.

Definition at line 180 of file node.cc.

References ASSERT, DofOrder::DIFFERENTIAL, and ScalarNode::iGetNumDof().

181 {
182  ASSERT(i < iGetNumDof());
183  return DofOrder::DIFFERENTIAL;
184 }
#define ASSERT(expression)
Definition: colamd.c:977
virtual unsigned int iGetNumDof(void) const
Definition: node.cc:136

Here is the call graph for this function:

Node::Type ScalarDifferentialNode::GetNodeType ( void  ) const
virtual

Implements Node.

Reimplemented in ElectricNode, and ThermalNode.

Definition at line 169 of file node.cc.

References Node::ABSTRACT.

Referenced by DispMeasure::DispMeasure(), Restart(), RotAccel::RotAccel(), SwashPlate::SwashPlate(), and TranslAccel::TranslAccel().

170 {
171  /* Should be Node::SCALAR; keep using Node::ABSTRACT
172  * for backward compatibility */
173  return Node::ABSTRACT;
174 }
unsigned int ScalarDifferentialNode::iGetNumPrivData ( void  ) const
virtual

Reimplemented from Node.

Definition at line 297 of file node.cc.

298 {
299  return 2;
300 }
unsigned int ScalarDifferentialNode::iGetPrivDataIdx ( const char *  s) const
virtual

Reimplemented from Node.

Definition at line 303 of file node.cc.

References ASSERT.

304 {
305  ASSERT(s != 0);
306 
307  /*
308  * "x" => 1
309  * "xP" => 2
310  */
311 
312  if (s[0] != 'x') {
313  return 0;
314  }
315 
316  if (s[1] == '\0') {
317  return 1;
318  }
319 
320  if (s[1] == 'P' && s[2] == '\0') {
321  return 2;
322  }
323 
324  return 0;
325 }
#define ASSERT(expression)
Definition: colamd.c:977
std::ostream & ScalarDifferentialNode::Output ( std::ostream &  out) const
protectedvirtual

Reimplemented from ScalarNode.

Definition at line 268 of file node.cc.

References ToBeOutput::bToBeOutput(), dX, dXP, and WithLabel::GetLabel().

Referenced by ThermalNode::Output(), and ElectricNode::Output().

269 {
270  if (bToBeOutput()) {
271  out << std::setw(8) << GetLabel()
272  << " " << dX
273  << " " << dXP
274  << std::endl;
275  }
276  return out;
277 }
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal dX
Definition: node.h:275
doublereal dXP
Definition: node.h:277
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & ScalarDifferentialNode::Restart ( std::ostream &  out) const
virtual

Implements Node.

Definition at line 283 of file node.cc.

References dX, dXP, WithLabel::GetLabel(), WithLabel::GetName(), GetNodeType(), and psReadNodesNodes.

284 {
285  out << " " << psReadNodesNodes[GetNodeType()]
286  << ": " << GetLabel();
287 
288  if (!GetName().empty()) {
289  out << ", name, \"" << GetName() << "\"";
290  }
291 
292  return out << ", value, " << dX
293  << ", derivative, " << dXP << ";" << std::endl;
294 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
doublereal dX
Definition: node.h:275
doublereal dXP
Definition: node.h:277
const std::string & GetName(void) const
Definition: withlab.cc:68
virtual Node::Type GetNodeType(void) const
Definition: node.cc:169
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

void ScalarDifferentialNode::SetDofValue ( const doublereal dValue,
unsigned int  iDof,
unsigned int  iOrder = 0 
)
virtual

Implements Node.

Definition at line 215 of file node.cc.

References ASSERT, dX, and dXP.

218 {
219  ASSERT(iDof == 1);
220  ASSERT(iOrder == 0 || iOrder == 1);
221  if (iOrder == 0) {
222  dX = dValue;
223  } else if (iOrder == 1) {
224  dXP = dValue;
225  }
226 }
doublereal dX
Definition: node.h:275
#define ASSERT(expression)
Definition: colamd.c:977
doublereal dXP
Definition: node.h:277
void ScalarDifferentialNode::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 245 of file node.cc.

References dX, dXP, DofOwnerOwner::iGetFirstIndex(), and VectorHandler::PutCoef().

248 {
249  integer iIndex = iGetFirstIndex();
250  X.PutCoef(iIndex + 1, dX);
251  XP.PutCoef(iIndex + 1, dXP);
252 }
doublereal dX
Definition: node.h:275
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
doublereal dXP
Definition: node.h:277
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void ScalarDifferentialNode::SetX ( const doublereal d)
virtual

Implements ScalarNode.

Definition at line 232 of file node.cc.

References dX.

233 {
234  dX = d;
235 }
doublereal dX
Definition: node.h:275
void ScalarDifferentialNode::SetXPrime ( const doublereal d)
virtual

Implements ScalarNode.

Definition at line 239 of file node.cc.

References dXP.

240 {
241  dXP = d;
242 }
doublereal dXP
Definition: node.h:277
void ScalarDifferentialNode::Update ( const class VectorHandler X,
const class VectorHandler XP 
)
virtual

Definition at line 255 of file node.cc.

References dX, dXP, dXPPrev, dXPrev, and DofOwnerOwner::iGetFirstIndex().

257 {
258  integer iFirstIndex = iGetFirstIndex() + 1;
259 
260  dXPrev = dX;
261  dXPPrev = dXP;
262 
263  dX = X(iFirstIndex);
264  dXP = XP(iFirstIndex);
265 }
doublereal dXPPrev
Definition: node.h:282
doublereal dX
Definition: node.h:275
doublereal dXPrev
Definition: node.h:280
doublereal dXP
Definition: node.h:277
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

Member Data Documentation

doublereal ScalarDifferentialNode::dX
mutableprotected

Definition at line 275 of file node.h.

Referenced by dGetDofValue(), dGetPrivData(), dGetX(), Output(), Restart(), SetDofValue(), SetValue(), SetX(), and Update().

doublereal ScalarDifferentialNode::dXP
mutableprotected
doublereal ScalarDifferentialNode::dXPPrev
protected

Definition at line 282 of file node.h.

Referenced by dGetDofValuePrev(), and Update().

doublereal ScalarDifferentialNode::dXPrev
protected

Definition at line 280 of file node.h.

Referenced by dGetDofValuePrev(), and Update().


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