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

Public Member Functions

 TDConstitutiveLawWrapper (const doublereal &df, const doublereal &dl, const doublereal &dsd, const doublereal &dsf, const doublereal &dInitialWork, ConstitutiveLaw< T, Tder > *pcl)
 
virtual ~TDConstitutiveLawWrapper (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=mb_zero< T >())
 
virtual void AfterConvergence (const T &Eps, const T &EpsPrime=mb_zero< T >())
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
- Public Member Functions inherited from ConstitutiveLaw< T, Tder >
 ConstitutiveLaw (void)
 
virtual ~ConstitutiveLaw (void)
 
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 SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
 
virtual HintParseHint (DataManager *pDM, const char *s) 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)
 

Private Attributes

doublereal dF
 
doublereal dW
 
doublereal dScaleEpsilon
 
doublereal dScaleForce
 
doublereal dWCurr
 
EpsPrev
 
FPrev
 
ConstitutiveLaw< T, Tder > * pCL
 

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 Attributes inherited from ConstitutiveLaw< T, Tder >
Epsilon
 
EpsilonPrime
 
F
 
Tder FDE
 
Tder FDEPrime
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Detailed Description

template<class T, class Tder>
class TDConstitutiveLawWrapper< T, Tder >

Definition at line 43 of file tdclw.cc.

Constructor & Destructor Documentation

template<class T , class Tder >
TDConstitutiveLawWrapper< T, Tder >::TDConstitutiveLawWrapper ( const doublereal df,
const doublereal dl,
const doublereal dsd,
const doublereal dsf,
const doublereal dInitialWork,
ConstitutiveLaw< T, Tder > *  pcl 
)

Definition at line 71 of file tdclw.cc.

References NO_OP.

78 : dF(df), dW(dl), dScaleEpsilon(dsd), dScaleForce(dsf),
79 dWCurr(dInitialWork), EpsPrev(mb_zero<T>()), FPrev(mb_zero<T>()), pCL(pcl)
80 {
81  NO_OP;
82 }
doublereal dWCurr
Definition: tdclw.cc:46
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
#define NO_OP
Definition: myassert.h:74
doublereal dScaleForce
Definition: tdclw.cc:46
doublereal dScaleEpsilon
Definition: tdclw.cc:46
template<class T , class Tder >
TDConstitutiveLawWrapper< T, Tder >::~TDConstitutiveLawWrapper ( void  )
virtual

Definition at line 85 of file tdclw.cc.

86 {
87  if (pCL) {
88  delete pCL;
89  }
90 }
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48

Member Function Documentation

template<class T , class Tder >
void TDConstitutiveLawWrapper< T, Tder >::AfterConvergence ( const T &  Eps,
const T &  EpsPrime = mb_zero<T>() 
)
virtual

Reimplemented from ConstitutiveLaw< T, Tder >.

Definition at line 149 of file tdclw.cc.

References ConstitutiveLaw< T, Tder >::GetF().

150 {
151  T EpsCurr = Eps*dScaleEpsilon;
152  pCL->AfterConvergence(EpsCurr, EpsPrime*dScaleEpsilon);
153 
154  // average force * (old - new epsilon), to avoid unary - operator
155  const T& FCurr = ConstitutiveLaw<T, Tder>::GetF();
156  dWCurr += ((FCurr + FPrev)*(EpsPrev - EpsCurr))/2.;
157 
158  FPrev = FCurr;
159  EpsPrev = EpsCurr;
160 }
doublereal dWCurr
Definition: tdclw.cc:46
virtual const T & GetF(void) const
Definition: constltp.h:125
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
doublereal dScaleEpsilon
Definition: tdclw.cc:46

Here is the call graph for this function:

template<class T , class Tder >
ConstLawType::Type TDConstitutiveLawWrapper< T, Tder >::GetConstLawType ( void  ) const
virtual

Implements ConstitutiveLaw< T, Tder >.

Definition at line 94 of file tdclw.cc.

95 {
96  return pCL->GetConstLawType();
97 }
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
template<class T , class Tder >
std::ostream & TDConstitutiveLawWrapper< T, Tder >::OutputAppend ( std::ostream &  out) const
virtual

Reimplemented from SimulationEntity.

Definition at line 164 of file tdclw.cc.

165 {
166  return pCL->OutputAppend(out) << " " << dWCurr;
167 }
doublereal dWCurr
Definition: tdclw.cc:46
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
template<class T , class Tder >
ConstitutiveLaw< T, Tder > * TDConstitutiveLawWrapper< T, Tder >::pCopy ( void  ) const
virtual

Implements ConstitutiveLaw< T, Tder >.

Definition at line 101 of file tdclw.cc.

References SAFENEWWITHCONSTRUCTOR.

102 {
103  ConstitutiveLaw<T, Tder>* pcl = NULL;
104 
105  typedef TDConstitutiveLawWrapper cl;
106  SAFENEWWITHCONSTRUCTOR(pcl, cl,
107  cl(dF, dW, dScaleEpsilon, dScaleForce, dWCurr, pCL->pCopy()));
108  return pcl;
109 }
doublereal dWCurr
Definition: tdclw.cc:46
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
doublereal dScaleForce
Definition: tdclw.cc:46
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
doublereal dScaleEpsilon
Definition: tdclw.cc:46
template<class T , class Tder >
std::ostream & TDConstitutiveLawWrapper< T, Tder >::Restart ( std::ostream &  out) const
virtual

Reimplemented from ConstitutiveLaw< T, Tder >.

Definition at line 113 of file tdclw.cc.

114 {
115  out
116  << "tdclw, " << dF
117  << ", " << dW
118  << ", scale deformation, " << dScaleEpsilon
119  << ", scale force, " << dScaleForce
120  << ", ";
121  return pCL->Restart(out);
122 }
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
doublereal dScaleForce
Definition: tdclw.cc:46
doublereal dScaleEpsilon
Definition: tdclw.cc:46
template<class T , class Tder >
void TDConstitutiveLawWrapper< T, Tder >::Update ( const T &  Eps,
const T &  EpsPrime = mb_zero<T>() 
)
virtual

Implements ConstitutiveLaw< T, Tder >.

Definition at line 126 of file tdclw.cc.

References ConstLawType::ELASTIC, grad::exp(), ConstitutiveLaw< T, Tder >::GetF(), ConstitutiveLaw< T, Tder >::GetFDE(), ConstitutiveLaw< T, Tder >::GetFDEPrime(), ConstitutiveLaw< T, Tder >::Update(), and ConstLawType::VISCOUS.

127 {
128 #if 0
129  // not needed
131 #endif
132 
133  pCL->Update(Eps*dScaleEpsilon, EpsPrime*dScaleEpsilon);
134 
135  // don't use dWCurr if > 0.
136  doublereal d = dScaleForce*(1. + dF*exp(-std::min(0., dWCurr)/dW));
137 
138  ConstitutiveLaw<T, Tder>::F = pCL->GetF()*d;
140  ConstitutiveLaw<T, Tder>::FDE = pCL->GetFDE()*d;
141  }
143  ConstitutiveLaw<T, Tder>::FDEPrime = pCL->GetFDEPrime()*d;
144  }
145 }
GradientExpression< UnaryExpr< FuncExp, Expr > > exp(const GradientExpression< Expr > &u)
Definition: gradient.h:2975
doublereal dWCurr
Definition: tdclw.cc:46
ConstitutiveLaw< T, Tder > * pCL
Definition: tdclw.cc:48
ConstLawType::Type GetConstLawType(void) const
Definition: tdclw.cc:94
doublereal dScaleForce
Definition: tdclw.cc:46
doublereal dScaleEpsilon
Definition: tdclw.cc:46
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

Member Data Documentation

template<class T , class Tder >
doublereal TDConstitutiveLawWrapper< T, Tder >::dF
private

Definition at line 46 of file tdclw.cc.

template<class T , class Tder >
doublereal TDConstitutiveLawWrapper< T, Tder >::dScaleEpsilon
private

Definition at line 46 of file tdclw.cc.

template<class T , class Tder >
doublereal TDConstitutiveLawWrapper< T, Tder >::dScaleForce
private

Definition at line 46 of file tdclw.cc.

template<class T , class Tder >
doublereal TDConstitutiveLawWrapper< T, Tder >::dW
private

Definition at line 46 of file tdclw.cc.

template<class T , class Tder >
doublereal TDConstitutiveLawWrapper< T, Tder >::dWCurr
private

Definition at line 46 of file tdclw.cc.

template<class T , class Tder >
T TDConstitutiveLawWrapper< T, Tder >::EpsPrev
private

Definition at line 47 of file tdclw.cc.

template<class T , class Tder >
T TDConstitutiveLawWrapper< T, Tder >::FPrev
private

Definition at line 47 of file tdclw.cc.

template<class T , class Tder >
ConstitutiveLaw<T, Tder>* TDConstitutiveLawWrapper< T, Tder >::pCL
private

Definition at line 48 of file tdclw.cc.


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