40 const std::string& var,
const std::string& expression)
45 gVar =
new GiNaC::symbol(var);
49 gExpr = GiNaC::ex(expression, l);
51 }
catch (std::exception& e) {
52 silent_cerr(
"GiNaCDriveCaller: "
53 "expression \"" << expression <<
"\" parsing failed: " << e.what()
61 }
catch (std::exception& e) {
62 silent_cerr(
"GiNaCDriveCaller: "
63 "expression \"" << expression <<
"\" differentiation wrt/ \"Var\" failed: " << e.what()
68 pedantic_cout(
"GiNacDriveCaller: symbol=\"" << *
gVar <<
"\" expression=\"" <<
gExpr <<
"\" derivative=\"" <<
gExprDVar <<
"\"" << std::endl);
82 std::ostringstream var, expr;
97 out <<
" ginac, symbol, \"" << *
gVar <<
"\", \"" <<
gExpr <<
"\"";
113 l.append(*
gVar == dVar);
117 return GiNaC::ex_to<GiNaC::numeric>(f_expr).to_double();
132 silent_cerr(
"unable to read ginac drive caller symbol at line "
142 if (expression.empty()) {
143 silent_cerr(
"unable to read ginac drive caller expression at line "
DriveCaller * Read(const DataManager *pDM, MBDynParser &HP, bool bDeferred)
#define MBDYN_EXCEPT_ARGS
virtual ~GiNaCDriveCaller(void)
const DriveHandler * pGetDrvHdl(void) const
GiNaCDriveCaller(const DriveHandler *pDH, const std::string &var, const std::string &expression)
virtual std::ostream & Restart(std::ostream &out) const
virtual DriveCaller * pCopy(void) const
virtual bool IsKeyWord(const char *sKeyWord)
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual doublereal dGetP(void) const
virtual bool bIsDifferentiable(void) const
virtual HighParser::ErrOut GetLineData(void) const