MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
NodeDistDCR Struct Reference
Inheritance diagram for NodeDistDCR:
Collaboration diagram for NodeDistDCR:

Public Member Functions

DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)
 
- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from DriveCallerRead
static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 
- Protected Member Functions inherited from DriveCallerRead
void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Detailed Description

Definition at line 89 of file module-nodedistdrive.cc.

Member Function Documentation

DriveCaller * NodeDistDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred 
)
virtual

Implements DriveCallerRead.

Definition at line 95 of file module-nodedistdrive.cc.

References WithLabel::GetLabel(), IncludeParser::GetLineData(), DataManager::GetLogFile(), WithLabel::GetName(), MBDynParser::GetPosRel(), MBDynParser::GetVecRel(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, DriveCallerRead::NeedDM(), Vec3::Norm(), DataManager::pGetDrvHdl(), DataManager::ReadNode(), SAFENEWWITHCONSTRUCTOR, Node::STRUCTURAL, and Zero3.

96 {
97  NeedDM(pDM, HP, bDeferred, "node distance");
98 
99  const DriveHandler* pDrvHdl = 0;
100 
101  if (pDM != 0) {
102  pDrvHdl = pDM->pGetDrvHdl();
103  }
104 
105  DriveCaller *pDC = 0;
106 
107  /* driver legato ad un grado di liberta' nodale */
108  if (pDM == 0) {
109  silent_cerr("sorry, since the driver is not owned by a DataManager" << std::endl
110  << "no DOF dependent drivers are allowed;" << std::endl
111  << "aborting..." << std::endl);
113  }
114 
115  if ( !HP.IsKeyWord("node1") )
116  {
117  silent_cerr("node distance drive caller: keyword \"node1\" expected at line " << HP.GetLineData() << std::endl);
119  }
120 
121  StructNode* const pNode1 = pDM->ReadNode<StructNode, StructDispNode, Node::STRUCTURAL>(HP);
122 
123  const Vec3 o1 = HP.IsKeyWord("offset") ? HP.GetPosRel(ReferenceFrame(pNode1)) : Zero3;
124 
125  if ( !HP.IsKeyWord("node2") )
126  {
127  silent_cerr("node distance drive caller: keyword \"node2\" expected at line " << HP.GetLineData() << std::endl);
129  }
130 
131  StructNode* const pNode2 = pDM->ReadNode<StructNode, StructDispNode, Node::STRUCTURAL>(HP);
132 
133  const Vec3 o2 = HP.IsKeyWord("offset") ? HP.GetPosRel(ReferenceFrame(pNode2)) : Zero3;
134 
135  if ( !HP.IsKeyWord("direction") )
136  {
137  silent_cerr("node distance drive caller: keyword \"direction\" expected at line " << HP.GetLineData() << std::endl);
139  }
140 
141  Vec3 e1 = HP.GetVecRel(ReferenceFrame(pNode2));
142 
143  e1 /= e1.Norm();
144 
145  /* allocazione e creazione */
148  NodeDistDriveCaller(pDrvHdl, pNode1, o1, pNode2, o2, e1));
149 
150  pDM->GetLogFile()
151  << "nodedistdrive: " << pDC->GetLabel()
152  << " (" << pDC->GetName() << ") "
153  << pNode1->GetLabel() << " "
154  << o1 << " "
155  << pNode2->GetLabel() << " "
156  << o2 << " "
157  << e1 << std::endl;
158 
159  return pDC;
160 }
const Vec3 Zero3(0., 0., 0.)
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
doublereal Norm(void) const
Definition: matvec3.h:263
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
Vec3 GetVecRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1584
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
void NeedDM(const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
Definition: drive_.cc:1354
const std::string & GetName(void) const
Definition: withlab.cc:68
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309

Here is the call graph for this function:


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