60 template <
class T,
class Tder>
68 silent_cerr(
"Constitutive law not available "
69 "for this dimensionality"
75 out <<
"Constitutive law not available "
76 "for this dimensionality"
107 virtual std::ostream&
Restart(std::ostream& out)
const {
111 virtual void Update(
const T& Eps,
const T& EpsPrime = mb_zero<T>()) = 0;
125 virtual const T&
GetF(
void)
const {
143 const char *prefix =
"",
144 bool bInitial =
false)
const
149 bool bInitial =
false,
int i = -1)
const
156 const char *prefix =
"",
157 bool bInitial =
false)
const
163 bool bInitial =
false,
int i = -1)
const
175 template <
typename ConstLaw>
176 static inline void UpdateViscoelastic(ConstLaw* pCl,
const T& Eps,
const T& EpsPrime);
178 template <
typename ConstLaw>
179 static inline void UpdateElastic(ConstLaw* pCl,
const T& Eps);
188 template <
class T,
class Tder>
189 template <
typename ConstLaw>
194 using namespace grad;
199 pCl->EpsilonPrime = EpsPrime;
201 for (
int i = 0; i < N; ++i)
203 gEps(i + 1).SetValuePreserve(Eps(i + 1));
204 gEps(i + 1).DerivativeResizeReset(0, i, MapVectorBase::LOCAL, 1.);
205 gEpsPrime(i + 1).SetValuePreserve(EpsPrime(i + 1));
206 gEpsPrime(i + 1).DerivativeResizeReset(0, i + N, MapVectorBase::LOCAL, 1.);
209 pCl->UpdateViscoelasticTpl(gEps, gEpsPrime, gF);
211 for (
int i = 1; i <= N; ++i)
213 pCl->F(i) = gF(i).dGetValue();
215 for (
int j = 0; j < N; ++j)
217 pCl->FDE(i, j + 1) = gF(i).dGetDerivativeLocal(j);
218 pCl->FDEPrime(i, j + 1) = gF(i).dGetDerivativeLocal(j + N);
223 template <
class T,
class Tder>
224 template <
typename ConstLaw>
229 using namespace grad;
235 for (
int i = 0; i < N; ++i)
237 gEps(i + 1).SetValuePreserve(Eps(i + 1));
238 gEps(i + 1).DerivativeResizeReset(0, i, MapVectorBase::LOCAL, 1.);
241 pCl->UpdateElasticTpl(gEps, gF);
243 for (
int i = 1; i <= N; ++i)
245 pCl->F(i) = gF(i).dGetValue();
247 for (
int j = 0; j < N; ++j)
249 pCl->FDE(i, j + 1) = gF(i).dGetDerivativeLocal(j);
260 template <
class T,
class Tder>
272 ASSERT(pConstLaw != NULL);
273 if (pConstLaw != NULL) {
279 ASSERT(pConstLaw != NULL);
283 inline void Update(
const T& Eps,
const T& EpsPrime = mb_zero<T>()) {
284 ASSERT(pConstLaw != NULL);
285 pConstLaw->Update(Eps, EpsPrime);
289 ASSERT(pConstLaw != NULL);
290 pConstLaw->AfterConvergence(Eps, EpsPrime);
293 inline const T&
GetF(
void)
const {
294 ASSERT(pConstLaw != NULL);
295 return pConstLaw->GetF();
299 ASSERT(pConstLaw != NULL);
300 return pConstLaw->GetFDE();
304 ASSERT(pConstLaw != NULL);
305 return pConstLaw->GetFDEPrime();
310 ASSERT(pConstLaw != NULL);
311 return pConstLaw->iGetNumDof();
315 const char *prefix =
"",
316 bool bInitial =
false)
const
322 bool bInitial =
false,
int i = -1)
const
329 const char *prefix =
"",
330 bool bInitial =
false)
const
336 bool bInitial =
false,
int i = -1)
const
343 ASSERT(pConstLaw != NULL);
344 return pConstLaw->GetDofType(i);
353 return pConstLaw->iGetNumPrivData();
362 return pConstLaw->iGetPrivDataIdx(s);
370 return pConstLaw->dGetPrivData(i);
374 return pConstLaw->OutputAppend(out);
393 template <
class T,
class Tder>
virtual const T & GetF(void) const
virtual const T & GetEpsilon(void) const
ErrNotAvailable(std::ostream &out, MBDYN_EXCEPT_ARGS_DECL)
virtual DofOrder::Order GetDofType(unsigned int i) const
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
#define MBDYN_EXCEPT_ARGS
ErrNotAvailable(MBDYN_EXCEPT_ARGS_DECL)
#define MBDYN_EXCEPT_ARGS_PASSTHRU
virtual unsigned int iGetPrivDataIdx(const char *s) const
ConstitutiveLawOwner< Vec6, Mat6x6 > ConstitutiveLaw6DOwner
virtual unsigned int iGetNumDof(void) const
virtual void DescribeEq(std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
ConstitutiveLawOwner< Vec3, Mat3x3 > ConstitutiveLaw3DOwner
virtual const Tder & GetFDE(void) const
ConstitutiveLaw< Vec3, Mat3x3 > * ReadCL3D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
const Tder & GetFDE(void) const
ConstitutiveLaw< T, Tder > * pConstLaw
#define MBDYN_EXCEPT_ARGS_DECL
virtual unsigned int iGetNumPrivData(void) const
ConstitutiveLawOwner(const ConstitutiveLaw< T, Tder > *pCL)
ConstitutiveLaw< Vec6, Mat6x6 > * ReadCL6D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual void DescribeDof(std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
ConstitutiveLaw< doublereal, doublereal > ConstitutiveLaw1D
virtual ~ConstitutiveLaw(void)
virtual std::ostream & Restart(std::ostream &out) const
virtual void DescribeEq(std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
ConstitutiveLaw< Vec3, Mat3x3 > ConstitutiveLaw3D
ConstitutiveLawOwner< doublereal, doublereal > ConstitutiveLaw1DOwner
virtual std::ostream & OutputAppend(std::ostream &out) const
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
bool SetCL3D(const char *name, ConstitutiveLawRead< Vec3, Mat3x3 > *rf)
virtual const T & GetEpsilonPrime(void) const
virtual ~ConstitutiveLawOwner(void)
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
#define ASSERT(expression)
bool SetCL1D(const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
ConstitutiveLaw< Vec6, Mat6x6 > ConstitutiveLaw6D
virtual void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
ConstitutiveLaw< T, Tder >::ErrNotAvailable Err
virtual doublereal dGetPrivData(unsigned int i) const
bool SetCL6D(const char *name, ConstitutiveLawRead< Vec6, Mat6x6 > *rf)
virtual unsigned int iGetNumDof(void) const
const T & GetF(void) const
ConstitutiveLaw< doublereal, doublereal > * ReadCL1D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual const Tder & GetFDEPrime(void) const
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
virtual std::ostream & DescribeEq(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
const Tder & GetFDEPrime(void) const
void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
virtual DofOrder::Order GetDofType(unsigned int i) const