MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
module-wheel4.cc File Reference
#include "mbconfig.h"
#include <iostream>
#include <limits>
#include <cfloat>
#include "module-wheel4.h"
#include "dataman.h"
#include "userelem.h"
#include "simentity.h"
#include "body.h"
Include dependency graph for module-wheel4.cc:

Go to the source code of this file.

Functions

int module_init (const char *module_name, void *pdm, void *php)
 This function registers our user defined element for the math parser. More...
 

Function Documentation

int module_init ( const char *  module_name,
void *  pdm,
void *  php 
)

This function registers our user defined element for the math parser.

It is called when the "module load" statement appears in the input file.

Definition at line 2047 of file module-wheel4.cc.

References HighParser::GetString(), HighParser::IsArg(), pHP, and SetUDE().

2048 {
2050  if (!SetUDE("rigid" "ring" "tire", rf)) {
2051  delete rf;
2052  silent_cerr("RigidRingTire: "
2053  "module_init(" << module_name << ") "
2054  "failed" << std::endl);
2055  return -1;
2056  }
2057 
2058  // DataManager *pDM = (DataManager *)pdm;
2059  MBDynParser *pHP = (MBDynParser *)php;
2060 
2061  while (pHP->IsArg()) {
2062  const char *s = pHP->GetString();
2063  if (s == 0) {
2064  silent_cerr("RigidRingTire: "
2065  "unable to get arg; "
2066  "module_init(" << module_name << ") "
2067  "failed" << std::endl);
2068  return -1;
2069  }
2070 
2071  rf = new UDERead<Wheel4>;
2072  if (!SetUDE(s, rf)) {
2073  delete rf;
2074  silent_cerr("Wheel4: "
2075  "unable to set parser for name \"" << s << "\"; "
2076  "module_init(" << module_name << ") "
2077  "failed" << std::endl);
2078  return -1;
2079  }
2080  }
2081 
2083  if (!SetUDE("timestep", rf2)) {
2084  delete rf2;
2085  silent_cerr("module-timestep: "
2086  "module_init(" << module_name << ") "
2087  "failed" << std::endl);
2088  return -1;
2089  }
2090 
2091  return 0;
2092 }
virtual std::string GetString(const std::string &sDefVal)
Definition: parser.cc:1074
virtual bool IsArg(void)
Definition: parser.cc:807
bool SetUDE(const std::string &s, UserDefinedElemRead *rude)
Definition: userelem.cc:97
static std::stack< const HighParser * > pHP
Definition: parser.cc:598

Here is the call graph for this function: