MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
NLPViscoElasticConstitutiveLaw< T, Tder > Class Template Reference
Inheritance diagram for NLPViscoElasticConstitutiveLaw< T, Tder >:
Collaboration diagram for NLPViscoElasticConstitutiveLaw< T, Tder >:

Public Member Functions

 NLPViscoElasticConstitutiveLaw (const TplDriveCaller< T > *pDC, const T &PStress, const ConstLawType::Type &cltype, const Tder &fde0, const std::vector< const DifferentiableScalarFunction * > &fdesc, const Tder &fdeprime0, const std::vector< const DifferentiableScalarFunction * > &fdeprimesc)
 
virtual ~NLPViscoElasticConstitutiveLaw (void)
 
ConstLawType::Type GetConstLawType (void) const
 
virtual ConstitutiveLaw< T,
Tder > * 
pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual void Update (const T &Eps, const T &EpsPrime=0.)
 
- Public Member Functions inherited from ElasticConstitutiveLaw< T, Tder >
 ElasticConstitutiveLaw (const TplDriveCaller< T > *pDC, const T &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< T, Tder >
 ConstitutiveLaw (void)
 
virtual ~ConstitutiveLaw (void)
 
virtual void AfterConvergence (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
virtual const T & GetEpsilon (void) const
 
virtual const T & GetEpsilonPrime (void) const
 
virtual const T & GetF (void) const
 
virtual const Tder & GetFDE (void) const
 
virtual const Tder & GetFDEPrime (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< T >
 TplDriveOwner (const TplDriveCaller< T > *pDC=0)
 
virtual ~TplDriveOwner (void)
 
void Set (const TplDriveCaller< T > *pDC)
 
TplDriveCaller< T > * pGetDriveCaller (void) const
 
Get (const doublereal &dVar) const
 
Get (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual T GetP (void) const
 

Private Attributes

ConstLawType::Type CLType
 
Tder FDE0
 
Tder FDEPrime0
 
std::vector< const
DifferentiableScalarFunction * > 
FDEsc
 
std::vector< const
DifferentiableScalarFunction * > 
FDEPrimesc
 

Additional Inherited Members

- Public Types inherited from ConstitutiveLaw< T, Tder >
typedef ConstitutiveLaw< T,
Tder >::ErrNotAvailable 
Err
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Protected Member Functions inherited from ElasticConstitutiveLaw< T, Tder >
virtual std::ostream & Restart_int (std::ostream &out) const
 
- Protected Attributes inherited from ElasticConstitutiveLaw< T, Tder >
PreStress
 
- Protected Attributes inherited from ConstitutiveLaw< T, Tder >
Epsilon
 
EpsilonPrime
 
F
 
Tder FDE
 
Tder FDEPrime
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from TplDriveOwner< T >
TplDriveCaller< T > * pTplDriveCaller
 

Detailed Description

template<class T, class Tder>
class NLPViscoElasticConstitutiveLaw< T, Tder >

Definition at line 46 of file constltp_nlp.cc.

Constructor & Destructor Documentation

template<class T , class Tder >
NLPViscoElasticConstitutiveLaw< T, Tder >::NLPViscoElasticConstitutiveLaw ( const TplDriveCaller< T > *  pDC,
const T &  PStress,
const ConstLawType::Type cltype,
const Tder &  fde0,
const std::vector< const DifferentiableScalarFunction * > &  fdesc,
const Tder &  fdeprime0,
const std::vector< const DifferentiableScalarFunction * > &  fdeprimesc 
)
inline

Definition at line 56 of file constltp_nlp.cc.

References NLPViscoElasticConstitutiveLaw< T, Tder >::FDE0, and NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrime0.

63  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress),
64  CLType(cltype),
65  FDE0(fde0), FDEPrime0(fdeprime0),
66  FDEsc(fdesc), FDEPrimesc(fdeprimesc)
67  {
70  };
std::vector< const DifferentiableScalarFunction * > FDEPrimesc
Definition: constltp_nlp.cc:53
std::vector< const DifferentiableScalarFunction * > FDEsc
Definition: constltp_nlp.cc:52
template<class T , class Tder >
virtual NLPViscoElasticConstitutiveLaw< T, Tder >::~NLPViscoElasticConstitutiveLaw ( void  )
inlinevirtual

Definition at line 72 of file constltp_nlp.cc.

References NO_OP.

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

Member Function Documentation

template<class T , class Tder >
ConstLawType::Type NLPViscoElasticConstitutiveLaw< T, Tder >::GetConstLawType ( void  ) const
inlinevirtual

Reimplemented from ElasticConstitutiveLaw< T, Tder >.

Definition at line 76 of file constltp_nlp.cc.

References NLPViscoElasticConstitutiveLaw< T, Tder >::CLType.

76  {
77  return CLType;
78  };
template<class T , class Tder >
virtual ConstitutiveLaw<T, Tder>* NLPViscoElasticConstitutiveLaw< T, Tder >::pCopy ( void  ) const
inlinevirtual

Implements ConstitutiveLaw< T, Tder >.

Definition at line 80 of file constltp_nlp.cc.

References NLPViscoElasticConstitutiveLaw< T, Tder >::CLType, NLPViscoElasticConstitutiveLaw< T, Tder >::FDE0, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrime0, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrimesc, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEsc, and SAFENEWWITHCONSTRUCTOR.

Referenced by NLPViscoElasticConstitutiveLaw< doublereal, doublereal >::pCopy().

80  {
81  ConstitutiveLaw<T, Tder>* pCL = NULL;
82 
84  SAFENEWWITHCONSTRUCTOR(pCL, cl,
88  return pCL;
89  };
std::vector< const DifferentiableScalarFunction * > FDEPrimesc
Definition: constltp_nlp.cc:53
std::vector< const DifferentiableScalarFunction * > FDEsc
Definition: constltp_nlp.cc:52
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
Definition: constltp_nlp.cc:80
template<class T , class Tder >
virtual std::ostream& NLPViscoElasticConstitutiveLaw< T, Tder >::Restart ( std::ostream &  out) const
inlinevirtual

Reimplemented from ConstitutiveLaw< T, Tder >.

Definition at line 91 of file constltp_nlp.cc.

References NLPViscoElasticConstitutiveLaw< T, Tder >::FDE0, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrime0, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrimesc, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEsc, MBDYN_EXCEPT_ARGS, and ElasticConstitutiveLaw< T, Tder >::Restart_int().

91  {
92  silent_cerr("NLPViscoElasticConstitutiveLaw: Restart not implemented"
93  << std::endl);
95 
96 #if 0 /* ScalarFunction restart not implemented yet */
97  out << "nlp viscoelastic, ",
98  FDE0.Write(out, ", ");
99 
100  for (unsigned i = 0; i < FDEsc.size(); i++) {
101  out << ", ";
102  if (FDEsc[i]) {
103  FDEsc[i]->Restart(out);
104 
105  } else {
106  out << "null";
107  }
108  }
109 
110  out << ", ", FDEPrime0.Write(out, ", ");
111 
112  for (unsigned i = 0; i < FDEPrimesc.size(); i++) {
113  out << ", ";
114  if (FDEsc[i]) {
115  FDEPrimesc[i]->Restart(out);
116 
117  } else {
118  out << "null";
119  }
120  }
121 
123 #endif
124  };
std::vector< const DifferentiableScalarFunction * > FDEPrimesc
Definition: constltp_nlp.cc:53
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual std::ostream & Restart_int(std::ostream &out) const
std::vector< const DifferentiableScalarFunction * > FDEsc
Definition: constltp_nlp.cc:52

Here is the call graph for this function:

template<class T , class Tder >
virtual void NLPViscoElasticConstitutiveLaw< T, Tder >::Update ( const T &  Eps,
const T &  EpsPrime = 0. 
)
inlinevirtual

Implements ConstitutiveLaw< T, Tder >.

Definition at line 126 of file constltp_nlp.cc.

References NLPViscoElasticConstitutiveLaw< T, Tder >::CLType, ConstLawType::ELASTIC, ConstitutiveLaw< T, Tder >::F, ConstitutiveLaw< T, Tder >::FDE, NLPViscoElasticConstitutiveLaw< T, Tder >::FDE0, ConstitutiveLaw< T, Tder >::FDEPrime, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrime0, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEPrimesc, NLPViscoElasticConstitutiveLaw< T, Tder >::FDEsc, TplDriveOwner< T >::Get(), and ConstLawType::VISCOUS.

126  {
129 
132 
137  }
141  }
142 
143  for (unsigned i = 0; i < FDEsc.size(); i++) {
144 
145  /*
146  * each diagonal coefficient is:
147  *
148  * f = (f0' + f'(eps))*eps + (f0'' + f''(eps))*epsPrime
149  *
150  * so the Jacobian matrix contributions are
151  *
152  * f/eps = f0' + f' + f'/eps * eps + f''/eps * epsPrime
153  * f/epsPrime = f''
154  */
155 
156  doublereal dEps = E(i + 1);
157 
158  doublereal f = 0.;
159  doublereal fde = 0.;
160 
161  if ((CLType & ConstLawType::ELASTIC) && FDEsc[i]) {
162  doublereal df1 = (*FDEsc[i])(dEps);
163  doublereal df1DE = FDEsc[i]->ComputeDiff(dEps);
164  f += df1*dEps;
165  fde += df1 + df1DE*dEps;
166  }
167 
168  if ((CLType & ConstLawType::VISCOUS) && FDEPrimesc[i]) {
169  doublereal df2 = (*FDEPrimesc[i])(dEps);
170  doublereal df2DE = FDEPrimesc[i]->ComputeDiff(dEps);
171  doublereal dEpsPrime = EpsPrime(i + 1);
172  f += df2*dEpsPrime;
173  fde += df2DE*dEpsPrime;
174  ConstitutiveLaw<T, Tder>::FDEPrime(i + 1, i + 1) += df2;
175  }
176 
177  ConstitutiveLaw<T, Tder>::F(i + 1) += f;
178  ConstitutiveLaw<T, Tder>::FDE(i + 1, i + 1) += fde;
179  }
180  };
std::vector< const DifferentiableScalarFunction * > FDEPrimesc
Definition: constltp_nlp.cc:53
std::vector< const DifferentiableScalarFunction * > FDEsc
Definition: constltp_nlp.cc:52
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


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