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

#include <ginaccltp.h>

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

Public Member Functions

 GiNaCElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, std::vector< std::string > &epsilon, std::vector< std::string > &expression)
 
virtual ~GiNaCElasticConstitutiveLaw (void)
 
virtual ConstitutiveLaw
< doublereal, doublereal > * 
pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void Update (const doublereal &Eps, const doublereal &=0.)
 
- Public Member Functions inherited from SymbolicElasticConstitutiveLaw< doublereal, doublereal >
 SymbolicElasticConstitutiveLaw (const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, std::vector< std::string > &epsilon, std::vector< std::string > &expression)
 
virtual ~SymbolicElasticConstitutiveLaw (void)
 
- 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 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::ex gExpr
 
GiNaC::ex gExprDEps
 

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 GiNaCElasticConstitutiveLaw< doublereal, doublereal >

Definition at line 242 of file ginaccltp.h.

Constructor & Destructor Documentation

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

Definition at line 262 of file ginaccltp.h.

References GiNaCElasticConstitutiveLaw< T, Tder >::gEps, GiNaCElasticConstitutiveLaw< T, Tder >::gExpr, GiNaCElasticConstitutiveLaw< T, Tder >::gExprDEps, and GiNaCElasticConstitutiveLaw< T, Tder >::Update().

267 : SymbolicElasticConstitutiveLaw<doublereal, doublereal>(pDC, PStress, epsilon, expression),
268 gEps(epsilon[0])
269 {
271 
272  GiNaC::lst l;
273 
274  l.append(gEps);
275 
276  try {
277  gExpr = GiNaC::ex(expression[0], l);
278 
279  } catch (std::exception& e) {
280  silent_cerr("GiNaCElasticConstitutiveLaw<doublereal, doublereal>: expression parsing failed: " << e.what() << std::endl);
281  throw e;
282  }
283 
284  try {
285  gExprDEps = gExpr.diff(gEps);
286 
287  } catch (std::exception& e) {
288  silent_cerr("GiNaCElasticConstitutiveLaw<doublereal, doublereal>: expression differentiation wrt/ Eps failed: " << e.what() << std::endl);
289  throw e;
290  }
291 
292  silent_cout("\tGiNaCElasticConstitutiveLaw:" << std::endl
293  << "\t\tEps: \"" << gEps << "\"" << std::endl
294  << "\t\tConstitutive law: \"" << gExpr << "\"" << std::endl
295  << "\t\tDer/Eps: \"" << gExprDEps << "\"" << std::endl);
296 
297  // try and evaluate the constitutive law
298  try {
300  }
301  catch (std::exception& e) {
302  silent_cerr("GiNaCElasticConstitutiveLaw<doublereal, doublereal>::GiNaCElasticConstitutiveLaw: Update() failed (" << e.what() << ")" << std::endl);
303  throw e;
304  }
305 }
virtual void Update(const doublereal &Eps, const doublereal &=0.)
Definition: ginaccltp.h:349

Here is the call graph for this function:

Definition at line 307 of file ginaccltp.h.

References NO_OP.

308 {
309  NO_OP;
310 };
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 313 of file ginaccltp.h.

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

314 {
316 
317  std::ostringstream eps;
318  std::ostringstream expr;
319 
320  eps << gEps;
321  expr << gExpr;
322 
323  std::vector<std::string> epsilon;
324  std::vector<std::string> expression;
325 
326  epsilon.push_back(eps.str());
327  expression.push_back(expr.str());
328 
331  cl,
334  epsilon, expression));
335 
336  return pCL;
337 }
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
Definition: ginaccltp.h:313
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698

Here is the call graph for this function:

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

Reimplemented from ConstitutiveLaw< doublereal, doublereal >.

Definition at line 340 of file ginaccltp.h.

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

341 {
342  out << "symbolic elastic isotropic, epsilon, \"" << gEps
343  << "\", expression, \"" << gExpr << "\"";
344 
345  return Restart_int(out);
346 }
virtual std::ostream & Restart_int(std::ostream &out) const

Here is the call graph for this function:

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

Implements ConstitutiveLaw< doublereal, doublereal >.

Definition at line 349 of file ginaccltp.h.

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

351 {
352  GiNaC::lst l;
353 
355 
357 
358  l.append(gEps == e);
359 
360  GiNaC::ex f_expr = gExpr.subs(l);
363  + GiNaC::ex_to<GiNaC::numeric>(f_expr).to_double();
364 
365  GiNaC::ex f_derEps = gExprDEps.subs(l);
366  ConstitutiveLaw<doublereal, doublereal>::FDE = GiNaC::ex_to<GiNaC::numeric>(f_derEps).to_double();
367 }
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 GiNaCElasticConstitutiveLaw< doublereal, doublereal >::gEps
private

Definition at line 245 of file ginaccltp.h.

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

Definition at line 247 of file ginaccltp.h.

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

Definition at line 248 of file ginaccltp.h.


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