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

#include <ginaccltp.h>

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

Public Member Functions

 GiNaCViscoElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, std::vector< std::string > &epsilon, std::vector< std::string > &epsilonPrime, std::vector< std::string > &expression)
 
virtual ~GiNaCViscoElasticConstitutiveLaw (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 SymbolicViscoElasticConstitutiveLaw< doublereal, doublereal >
 SymbolicViscoElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, std::vector< std::string > &epsilon, std::vector< std::string > &epsilonPrime, std::vector< std::string > &expression)
 
virtual ~SymbolicViscoElasticConstitutiveLaw (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 gEps
 
GiNaC::symbol gEpsPrime
 
GiNaC::ex gExpr
 
GiNaC::ex gExprDEps
 
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 GiNaCViscoElasticConstitutiveLaw< doublereal, doublereal >

Definition at line 931 of file ginaccltp.h.

Constructor & Destructor Documentation

GiNaCViscoElasticConstitutiveLaw< doublereal, doublereal >::GiNaCViscoElasticConstitutiveLaw ( const TplDriveCaller< doublereal > *  pDC,
const doublereal PStress,
std::vector< std::string > &  epsilon,
std::vector< std::string > &  epsilonPrime,
std::vector< std::string > &  expression 
)

Definition at line 954 of file ginaccltp.h.

References GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEps, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExpr, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExprDEps, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExprDEpsPrime, and GiNaCViscoElasticConstitutiveLaw< T, Tder >::Update().

960 : SymbolicViscoElasticConstitutiveLaw<doublereal, doublereal>(pDC, PStress, epsilon, epsilonPrime, expression),
961 gEps(epsilon[0]), gEpsPrime(epsilonPrime[0])
962 {
965 
966  GiNaC::lst l;
967 
968  l.append(gEps);
969  l.append(gEpsPrime);
970 
971  try {
972  gExpr = GiNaC::ex(expression[0], l);
973  } catch (std::exception& e) {
974  silent_cerr("GiNaCViscoElasticConstitutiveLaw<doublereal, doublereal>: expression parsing failed: " << e.what() << std::endl);
975  throw e;
976  }
977 
978  try {
979  gExprDEps = gExpr.diff(gEps);
980  } catch (std::exception& e) {
981  silent_cerr("GiNaCViscoElasticConstitutiveLaw<doublereal, doublereal>: expression differentiation wrt/ Eps failed: " << e.what() << std::endl);
982  throw e;
983  }
984 
985  try {
987  } catch (std::exception& e) {
988  silent_cerr("GiNaCViscoElasticConstitutiveLaw<doublereal, doublereal>: expression differentiation wrt/ EpsPrime failed: " << e.what() << std::endl);
989  throw e;
990  }
991 
992  silent_cout("\tGiNaCViscoElasticConstitutiveLaw:" << std::endl
993  << "\t\tEps: \"" << gEps << "\"" << std::endl
994  << "\t\tEpsPrime: \"" << gEpsPrime << "\"" << std::endl
995  << "\t\tConstitutive law: \"" << gExpr << "\"" << std::endl
996  << "\t\tDer/Eps: \"" << gExprDEps << "\"" << std::endl
997  << "\t\tDer/EpsPrime: \"" << gExprDEpsPrime << "\"" << std::endl);
998 
999  // try and evaluate the constitutive law
1000  try {
1002  }
1003  catch (std::exception& e) {
1004  silent_cerr("GiNaCViscoElasticConstitutiveLaw<doublereal, doublereal>::GiNaCViscoElasticConstitutiveLaw: Update() failed (" << e.what() << ")" << std::endl);
1005  throw e;
1006  }
1007 }
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime=0.)
Definition: ginaccltp.h:1057

Here is the call graph for this function:

Definition at line 1009 of file ginaccltp.h.

References NO_OP.

1010 {
1011  NO_OP;
1012 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 1015 of file ginaccltp.h.

References GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEps, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEpsPrime, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExpr, GiNaCViscoElasticConstitutiveLaw< T, Tder >::pCopy(), and SAFENEWWITHCONSTRUCTOR.

1016 {
1018 
1019  std::ostringstream eps;
1020  std::ostringstream epsPrime;
1021  std::ostringstream expr;
1022 
1023  eps << gEps;
1024  epsPrime << gEpsPrime;
1025  expr << gExpr;
1026 
1027  std::vector<std::string> epsilon;
1028  std::vector<std::string> epsilonPrime;
1029  std::vector<std::string> expression;
1030 
1031  epsilon.push_back(eps.str());
1032  epsilonPrime.push_back(epsPrime.str());
1033  expression.push_back(expr.str());
1034 
1037  cl,
1040  epsilon, epsilonPrime, expression));
1041 
1042  return pCL;
1043 }
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
Definition: ginaccltp.h:1015
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698

Here is the call graph for this function:

std::ostream & GiNaCViscoElasticConstitutiveLaw< doublereal, doublereal >::Restart ( std::ostream &  out) const
virtual

Reimplemented from ConstitutiveLaw< doublereal, doublereal >.

Definition at line 1046 of file ginaccltp.h.

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

1047 {
1048  out << "symbolic elastic isotropic, "
1049  << "epsilon, \"" << gEps
1050  << "epsilon prime, \"" << gEpsPrime
1051  << "\", expression, \"" << gExpr << "\"";
1052 
1053  return Restart_int(out);
1054 }
virtual std::ostream & Restart_int(std::ostream &out) const

Here is the call graph for this function:

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

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 1057 of file ginaccltp.h.

References GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEps, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gEpsPrime, TplDriveOwner< T >::Get(), GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExpr, GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExprDEps, and GiNaCViscoElasticConstitutiveLaw< T, Tder >::gExprDEpsPrime.

1060 {
1061  GiNaC::lst l;
1062 
1064 
1066 
1067  l.append(gEps == e);
1068 
1070 
1071  l.append(gEpsPrime == EpsPrime);
1072 
1073  GiNaC::ex f_expr = gExpr.subs(l);
1076  + GiNaC::ex_to<GiNaC::numeric>(f_expr).to_double();
1077 
1078  GiNaC::ex f_derEps = gExprDEps.subs(l);
1079  ConstitutiveLaw<doublereal, doublereal>::FDE = GiNaC::ex_to<GiNaC::numeric>(f_derEps).to_double();
1080 
1081  GiNaC::ex f_derEpsPrime = gExprDEpsPrime.subs(l);
1082  ConstitutiveLaw<doublereal, doublereal>::FDEPrime = GiNaC::ex_to<GiNaC::numeric>(f_derEpsPrime).to_double();
1083 }
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

GiNaC::symbol GiNaCViscoElasticConstitutiveLaw< doublereal, doublereal >::gEps
private

Definition at line 934 of file ginaccltp.h.

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

Definition at line 935 of file ginaccltp.h.

Definition at line 937 of file ginaccltp.h.

GiNaC::ex GiNaCViscoElasticConstitutiveLaw< doublereal, doublereal >::gExprDEps
private

Definition at line 938 of file ginaccltp.h.

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

Definition at line 939 of file ginaccltp.h.


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