MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
GiNaCViscousConstitutiveLaw< doublereal, doublereal > Class Template Reference

#include <ginaccltp.h>

Inheritance diagram for GiNaCViscousConstitutiveLaw< doublereal, doublereal >:
Collaboration diagram for GiNaCViscousConstitutiveLaw< doublereal, doublereal >:

Public Member Functions

 GiNaCViscousConstitutiveLaw (const doublereal &PStress, std::vector< std::string > &epsilonPrime, std::vector< std::string > &expression)
 
virtual ~GiNaCViscousConstitutiveLaw (void)
 
virtual ConstitutiveLaw
< doublereal, doublereal > * 
pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void Update (const doublereal &Eps, const doublereal &EpsPrime=0.)
 
- Public Member Functions inherited from SymbolicViscousConstitutiveLaw< doublereal, doublereal >
 SymbolicViscousConstitutiveLaw (const doublereal &PStress, std::vector< std::string > &epsilonPrime, std::vector< std::string > &expression)
 
virtual ~SymbolicViscousConstitutiveLaw (void)
 
virtual ConstLawType::Type GetConstLawType (void) const
 
- Public Member Functions inherited from ElasticConstitutiveLaw< doublereal, doublereal >
 ElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress)
 
virtual ~ElasticConstitutiveLaw (void)
 
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 std::ostream & OutputAppend (std::ostream &out) 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
 

Private Attributes

GiNaC::symbol gEpsPrime
 
GiNaC::ex gExpr
 
GiNaC::ex gExprDEpsPrime
 

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
 
- Protected Member Functions inherited from ElasticConstitutiveLaw< doublereal, doublereal >
virtual std::ostream & Restart_int (std::ostream &out) const
 
- 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
 

Detailed Description

template<>
class GiNaCViscousConstitutiveLaw< doublereal, doublereal >

Definition at line 564 of file ginaccltp.h.

Constructor & Destructor Documentation

GiNaCViscousConstitutiveLaw< doublereal, doublereal >::GiNaCViscousConstitutiveLaw ( const doublereal PStress,
std::vector< std::string > &  epsilonPrime,
std::vector< std::string > &  expression 
)

Definition at line 583 of file ginaccltp.h.

References GiNaCViscousConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscousConstitutiveLaw< T, Tder >::gExpr, GiNaCViscousConstitutiveLaw< T, Tder >::gExprDEpsPrime, and GiNaCViscousConstitutiveLaw< T, Tder >::Update().

587 : SymbolicViscousConstitutiveLaw<doublereal, doublereal>(PStress, epsilonPrime, expression),
588 gEpsPrime(epsilonPrime[0])
589 {
591 
592  GiNaC::lst l;
593 
594  l.append(gEpsPrime);
595 
596  try {
597  gExpr = GiNaC::ex(expression[0], l);
598  } catch (std::exception& e) {
599  silent_cerr("GiNaCViscousConstitutiveLaw<doublereal, doublereal>: expression parsing failed: " << e.what() << std::endl);
600  throw e;
601  }
602 
603  try {
605  } catch (std::exception& e) {
606  silent_cerr("GiNaCViscousConstitutiveLaw<doublereal, doublereal>: expression differentiation wrt/ EpsPrime failed: " << e.what() << std::endl);
607  throw e;
608  }
609 
610  silent_cout("\tGiNaCViscousConstitutiveLaw:" << std::endl
611  << "\t\tEpsPrime: \"" << gEpsPrime << "\"" << std::endl
612  << "\t\tConstitutive law: \"" << gExpr << "\"" << std::endl
613  << "\t\tDer/EpsPrime: \"" << gExprDEpsPrime << "\"" << std::endl);
614 
615  // try and evaluate the constitutive law
616  try {
618  }
619  catch (std::exception& e) {
620  silent_cerr("GiNaCViscousConstitutiveLaw<doublereal, doublereal>::GiNaCViscousConstitutiveLaw: Update() failed (" << e.what() << ")" << std::endl);
621  throw e;
622  }
623 }
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime=0.)
Definition: ginaccltp.h:667

Here is the call graph for this function:

Definition at line 625 of file ginaccltp.h.

References NO_OP.

626 {
627  NO_OP;
628 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 631 of file ginaccltp.h.

References GiNaCViscousConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscousConstitutiveLaw< T, Tder >::gExpr, and SAFENEWWITHCONSTRUCTOR.

632 {
634 
635  std::ostringstream epsPrime;
636  std::ostringstream expr;
637 
638  epsPrime << gEpsPrime;
639  expr << gExpr;
640 
641  std::vector<std::string> epsilonPrime;
642  std::vector<std::string> expression;
643 
644  epsilonPrime.push_back(epsPrime.str());
645  expression.push_back(expr.str());
646 
649  cl,
651  epsilonPrime, expression));
652 
653  return pCL;
654 }
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
std::ostream & GiNaCViscousConstitutiveLaw< doublereal, doublereal >::Restart ( std::ostream &  out) const
virtual

Reimplemented from ConstitutiveLaw< doublereal, doublereal >.

Definition at line 657 of file ginaccltp.h.

References GiNaCViscousConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscousConstitutiveLaw< T, Tder >::gExpr, and ElasticConstitutiveLaw< T, Tder >::Restart_int().

658 {
659  out << "symbolic viscous isotropic, "
660  << "epsilon prime, \"" << gEpsPrime
661  << "\", expression, \"" << gExpr << "\"";
662 
663  return Restart_int(out);
664 }
virtual std::ostream & Restart_int(std::ostream &out) const

Here is the call graph for this function:

void GiNaCViscousConstitutiveLaw< doublereal, doublereal >::Update ( const doublereal Eps,
const doublereal EpsPrime = 0. 
)
virtual

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 667 of file ginaccltp.h.

References GiNaCViscousConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscousConstitutiveLaw< T, Tder >::gExpr, and GiNaCViscousConstitutiveLaw< T, Tder >::gExprDEpsPrime.

670 {
671  GiNaC::lst l;
672 
674 
675  l.append(gEpsPrime == EpsPrime);
676 
677  GiNaC::ex f_expr = gExpr.subs(l);
680  + GiNaC::ex_to<GiNaC::numeric>(f_expr).to_double();
681 
682  GiNaC::ex f_derEpsPrime = gExprDEpsPrime.subs(l);
683  ConstitutiveLaw<doublereal, doublereal>::FDEPrime = GiNaC::ex_to<GiNaC::numeric>(f_derEpsPrime).to_double();
684 }

Member Data Documentation

GiNaC::symbol GiNaCViscousConstitutiveLaw< doublereal, doublereal >::gEpsPrime
private

Definition at line 567 of file ginaccltp.h.

GiNaC::ex GiNaCViscousConstitutiveLaw< doublereal, doublereal >::gExpr
private

Definition at line 569 of file ginaccltp.h.

GiNaC::ex GiNaCViscousConstitutiveLaw< doublereal, doublereal >::gExprDEpsPrime
private

Definition at line 570 of file ginaccltp.h.


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