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

Public Member Functions

 MusclePennestriCL (const TplDriveCaller< doublereal > *pTplDC, doublereal dPreStress, doublereal Li, doublereal L0, doublereal V0, doublereal F0, const DriveCaller *pAct, bool bActivationOverflow)
 
virtual ~MusclePennestriCL (void)
 
virtual ConstLawType::Type GetConstLawType (void) const
 
virtual ConstitutiveLaw
< doublereal, doublereal > * 
pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void Update (const doublereal &Eps, const doublereal &EpsPrime)
 
- Public Member Functions inherited from ElasticConstitutiveLaw< doublereal, doublereal >
 ElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress)
 
virtual ~ElasticConstitutiveLaw (void)
 
ConstLawType::Type GetConstLawType (void) const
 
void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
- Public Member Functions inherited from ConstitutiveLaw< doublereal, doublereal >
 ConstitutiveLaw (void)
 
virtual ~ConstitutiveLaw (void)
 
virtual void AfterConvergence (const doublereal &Eps, const doublereal &EpsPrime=mb_zero< doublereal >())
 
virtual const doublerealGetEpsilon (void) const
 
virtual const doublerealGetEpsilonPrime (void) const
 
virtual const doublerealGetF (void) const
 
virtual const doublerealGetFDE (void) const
 
virtual const doublerealGetFDEPrime (void) const
 
virtual unsigned int iGetNumDof (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 DofOrder::Order GetDofType (unsigned int i) 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 void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
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 unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from TplDriveOwner< doublereal >
 TplDriveOwner (const TplDriveCaller< doublereal > *pDC=0)
 
virtual ~TplDriveOwner (void)
 
void Set (const TplDriveCaller< doublereal > *pDC)
 
TplDriveCaller< doublereal > * pGetDriveCaller (void) const
 
doublereal Get (const doublereal &dVar) const
 
doublereal Get (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual doublereal GetP (void) const
 

Protected Member Functions

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

Protected Attributes

doublereal Li
 
doublereal L0
 
doublereal V0
 
doublereal F0
 
DriveOwner Activation
 
bool bActivationOverflow
 
doublereal a
 
- Protected Attributes inherited from ElasticConstitutiveLaw< doublereal, doublereal >
doublereal PreStress
 
- Protected Attributes inherited from ConstitutiveLaw< doublereal, doublereal >
doublereal Epsilon
 
doublereal EpsilonPrime
 
doublereal F
 
doublereal FDE
 
doublereal FDEPrime
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from TplDriveOwner< doublereal >
TplDriveCaller< doublereal > * pTplDriveCaller
 

Additional Inherited Members

- Public Types inherited from ConstitutiveLaw< doublereal, doublereal >
typedef ConstitutiveLaw
< doublereal, doublereal >
::ErrNotAvailable 
Err
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 

Detailed Description

Definition at line 44 of file module-muscles.cc.

Constructor & Destructor Documentation

MusclePennestriCL::MusclePennestriCL ( const TplDriveCaller< doublereal > *  pTplDC,
doublereal  dPreStress,
doublereal  Li,
doublereal  L0,
doublereal  V0,
doublereal  F0,
const DriveCaller pAct,
bool  bActivationOverflow 
)
inline

Definition at line 60 of file module-muscles.cc.

References NO_OP.

Referenced by pCopy().

virtual MusclePennestriCL::~MusclePennestriCL ( void  )
inlinevirtual

Definition at line 70 of file module-muscles.cc.

References NO_OP.

70  {
71  NO_OP;
72  };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

virtual ConstLawType::Type MusclePennestriCL::GetConstLawType ( void  ) const
inlinevirtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Reimplemented in MusclePennestriErgoCL.

Definition at line 74 of file module-muscles.cc.

References ConstLawType::VISCOELASTIC.

virtual std::ostream& MusclePennestriCL::OutputAppend ( std::ostream &  out) const
inlinevirtual

Reimplemented from SimulationEntity.

Definition at line 104 of file module-muscles.cc.

References a.

104  {
105  return out << " " << a;
106  };
virtual ConstitutiveLaw<doublereal, doublereal>* MusclePennestriCL::pCopy ( void  ) const
inlinevirtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Reimplemented in MusclePennestriReflexiveCL, and MusclePennestriErgoCL.

Definition at line 78 of file module-muscles.cc.

References Activation, bActivationOverflow, F0, L0, Li, MusclePennestriCL(), DriveCaller::pCopy(), TplDriveOwner< doublereal >::pGetDriveCaller(), DriveOwner::pGetDriveCaller(), ElasticConstitutiveLaw< doublereal, doublereal >::PreStress, SAFENEWWITHCONSTRUCTOR, and V0.

78  {
80 
81  // pass parameters to copy constructor
84  PreStress,
85  Li, L0, V0, F0,
88  return pCL;
89  };
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
MusclePennestriCL(const TplDriveCaller< doublereal > *pTplDC, doublereal dPreStress, doublereal Li, doublereal L0, doublereal V0, doublereal F0, const DriveCaller *pAct, bool bActivationOverflow)
TplDriveCaller< doublereal > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual DriveCaller * pCopy(void) const =0
DriveOwner Activation

Here is the call graph for this function:

virtual std::ostream& MusclePennestriCL::Restart ( std::ostream &  out) const
inlinevirtual

Reimplemented from ConstitutiveLaw< doublereal, doublereal >.

Definition at line 91 of file module-muscles.cc.

References Activation, bActivationOverflow, F0, L0, Li, DriveOwner::pGetDriveCaller(), DriveCaller::Restart(), Restart_int(), ElasticConstitutiveLaw< T, Tder >::Restart_int(), and V0.

91  {
92  out << "muscle pennestri"
93  ", initial length, " << Li
94  << ", reference length, " << L0
95  << ", reference velocity, " << V0
96  << ", reference force, " << F0
97  << ", activation, ", Activation.pGetDriveCaller()->Restart(out)
98  << ", activation check, " << bActivationOverflow,
99  Restart_int(out)
101  return out;
102  };
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
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
DriveOwner Activation

Here is the call graph for this function:

virtual std::ostream& MusclePennestriCL::Restart_int ( std::ostream &  out) const
inlineprotectedvirtual

Reimplemented from ElasticConstitutiveLaw< doublereal, doublereal >.

Reimplemented in MusclePennestriReflexiveCL, and MusclePennestriErgoCL.

Definition at line 55 of file module-muscles.cc.

Referenced by Restart().

55  {
56  return out;
57  };
virtual void MusclePennestriCL::Update ( const doublereal Eps,
const doublereal EpsPrime 
)
inlinevirtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Reimplemented in MusclePennestriReflexiveCL, and MusclePennestriErgoCL.

Definition at line 108 of file module-muscles.cc.

References a, Activation, grad::atan(), bActivationOverflow, DriveOwner::dGet(), grad::exp(), F0, TplDriveOwner< T >::Get(), L0, Li, grad::pow(), ElasticConstitutiveLaw< doublereal, doublereal >::PreStress, and V0.

Referenced by MusclePennestriErgoCL::Update().

108  {
111 
112  a = Activation.dGet();
113  if (a < 0.) {
114  silent_cerr("MusclePennestriCL: activation underflow (a=" << a << ")" << std::endl);
115  if (bActivationOverflow) {
116  a = 0.;
117  }
118 
119  } else if (a > 1.) {
120  silent_cerr("MusclePennestriCL: activation overflow (a=" << a << ")" << std::endl);
121  if (bActivationOverflow) {
122  a = 1.;
123  }
124  }
125 
126  doublereal dxdEps = Li/L0;
127  doublereal dvdEpsPrime = Li/V0;
130 
131  doublereal f1 = std::exp(std::pow(x - 0.95, 2) - 40*std::pow(x - 0.95, 4));
132  doublereal f2 = 1.6 - 1.6*std::exp(0.1/std::pow(v - 1., 2) - 1.1/std::pow(v - 1., 4));
133  doublereal f3 = 1.3*std::atan(0.1*std::pow(x - 0.22, 10));
134 
135  doublereal df1dx = f1*(2*(x - 0.95) - 4*40.*std::pow(x - 0.95, 3));
136  doublereal df2dv = 1.6*std::exp(0.1/std::pow(v - 1., 2) - 1.1/std::pow(v - 1, 4))*(2*0.1/std::pow(v - 1., 3) - 4*1.1/std::pow(v - 1., 5));
137  doublereal df3dx = 1.3*std::pow(x - 0.22, 9)/(0.01*std::pow(x - 0.22, 20) + 1);
138 
140  ConstitutiveLaw<doublereal, doublereal>::FDE = F0*(df1dx*f2*a + df3dx)*dxdEps;
142  };
GradientExpression< UnaryExpr< FuncExp, Expr > > exp(const GradientExpression< Expr > &u)
Definition: gradient.h:2975
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
DriveOwner Activation
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
GradientExpression< UnaryExpr< FuncAtan, Expr > > atan(const GradientExpression< Expr > &u)
Definition: gradient.h:2985
double doublereal
Definition: colamd.c:52
T Get(void) const
Definition: tpldrive.h:113

Here is the call graph for this function:

Member Data Documentation

doublereal MusclePennestriCL::a
protected

Definition at line 53 of file module-muscles.cc.

Referenced by OutputAppend(), Update(), and MusclePennestriReflexiveCL::Update().

bool MusclePennestriCL::bActivationOverflow
protected

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