64 Li(Li), L0(L0), V0(V0), F0(F0),
65 Activation(pAct), bActivationOverflow(bActivationOverflow)
91 virtual std::ostream&
Restart(std::ostream& out)
const {
92 out <<
"muscle pennestri"
93 ", initial length, " <<
Li
94 <<
", reference length, " <<
L0
95 <<
", reference velocity, " <<
V0
96 <<
", reference force, " <<
F0
105 return out <<
" " <<
a;
114 silent_cerr(
"MusclePennestriCL: activation underflow (a=" <<
a <<
")" << std::endl);
120 silent_cerr(
"MusclePennestriCL: activation overflow (a=" <<
a <<
")" << std::endl);
151 :
MusclePennestriCL(pTplDC, dPreStress, Li, L0, V0, F0, pAct, bActivationOverflow)
183 out <<
", ergonomy, yes";
200 :
MusclePennestriCL(pTplDC, dPreStress, Li, L0, V0, F0, pAct, bActivationOverflow),
237 a = aRef +
dKp*(x - dLRef) +
dKd*v;
239 silent_cerr(
"MusclePennestriCL: activation underflow (a=" <<
a <<
")" << std::endl);
245 silent_cerr(
"MusclePennestriCL: activation overflow (a=" <<
a <<
")" << std::endl);
268 <<
", proportional gain, " <<
dKp
269 <<
", derivative gain, " <<
dKd
284 silent_cerr(
"MusclePennestriCL:\n"
285 " muscle Pennestri ,\n"
286 " [ initial length , <Li> , ]\n"
287 " reference length , <L0> ,\n"
288 " [ reference velocity , <V0> , ]\n"
289 " reference force , <F0> ,\n"
290 " activation , (DriveCaller) <activation>\n"
291 " [ , activation check , (bool)<activation_check> ]\n"
292 " [ , ergonomy , { yes | no } , ]\n"
293 " [ , reflexive , # only when ergonomy == no\n"
294 " proportional gain , <kp> ,\n"
295 " derivative gain , <kd> ,\n"
296 " reference length, (DriveCaller) <lref> ]\n"
297 " [ , prestress, <prestress> ]\n"
298 " [ , prestrain, (DriveCaller) <prestrain> ]\n"
307 bool bGotErgo(
false);
309 silent_cerr(
"MusclePennestriCL: deprecated, \"ergonomy\" "
311 <<
" should be at end of definition" << std::endl);
320 silent_cerr(
"MusclePennestriCL: null or negative initial length "
326 if (!HP.
IsKeyWord(
"reference" "length")) {
327 silent_cerr(
"MusclePennestriCL: \"reference length\" expected "
333 silent_cerr(
"MusclePennestriCL: null or negative reference length "
340 if (HP.
IsKeyWord(
"reference" "velocity")) {
343 silent_cerr(
"MusclePennestriCL: null or negative reference velocity "
349 if (!HP.
IsKeyWord(
"reference" "force")) {
350 silent_cerr(
"MusclePennestriCL: \"reference force\" expected "
356 silent_cerr(
"MusclePennestriCL: null or negative reference force "
362 silent_cerr(
"MusclePennestriCL: \"activation\" expected "
368 bool bActivationOverflow(
false);
369 if (HP.
IsKeyWord(
"activation" "check")) {
374 if (!bGotErgo && HP.
IsKeyWord(
"ergonomy")) {
378 bool bReflexive(
false);
384 silent_cerr(
"MusclePennestriCL: "
385 "\"reflexive\" and \"ergonomy\" incompatible "
391 if (!HP.
IsKeyWord(
"proportional" "gain")) {
392 silent_cerr(
"MusclePennestriCL: \"proportional gain\" expected "
398 if (!HP.
IsKeyWord(
"derivative" "gain")) {
399 silent_cerr(
"MusclePennestriCL: \"derivative gain\" expected "
405 if (!HP.
IsKeyWord(
"reference" "length")) {
406 silent_cerr(
"MusclePennestriCL: \"reference length\" expected "
425 Li, L0, V0, F0, pAct,
426 bActivationOverflow));
428 }
else if (bReflexive) {
431 Li, L0, V0, F0, pAct,
438 Li, L0, V0, F0, pAct,
439 bActivationOverflow));
455 if (!
SetCL1D(
"muscle" "pennestri", rf1D)) {
458 silent_cerr(
"MusclePennestriCL: "
459 "module_init(" << module_name <<
") "
460 "failed" << std::endl);
GradientExpression< UnaryExpr< FuncExp, Expr > > exp(const GradientExpression< Expr > &u)
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
virtual ~MusclePennestriCL(void)
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime)
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime)
virtual ~MusclePennestriErgoCL(void)
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
#define MBDYN_EXCEPT_ARGS
virtual ConstLawType::Type GetConstLawType(void) const
virtual ConstLawType::Type GetConstLawType(void) const
virtual std::ostream & Restart(std::ostream &out) const
MusclePennestriCL(const TplDriveCaller< doublereal > *pTplDC, doublereal dPreStress, doublereal Li, doublereal L0, doublereal V0, doublereal F0, const DriveCaller *pAct, bool bActivationOverflow)
DriveOwner ReferenceLength
MusclePennestriReflexiveCL(const TplDriveCaller< doublereal > *pTplDC, doublereal dPreStress, doublereal Li, doublereal L0, doublereal V0, doublereal F0, const DriveCaller *pAct, bool bActivationOverflow, doublereal dKp, doublereal dKd, const DriveCaller *pReferenceLength)
virtual std::ostream & Restart_int(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const =0
virtual std::ostream & Restart_int(std::ostream &out) const
virtual ConstitutiveLaw< doublereal, doublereal > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
virtual bool GetYesNoOrBool(bool bDefval=false)
virtual std::ostream & Restart_int(std::ostream &out) const
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
TplDriveCaller< doublereal > * pGetDriveCaller(void) const
virtual bool IsKeyWord(const char *sKeyWord)
MusclePennestriErgoCL(const TplDriveCaller< doublereal > *pTplDC, doublereal dPreStress, doublereal Li, doublereal L0, doublereal V0, doublereal F0, const DriveCaller *pAct, bool bActivationOverflow)
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime)
bool SetCL1D(const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
DriveCaller * pGetDriveCaller(void) const
void GetPreStress(MBDynParser &HP, T &PreStress)
virtual DriveCaller * pCopy(void) const =0
doublereal dGet(const doublereal &dVar) const
virtual ~MusclePennestriReflexiveCL(void)
DriveCaller * GetDriveCaller(bool bDeferred=false)
GradientExpression< UnaryExpr< FuncAtan, Expr > > atan(const GradientExpression< Expr > &u)
int module_init(const char *module_name, void *pdm, void *php)
This function registers our user defined element for the math parser.
virtual HighParser::ErrOut GetLineData(void) const
static std::stack< const HighParser * > pHP
virtual std::ostream & Restart_int(std::ostream &out) const
virtual std::ostream & OutputAppend(std::ostream &out) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)