MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
constltp_impl.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/constltp_impl.h,v 1.41 2017/01/12 14:46:09 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /* Legami costitutivi */
33 
34 
35 #ifndef CONSTLTP_IMPL_H
36 #define CONSTLTP_IMPL_H
37 
38 #include <limits>
39 #include <cfloat>
40 #include <cmath>
41 
42 #include "tpldrive_impl.h"
43 #include "constltp.h"
44 #include "hint_impl.h"
45 #include "elem.h"
46 
47 /* ConstitutiveLawArray - begin */
48 
49 template <class T, class Tder>
51 : public ConstitutiveLaw<T, Tder> {
52 protected:
54  std::vector<ConstitutiveLaw<T, Tder> *> m_clv;
55 
56 public:
58  : m_clv(clv)
59  {
60  unsigned type = 0;
61  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::const_iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
62  type |= (*i)->GetConstLawType();
63  }
64  m_type = ConstLawType::Type(type);
65  };
66 
67  virtual ~ConstitutiveLawArray(void)
68  {
69  NO_OP;
70  };
71 
73  return m_type;
74  };
75 
76  void SetValue(DataManager *pDM,
79  {
80  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
81  (*i)->SetValue(pDM, X, XP, ph);
82  }
83  };
84 
85  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
86  ConstitutiveLaw<T, Tder>* pCL = 0;
87 
88  std::vector<ConstitutiveLaw<T, Tder> *> clv(m_clv.size());
89  for (unsigned i = 0; i < m_clv.size(); i++) {
90  clv[i] = m_clv[i]->pCopy();
91  }
92 
94  SAFENEWWITHCONSTRUCTOR(pCL, cl, cl(clv));
95  return pCL;
96  };
97 
98  virtual std::ostream& Restart(std::ostream& out) const {
99  out << "array, " << m_clv.size();
100  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::const_iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
101  out << ", ", (*i)->Restart(out);
102  }
103  return out;
104  };
105 
106  virtual void Update(const T& Eps, const T& EpsPrime = ::mb_zero<T>()) {
109  ConstitutiveLaw<T, Tder>::F = ::mb_zero<T>();
111  ConstitutiveLaw<T, Tder>::FDE = ::mb_zero<Tder>();
112  }
114  ConstitutiveLaw<T, Tder>::FDEPrime = ::mb_zero<Tder>();
115  }
116 
117  bool bChangeJac(false);
118  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
119  try {
120  (*i)->Update(Eps, EpsPrime);
121  }
122  catch (Elem::ChangedEquationStructure& e) {
123  bChangeJac = true;
124  }
126  if (m_type & ConstLawType::ELASTIC) {
128  }
129 
130  if (m_type & ConstLawType::VISCOUS) {
132  }
133  }
134  if (bChangeJac) {
135  /* if activating, ask for jacobian rigeneration */
137  }
138  };
139 
140  virtual void AfterConvergence(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
143 
144  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
145  (*i)->AfterConvergence(Eps, EpsPrime);
146  }
147  };
148 
149  virtual std::ostream& OutputAppend(std::ostream& out) const {
150  for (typename std::vector<ConstitutiveLaw<T, Tder> *>::const_iterator i = m_clv.begin(); i != m_clv.end(); ++i) {
151  (*i)->OutputAppend(out);
152  }
153  return out;
154  };
155 };
156 
157 /* ConstitutiveLawArray - end */
158 
159 
160 /* ElasticConstitutiveLaw - begin */
161 
162 template <class T, class Tder>
164 : public ConstitutiveLaw<T, Tder>, public TplDriveOwner<T> {
165 protected:
167 
168  virtual std::ostream&
169  Restart_int(std::ostream& out) const
170  {
171  out << ", prestress, ",
172  Write(out, PreStress /* + GetF() */ , ", ");
174  out << ", prestrain, single, ",
175  Write(out, -ConstitutiveLaw<T, Tder>::Epsilon, ", ") << ", one /* ",
176  TplDriveOwner<T>::pGetDriveCaller()->Restart(out) << " */ ";
177  }
178 
179  return out;
180  };
181 
182 public:
183  ElasticConstitutiveLaw(const TplDriveCaller<T>* pDC, const T& PStress)
184  : TplDriveOwner<T>(pDC), PreStress(PStress)
185  {
186  NO_OP;
187  };
188 
190  {
191  NO_OP;
192  };
193 
195  return ConstLawType::ELASTIC;
196  };
197 
200  SimulationEntity::Hints *ph = 0)
201  {
202  if (ph) {
203  for (unsigned i = 0; i < ph->size(); ++i) {
204  TplVecHint<T> *pStressH = dynamic_cast<TplVecHint<T> *>((*ph)[i]);
205 
206  if (pStressH) {
207  PreStress = pStressH->pCreateVec(pDM);
208  continue;
209  }
210 
211  TplDriveHint<T> *pStrainH = dynamic_cast<TplDriveHint<T> *>((*ph)[i]);
212 
213  if (pStrainH) {
214  TplDriveCaller<T> *pDC = pStrainH->pCreateDrive(pDM);
215  if (pDC == 0) {
216  silent_cerr("ElasticConstitutiveLaw: "
217  "unable to create prestrain drive after hint "
218  "#" << i << std::endl);
220  }
222 
223  continue;
224  }
225  }
226  }
227  };
228 
229  virtual Hint *
230  ParseHint(DataManager *pDM, const char *s) const
231  {
232  if (strncasecmp(s, "prestress{" /*}*/ , STRLENOF("prestress{" /*}*/ )) == 0) {
233  s += STRLENOF("prestress{" /*}*/ );
234 
235  size_t len = strlen(s);
236 
237  if (s[len - 1] != '}') {
238  return 0;
239  }
240 
241  char *sStr = new char[len + 1];
242  memcpy(sStr, s, len + 1);
243  sStr[len - 1] = ';';
244 
245  return new TplVecHint<T>(sStr);
246 
247  } else if (strncasecmp(s, "prestrain{" /*}*/ , STRLENOF("prestrain{" /*}*/ )) == 0) {
248  s += STRLENOF("prestrain{" /*}*/ );
249 
250  size_t len = strlen(s);
251 
252  if (s[len - 1] != '}') {
253  return 0;
254  }
255 
256  char *sStr = new char[len + 1];
257  memcpy(sStr, s, len + 1);
258  sStr[len - 1] = ';';
259 
260  return new TplDriveHint<T>(sStr);
261  }
262 
263  return 0;
264  };
265 };
266 
270 
271 /* ElasticConstitutiveLaw - end */
272 
273 
274 /* LinearElasticIsotropicConstitutiveLaw - begin */
275 
276 template <class T, class Tder>
278 : public ElasticConstitutiveLaw<T, Tder> {
279 private:
281 
282 public:
284  const T& PStress, doublereal dStiff)
285  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress), dStiffness(dStiff) {
287  };
288 
290  NO_OP;
291  };
292 
293  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
294  ConstitutiveLaw<T, Tder>* pCL = 0;
295 
298  cl,
301  dStiffness));
302  return pCL;
303  };
304 
305  virtual std::ostream& Restart(std::ostream& out) const {
306  out << "linear elastic isotropic, " << dStiffness;
308  };
309 
310  virtual void Update(const T& Eps, const T& /* EpsPrime */ = mb_zero<T>()) {
314  };
315 };
316 
320 
321 /* LinearElasticIsotropicConstitutiveLaw - end */
322 
323 
324 /* LinearElasticGenericConstitutiveLaw - begin */
325 
326 template <class T, class Tder>
328 : public ElasticConstitutiveLaw<T, Tder> {
329 public:
331  const T& PStress, const Tder& Stiff)
332  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
334  };
335 
337  NO_OP;
338  };
339 
340  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
341  ConstitutiveLaw<T, Tder>* pCL = 0;
342 
345  cl,
349  return pCL;
350  };
351 
352  virtual std::ostream& Restart(std::ostream& out) const {
353  out << "linear elastic generic, ",
356  };
357 
358  virtual void Update(const T& Eps, const T& /* EpsPrime */ = mb_zero<T>()) {
362  };
363 };
364 
368 
369 /* LinearElasticGenericConstitutiveLaw - end */
370 
371 
372 /* LinearElasticGenericAxialTorsionCouplingConstitutiveLaw - begin */
373 
374 template <class T, class Tder>
376 : public ElasticConstitutiveLaw<T, Tder> {
377 public:
379  const T& PStress,
380  const Tder& = mb_zero<Tder>(),
381  doublereal = 0.)
382  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
383  throw (typename ConstitutiveLaw<T, Tder>::Err(std::cerr, "axial-torsion coupling constitutive law "
384  "is allowed only for beams (6x6)"));
385  };
386 
388  NO_OP;
389  };
390 
391  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
392  return 0;
393  };
394 
395  virtual std::ostream& Restart(std::ostream& out) const {
396  return out;
397  };
398 
399  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
400  NO_OP;
401  };
402 };
403 
404 template<>
406 : public ElasticConstitutiveLaw6D {
407 protected:
411 
412 public:
414  const Vec6& PStress, const Mat6x6& Stiff,
415  doublereal dAxTors)
416  : ElasticConstitutiveLaw6D(pDC, PStress),
417  Stiffness(Stiff),
418  dRefTorsion(Stiffness.dGet(4, 4)),
419  dAxialTorsionCoupling(dAxTors) {
420  FDE = Stiffness;
421  };
422 
424  NO_OP;
425  };
426 
427  virtual ConstitutiveLaw<Vec6, Mat6x6>* pCopy(void) const {
429 
432  cl,
433  cl(pGetDriveCaller()->pCopy(),
434  PreStress,
435  Stiffness,
436  dAxialTorsionCoupling));
437 
438  return pCL;
439  };
440 
441  virtual std::ostream& Restart(std::ostream& out) const {
442  out << "linear elastic generic axial torsion coupling, ",
443  Write(out, FDE, ", ") << ", " << dAxialTorsionCoupling;
444  return Restart_int(out);
445  };
446 
447  virtual void Update(const Vec6& Eps, const Vec6& /* EpsPrime */ = mb_zero<Vec6>()) {
448  Epsilon = Eps;
449  doublereal d = Epsilon.dGet(1);
450  FDE.Put(4, 4, dRefTorsion + d*dAxialTorsionCoupling);
451  F = PreStress + FDE*(Epsilon-Get());
452  };
453 };
454 
455 /* LinearElasticGenericAxialTorsionCouplingConstitutiveLaw - end */
456 
457 
458 /* CubicElasticGenericConstitutiveLaw - begin */
459 
460 template <class T, class Tder>
462 : public ElasticConstitutiveLaw<T, Tder> {
463 public:
465  const T& PStress, const T& Stiff1, const T& Stiff2, const T& Stiff3)
466  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
467  throw (typename ConstitutiveLaw<T, Tder>::Err(std::cerr, "cubic elastic generic constitutive law "
468  "is allowed only for scalar and 3x3"));
469  };
470 
472  NO_OP;
473  };
474 
475  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
476  return 0;
477  };
478 
479  virtual std::ostream& Restart(std::ostream& out) const {
480  return out;
481  };
482 
483  virtual void Update(const T& Eps, const T& /* EpsPrime */ = mb_zero<T>()) {
484  NO_OP;
485  };
486 };
487 
488 template <>
490 : public ElasticConstitutiveLaw1D {
491 private:
495 
496 public:
498  const doublereal& PStress, const doublereal& Stiff1,
499  const doublereal& Stiff2, const doublereal& Stiff3)
500  : ElasticConstitutiveLaw1D(pDC, PStress),
501  Stiff1(Stiff1), Stiff2(Stiff2), Stiff3(Stiff3)
502  {
503  NO_OP;
504  };
505 
507  NO_OP;
508  };
509 
510  virtual ConstitutiveLaw1D* pCopy(void) const {
511  ConstitutiveLaw1D* pCL = 0;
512 
515  cl,
518  Stiff1, Stiff2, Stiff3));
519  return pCL;
520  };
521 
522  virtual std::ostream& Restart(std::ostream& out) const {
523  out << "cubic elastic generic, ",
524  Write(out, Stiff1, ", ") << ", ",
525  Write(out, Stiff2, ", ") << ", ",
526  Write(out, Stiff3, ", ") << ", ";
528  };
529 
530  virtual void Update(const doublereal& Eps, const doublereal& /* EpsPrime */ = 0.) {
533  doublereal f1 = fabs(e1);
534  doublereal e2 = e1*e1;
535  doublereal f2 = f1*e1;
536  doublereal e3 = e2*e1;
537  ConstitutiveLaw1D::FDE = Stiff1 + 2.*Stiff2*f1 + 3.*Stiff3*e2;
539  + Stiff1*e1 + Stiff2*f2 + Stiff3*e3;
540  };
541 };
542 
543 template <>
545 : public ElasticConstitutiveLaw3D {
546 private:
550 
551 public:
553  const Vec3& PStress, const Vec3& Stiff1,
554  const Vec3& Stiff2, const Vec3& Stiff3)
555  : ElasticConstitutiveLaw3D(pDC, PStress),
556  Stiff1(Stiff1), Stiff2(Stiff2), Stiff3(Stiff3)
557  {
558  NO_OP;
559  };
560 
562  NO_OP;
563  };
564 
565  virtual ConstitutiveLaw3D* pCopy(void) const {
566  ConstitutiveLaw3D* pCL = 0;
567 
570  cl,
573  Stiff1, Stiff2, Stiff3));
574  return pCL;
575  };
576 
577  virtual std::ostream& Restart(std::ostream& out) const {
578  out << "cubic elastic generic, ",
579  Write(out, Stiff1, ", ") << ", ",
580  Write(out, Stiff2, ", ") << ", ",
581  Write(out, Stiff3, ", ") << ", ";
583  };
584 
585  virtual void Update(const Vec3& Eps, const Vec3& /* EpsPrime */ = Zero3) {
587  Vec3 v1 = Eps - ElasticConstitutiveLaw3D::Get();
589 
590 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
591  Vec3 FTmp;
592 #endif // MBDYN_X_WORKAROUND_GCC_3_2 || MBDYN_X_WORKAROUND_GCC_3_3
593 
594  for (int iCnt = 1; iCnt <= 3; iCnt++) {
595  doublereal e1 = v1(iCnt);
596  doublereal f1 = fabs(e1);
597  doublereal e2 = e1*e1;
598  doublereal f2 = f1*e1;
599  doublereal e3 = e2*e1;
600 
601 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
602  ConstitutiveLaw3D::FDE.Put(iCnt, iCnt,
603  Stiff1(iCnt)
604  + 2.*Stiff2(iCnt)*f1
605  + 3.*Stiff3(iCnt)*e2);
606  FTmp(iCnt) = Stiff1(iCnt)*e1
607  + Stiff2(iCnt)*f2
608  + Stiff3(iCnt)*e3;
609 #else // ! MBDYN_X_WORKAROUND_GCC_3_2 && ! MBDYN_X_WORKAROUND_GCC_3_3
610  ConstitutiveLaw3D::FDE(iCnt, iCnt) = Stiff1(iCnt) + 2.*Stiff2(iCnt)*f1 + 3.*Stiff3(iCnt)*e2;
611  ConstitutiveLaw3D::F(iCnt) += Stiff1(iCnt)*e1 + Stiff2(iCnt)*f2 + Stiff3(iCnt)*e3;
612 #endif // ! MBDYN_X_WORKAROUND_GCC_3_2 && ! MBDYN_X_WORKAROUND_GCC_3_3
613  }
614 
615 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
616  ConstitutiveLaw3D::F += FTmp;
617 #endif // MBDYN_X_WORKAROUND_GCC_3_3 || MBDYN_X_WORKAROUND_GCC_3_3
618  };
619 };
620 
621 /* CubicElasticGenericConstitutiveLaw - end */
622 
623 
624 /* InverseSquareConstitutiveLaw - begin */
625 
627 : public ElasticConstitutiveLaw1D {
628 private:
631 
632 public:
634  const doublereal& PStress,
635  const doublereal& A, const doublereal& L0)
636  : ElasticConstitutiveLaw1D(pDC, PStress),
637  m_A(A), m_L0(L0)
638  {
639  NO_OP;
640  };
641 
643  NO_OP;
644  };
645 
646  virtual ConstitutiveLaw1D* pCopy(void) const {
647  ConstitutiveLaw1D* pCL = 0;
648 
653  m_A, m_L0));
654  return pCL;
655  };
656 
657  virtual std::ostream& Restart(std::ostream& out) const {
658  out << "inverse square, " << m_A << ", " << m_L0;
660  };
661 
662  virtual void Update(const doublereal& Eps, const doublereal& /* EpsPrime */ = 0.) {
665  doublereal d = m_L0*(1 + e1);
666  doublereal d2 = d*d;
668  ConstitutiveLaw1D::FDE = -2.*m_A/(d2*d)*m_L0;
669  };
670 };
671 
672 /* InverseSquareConstitutiveLaw - end */
673 
674 
675 /* LogConstitutiveLaw - begin */
676 
677 template <class T, class Tder>
679 : public ElasticConstitutiveLaw<T, Tder> {
680 public:
682  const T& PStress,
683  doublereal = 0.)
684  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
685  throw (typename ElasticConstitutiveLaw<T, Tder>::Err(std::cerr, "log constitutive law is allowed only for rods"));
686  };
687 
688  virtual ~LogConstitutiveLaw(void) {
689  NO_OP;
690  };
691 
692  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
693  return 0;
694  };
695 
696  virtual std::ostream& Restart(std::ostream& out) const {
697  return out;
698  };
699 
700  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
701  NO_OP;
702  };
703 };
704 
705 template<>
707 : public ElasticConstitutiveLaw1D {
708 private:
711 
712 public:
714  const doublereal& PStress, doublereal dStiff)
715  : ElasticConstitutiveLaw1D(pDC, PStress),
716  dStiffness(dStiff), dCurrEps(0.) {
717  ASSERT(Get() < 1.);
718  };
719 
720  virtual ~LogConstitutiveLaw(void) {
721  NO_OP;
722  };
723 
726 
729  cl,
730  cl(pGetDriveCaller()->pCopy(),
731  PreStress,
732  dStiffness));
733 
734  return pCL;
735  };
736 
737  virtual std::ostream& Restart(std::ostream& out) const {
738  out << "log elastic, " << dStiffness;
739  return Restart_int(out);
740  };
741 
742  virtual void Update(const doublereal& Eps, const doublereal& /* EpsPrime */ = 0.) {
743  Epsilon = Eps;
744 
745  doublereal dPreStrain = Get();
746  dCurrEps = 1. + Epsilon - dPreStrain;
747  ASSERT(dCurrEps > std::numeric_limits<doublereal>::epsilon());
748 
749  if (dCurrEps < std::numeric_limits<doublereal>::epsilon()) {
750  // throw ErrGeneric();
751  dCurrEps = std::numeric_limits<doublereal>::epsilon();
752  }
753 
754  F = PreStress + dStiffness*log(dCurrEps);
755  FDE = dStiffness/dCurrEps;
756  };
757 };
758 
759 /* LogConstitutiveLaw - end */
760 
761 
762 /* DoubleLinearElasticConstitutiveLaw - begin */
763 
764 template <class T, class Tder>
766 : public ElasticConstitutiveLaw<T, Tder> {
767 public:
769  const T& PStress,
770  doublereal = 0.,
771  doublereal = 0.,
772  doublereal = 0.,
773  doublereal = 0.)
774  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
775  throw (typename ElasticConstitutiveLaw<T, Tder>::Err(std::cerr, "double linear elastic constitutive law "
776  "is allowed only for rods and 3D hinges"));
777  };
778 
780  NO_OP;
781  };
782 
783  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
784  return 0;
785  };
786 
787  virtual std::ostream& Restart(std::ostream& out) const {
788  return out;
789  };
790 
791  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
792  NO_OP;
793  };
794 };
795 
796 template<>
798 : public ElasticConstitutiveLaw1D {
799 private:
800  doublereal dStiffness; /* Isotropa: Eye*dStiffness */
805 
806 public:
808  const doublereal& PStress,
809  doublereal dStiff,
810  doublereal dUppLimStrain,
811  doublereal dLowLimStrain,
812  doublereal dSecondStiff)
813  : ElasticConstitutiveLaw1D(pDC, PStress),
814  dStiffness(dStiff),
815  dUpperLimitStrain(dUppLimStrain),
816  dLowerLimitStrain(dLowLimStrain),
817  dSecondStiffness(dSecondStiff) {
818  FDE = dStiffness;
819  };
820 
822  NO_OP;
823  };
824 
827 
830  cl,
831  cl(pGetDriveCaller()->pCopy(),
832  PreStress,
833  dStiffness,
834  dUpperLimitStrain,
835  dLowerLimitStrain,
836  dSecondStiffness));
837 
838  return pCL;
839  };
840 
841  virtual std::ostream& Restart(std::ostream& out) const {
842  out << "double linear elastic, "
843  << dStiffness << ", "
844  << dUpperLimitStrain << ", "
845  << dLowerLimitStrain << ", "
846  << dSecondStiffness;
847  return Restart_int(out);
848  };
849 
850  virtual void Update(const doublereal& Eps, const doublereal& /* EpsPrime */ = 0.) {
851  Epsilon = Eps;
852 
853  doublereal dPreStrain = Get();
854  doublereal dCurrStrain = Epsilon-dPreStrain;
855  if (dCurrStrain <= dUpperLimitStrain && dCurrStrain >= dLowerLimitStrain) {
856  FDE = dStiffness;
857  F = PreStress + dStiffness*dCurrStrain;
858  } else {
859  FDE = dSecondStiffness;
860 
861  if (dCurrStrain > dUpperLimitStrain) {
862  F = PreStress + dStiffness*dUpperLimitStrain
863  + dSecondStiffness*(dCurrStrain - dUpperLimitStrain);
864  } else /* if (dCurrStrain < dLowerLimitStrain) */ {
865  F = PreStress + dStiffness*dLowerLimitStrain
866  + dSecondStiffness*(dCurrStrain - dLowerLimitStrain);
867  }
868  }
869  };
870 };
871 
872 
873 template<>
875 : public ElasticConstitutiveLaw3D {
876 private:
877  doublereal dStiffness; /* Isotropa: Eye*dStiffness */
881 
882 public:
884  const Vec3& PStress,
885  doublereal dStiff,
886  doublereal dUppLimStrain,
887  doublereal dLowLimStrain,
888  doublereal dSecondStiff)
889  : ElasticConstitutiveLaw3D(pDC, PStress),
890  dStiffness(dStiff),
891  dUpperLimitStrain(dUppLimStrain),
892  dLowerLimitStrain(dLowLimStrain),
893  dSecondStiffness(dSecondStiff) {
894  Mat3x3DEye.Manipulate(FDE, dStiffness);
895  };
896 
898  NO_OP;
899  };
900 
901  virtual ConstitutiveLaw<Vec3, Mat3x3>* pCopy(void) const {
903 
906  cl,
907  cl(pGetDriveCaller()->pCopy(),
908  PreStress,
909  dStiffness,
910  dUpperLimitStrain,
911  dLowerLimitStrain,
912  dSecondStiffness));
913 
914  return pCL;
915  };
916 
917  virtual std::ostream& Restart(std::ostream& out) const {
918  out << "double linear elastic, "
919  << dStiffness << ", "
920  << dUpperLimitStrain << ", "
921  << dLowerLimitStrain << ", "
922  << dSecondStiffness;
923  return Restart_int(out);
924  };
925 
926  virtual void Update(const Vec3& Eps, const Vec3& /* EpsPrime */ = Zero3) {
927  Epsilon = Eps;
928 
929  Vec3 PreStrain = Get();
930  Vec3 CurrStrain = Epsilon-PreStrain;
931  doublereal dCurrStrain = CurrStrain.dGet(3);
932 
933  if (dCurrStrain <= dUpperLimitStrain && dCurrStrain >= dLowerLimitStrain) {
934  FDE.Put(3, 3, dStiffness);
935  F = PreStress+CurrStrain*dStiffness;
936  } else {
937  FDE.Put(3, 3, dSecondStiffness);
938 
939  if (dCurrStrain > dUpperLimitStrain) {
940  F = PreStress + Vec3(CurrStrain.dGet(1)*dStiffness,
941  CurrStrain.dGet(2)*dStiffness,
942  dUpperLimitStrain*dStiffness
943  + (dCurrStrain - dUpperLimitStrain)*dSecondStiffness);
944  } else /* if (dCurrStrain < dLowerLimitStrain) */ {
945  F = PreStress + Vec3(CurrStrain.dGet(1)*dStiffness,
946  CurrStrain.dGet(2)*dStiffness,
947  dLowerLimitStrain*dStiffness
948  + (dCurrStrain - dLowerLimitStrain)*dSecondStiffness);
949  }
950  }
951  };
952 };
953 
954 /* DoubleLinearElasticConstitutiveLaw - end */
955 
956 
957 /* IsotropicHardeningConstitutiveLaw - begin */
958 
959 template <class T, class Tder>
961 : public ElasticConstitutiveLaw<T, Tder> {
962 private:
966 
967  /* Legge costitutiva:
968  *
969  * Beta + Alpha*x^2
970  * f = k * ---------------- * x
971  * 1 + Alpha*x^2
972  */
973 
974 public:
976  const T& PStress,
977  doublereal dStiff,
978  doublereal dStiff0,
979  doublereal dEpsHard)
980  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress),
981  dStiffness(dStiff), dAlpha(0.), dBeta(0.)
982  {
983  ASSERT(dEpsHard > std::numeric_limits<doublereal>::epsilon());
984  ASSERT(dStiff > std::numeric_limits<doublereal>::epsilon());
985 
986  dAlpha = 3./(dEpsHard*dEpsHard);
987  dBeta = dStiff0/dStiff;
988  };
989 
991  NO_OP;
992  };
993 
994  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
995  ConstitutiveLaw<T, Tder>* pCL = 0;
996 
999  cl,
1002  dStiffness,
1003  dBeta*dStiffness,
1004  sqrt(3./dAlpha)));
1005 
1006  return pCL;
1007  };
1008 
1009  virtual std::ostream& Restart(std::ostream& out) const {
1010  out << "isotropic hardening elastic, " << dStiffness << ", "
1011  << sqrt(3./dAlpha);
1012  if (dBeta != 0.) {
1013  out << ", linear stiffness, " << dBeta*dStiffness;
1014  }
1016  };
1017 
1018  virtual void Update(const T& Eps, const T& /* EpsPrime */ = Zero3) {
1021  doublereal dx2 = x*x;
1022  doublereal dDen = 1. + dAlpha*dx2;
1024  + x*(dStiffness*(dBeta + dAlpha*dx2)/dDen);
1025  mb_deye<Tder>(ConstitutiveLaw<T, Tder>::FDE, dStiffness*(dBeta + (3. - dBeta + dAlpha*dx2)*dAlpha*dx2)/(dDen*dDen));
1026  };
1027 };
1028 
1032 
1033 /* IsotropicHardeningConstitutiveLaw - end */
1034 
1035 
1036 /* ContactConstitutiveLaw - begin */
1037 
1038 template <class T, class Tder>
1040 : public ElasticConstitutiveLaw<T, Tder> {
1041 
1042 public:
1044  const T& PStress,
1045  const doublereal = 0.,
1046  const doublereal = 0.)
1047  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
1048  throw (typename ElasticConstitutiveLaw<T, Tder>::Err(std::cerr, "contact constitutive law "
1049  "is allowed only for rods"));
1050  };
1051 
1052  virtual ~ContactConstitutiveLaw(void) {
1053  NO_OP;
1054  };
1055 
1056  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1057  return 0;
1058  };
1059 
1060  virtual std::ostream& Restart(std::ostream& out) const {
1061  return out;
1062  };
1063 
1064  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
1065  NO_OP;
1066  };
1067 };
1068 
1069 /*
1070  *
1071  * F = k * ( 1-l_0 / l ) ^ gamma
1072  * ==>
1073  * F = k * ( eps / ( 1 + eps ) ) ^ gamma
1074  *
1075  * d F = gamma * k * ( eps / ( 1 + eps ) ) ^ ( gamma - 1 ) * 1 / ( 1 + eps ) ^ 2 d eps
1076  *
1077  */
1078 
1079 template<>
1081 : public ElasticConstitutiveLaw1D {
1082 private:
1085 
1086 public:
1088  const doublereal& PStress,
1089  const doublereal& dKappa,
1090  const doublereal& dGamma)
1091  : ElasticConstitutiveLaw1D(pDC, PStress), dKappa(dKappa), dGamma(dGamma) {
1092  NO_OP;
1093  };
1094 
1095  virtual ~ContactConstitutiveLaw(void) {
1096  NO_OP;
1097  };
1098 
1101 
1104  cl,
1105  cl(pGetDriveCaller()->pCopy(),
1106  PreStress,
1107  dKappa,
1108  dGamma));
1109 
1110  return pCL;
1111  };
1112 
1113  virtual std::ostream& Restart(std::ostream& out) const {
1114  out << "contact elastic, "
1115  << dKappa << ", "
1116  << dGamma;
1117  return Restart_int(out);
1118  };
1119 
1120  virtual void Update(const doublereal& Eps, const doublereal& /* EpsPrime */ = 0.) {
1121  doublereal dE;
1122 
1123  Epsilon = Eps;
1124  dE = Epsilon-Get();
1125  if ( dE >= 0. ) {
1126  F = PreStress;
1127  FDE = 0.;
1128  } else {
1129  F = PreStress+dKappa*(1. - 1./pow(1. + dE, dGamma));
1130  FDE = dGamma*dKappa/pow(1. + dE, dGamma + 1.);
1131  }
1132  };
1133 };
1134 
1135 
1136 template<>
1138 : public ElasticConstitutiveLaw3D {
1139 private:
1142 
1143 public:
1145  const Vec3& PStress,
1146  const doublereal& dKappa,
1147  const doublereal& dGamma)
1148  : ElasticConstitutiveLaw3D(pDC, PStress), dKappa(dKappa), dGamma(dGamma) {
1149  F = Zero3;
1150  FDE = Zero3x3;
1151  };
1152 
1153  virtual ~ContactConstitutiveLaw(void) {
1154  NO_OP;
1155  };
1156 
1157  virtual ConstitutiveLaw<Vec3, Mat3x3>* pCopy(void) const {
1159 
1162  cl,
1163  cl(pGetDriveCaller()->pCopy(),
1164  PreStress,
1165  dKappa,
1166  dGamma));
1167 
1168  return pCL;
1169  };
1170 
1171  virtual std::ostream& Restart(std::ostream& out) const {
1172  out << "contact elastic, "
1173  << dKappa << ", "
1174  << dGamma;
1175  return Restart_int(out);
1176  };
1177 
1178  virtual void Update(const Vec3& Eps, const Vec3& /* EpsPrime */ = Zero3) {
1179  doublereal dE;
1180 
1181  Epsilon = Eps;
1182  dE = Epsilon.dGet(3)-Get().dGet(3);
1183  if ( dE >= 0. ) {
1184  F.Put(3, 0.);
1185  FDE.Put(3, 3, 0.);
1186  } else {
1187  F.Put(3, dKappa*(1. - 1./pow(1. + dE, dGamma)));
1188  FDE.Put(3, 3, dGamma*dKappa/pow(1. + dE, dGamma + 1.));
1189  }
1190  };
1191 };
1192 
1196 
1197 /* ContactConstitutiveLaw - end */
1198 
1199 
1200 /* LinearViscousIsotropicConstitutiveLaw - begin */
1201 
1202 template <class T, class Tder>
1204 : public ElasticConstitutiveLaw<T, Tder> {
1205  private:
1206  doublereal dStiffnessPrime; /* Isotropa: Eye*dStiffnessPrime */
1207 
1208  public:
1210  doublereal dStiffPrime)
1211  : ElasticConstitutiveLaw<T, Tder>(0, PStress),
1212  dStiffnessPrime(dStiffPrime) {
1214  };
1215 
1217  NO_OP;
1218  };
1219 
1221  return ConstLawType::VISCOUS;
1222  };
1223 
1224  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1225  ConstitutiveLaw<T, Tder>* pCL = 0;
1226 
1229  cl,
1231  dStiffnessPrime));
1232 
1233  return pCL;
1234  };
1235 
1236  virtual std::ostream& Restart(std::ostream& out) const {
1237  out << "linear viscous isotropic, "
1238  << dStiffnessPrime;
1240  };
1241 
1242  virtual void Update(const T& /* Eps */ , const T& EpsPrime = mb_zero<T>()) {
1245  };
1246 };
1247 
1248 /* LinearViscousIsotropicConstitutiveLaw - end */
1249 
1250 
1251 /* LinearViscousGenericConstitutiveLaw - begin */
1252 
1253 template <class T, class Tder>
1255 : public ElasticConstitutiveLaw<T, Tder> {
1256  public:
1258  const Tder& StiffPrime)
1259  : ElasticConstitutiveLaw<T, Tder>(0, PStress) {
1261  };
1262 
1264  NO_OP;
1265  };
1266 
1268  return ConstLawType::VISCOUS;
1269  };
1270 
1271  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1272  ConstitutiveLaw<T, Tder>* pCL = 0;
1273 
1276  cl,
1279 
1280  return pCL;
1281  };
1282 
1283  virtual std::ostream& Restart(std::ostream& out) const {
1284  out << "linear viscous generic, ",
1287  };
1288 
1289  virtual void Update(const T& /* Eps */ , const T& EpsPrime = mb_zero<T>()) {
1292  };
1293 };
1294 
1295 /* LinearViscousGenericConstitutiveLaw - end */
1296 
1297 
1298 /* LinearViscoElasticIsotropicConstitutiveLaw - begin */
1299 
1300 template <class T, class Tder>
1302 : public ElasticConstitutiveLaw<T, Tder> {
1303  private:
1306 
1307  public:
1309  const T& PStress,
1310  doublereal dStiff,
1311  doublereal dStiffPrime)
1312  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress),
1313  dStiffness(dStiff), dStiffnessPrime(dStiffPrime) {
1314  mb_deye<Tder>(ConstitutiveLaw<T, Tder>::FDE, dStiffness);
1316  };
1317 
1319  NO_OP;
1320  };
1321 
1324  };
1325 
1326  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1327  ConstitutiveLaw<T, Tder>* pCL = 0;
1328 
1331  cl,
1334  dStiffness,
1335  dStiffnessPrime));
1336 
1337  return pCL;
1338  };
1339 
1340  virtual std::ostream& Restart(std::ostream& out) const {
1341  out << "linear viscoelastic isotropic, "
1342  << dStiffness << ", "
1343  << dStiffnessPrime;
1345  };
1346 
1347  virtual void Update(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
1350 
1353  };
1354 };
1355 
1359 
1360 /* LinearViscoElasticIsotropicConstitutiveLaw - end */
1361 
1362 
1363 /* LinearViscoElasticGenericConstitutiveLaw - begin */
1364 
1365 template <class T, class Tder>
1367 : public ElasticConstitutiveLaw<T, Tder> {
1368  public:
1370  const T& PStress,
1371  const Tder& Stiff,
1372  const Tder& StiffPrime)
1373  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
1376  };
1377 
1379  NO_OP;
1380  };
1381 
1384  };
1385 
1386  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1387  ConstitutiveLaw<T, Tder>* pCL = 0;
1388 
1391  cl,
1396 
1397  return pCL;
1398  };
1399 
1400  virtual std::ostream& Restart(std::ostream& out) const {
1401  out << "linear viscoelastic generic, ",
1402  Write(out, ConstitutiveLaw<T, Tder>::FDE, ", ") << ", ",
1405  };
1406 
1407  virtual void Update(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
1413  };
1414 };
1415 
1419 
1420 /* LinearViscoElasticGenericConstitutiveLaw - end */
1421 
1422 /* LTVViscoElasticGenericConstitutiveLaw - begin */
1423 
1424 template <class T, class Tder>
1426 : public ElasticConstitutiveLaw<T, Tder> {
1427 protected:
1429  Tder FDERef;
1434 
1435 public:
1437  const T& PStress,
1438  const Tder& Stiff,
1439  const DriveCaller *pdc,
1440  const Tder& StiffPrime,
1441  const DriveCaller *pdcp)
1442  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress),
1443  FDECoef(pdc), FDEPrimeCoef(pdcp) {
1444  FDERef = Stiff;
1445  dPrevScaleFactor = 0.;
1446  FDEPrimeRef = StiffPrime;
1447  dPrevScaleFactorPrime = 0.;
1448  };
1449 
1451  NO_OP;
1452  };
1453 
1456  };
1457 
1458  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1459  ConstitutiveLaw<T, Tder>* pCL = 0;
1460 
1463  cl,
1466  FDERef,
1468  FDEPrimeRef,
1470 
1471  return pCL;
1472  };
1473 
1474  virtual std::ostream& Restart(std::ostream& out) const {
1475  out << "linear time variant viscoelastic generic, ",
1476  Write(out, FDERef, ", ") << ", ",
1477  FDECoef.pGetDriveCaller()->Restart(out) << ", ",
1478  Write(out, FDEPrimeRef, ", ") << ", ",
1481  };
1482 
1483  virtual void Update(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
1486  doublereal dCurrScaleFactor = FDECoef.dGet();
1487  if (dCurrScaleFactor != dPrevScaleFactor) {
1488  dPrevScaleFactor = dCurrScaleFactor;
1489  ConstitutiveLaw<T, Tder>::FDE = FDERef*dCurrScaleFactor;
1490  }
1491  doublereal dCurrScaleFactorPrime = FDEPrimeCoef.dGet();
1492  if (dCurrScaleFactorPrime != dPrevScaleFactorPrime) {
1493  dPrevScaleFactorPrime = dCurrScaleFactorPrime;
1494  ConstitutiveLaw<T, Tder>::FDEPrime = FDEPrimeRef*dCurrScaleFactorPrime;
1495  }
1499  };
1500 };
1501 
1505 
1506 /* LTVViscoElasticGenericConstitutiveLaw - end */
1507 
1508 /* LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw - begin */
1509 
1510 template <class T, class Tder>
1512 : public ElasticConstitutiveLaw<T, Tder> {
1513 public:
1515  const T& PStress,
1516  const Tder& Stiff,
1517  const Tder& StiffPrime,
1518  doublereal dAxTors)
1519  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
1520  throw (typename ConstitutiveLaw<T, Tder>::Err(std::cerr, "axial-torsion coupling constitutive law "
1521  "is allowed only for beams (6x6)"));
1522  };
1523 
1525  NO_OP;
1526  };
1527 
1530  };
1531 
1532  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1533  return 0;
1534  };
1535 
1536  virtual std::ostream& Restart(std::ostream& out) const {
1537  return out;
1538  };
1539 
1540  virtual void Update(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
1541  NO_OP;
1542  };
1543 };
1544 
1545 template <>
1547 : public ElasticConstitutiveLaw<Vec6, Mat6x6> {
1548 private:
1551 
1552 public:
1554  const Vec6& PStress,
1555  const Mat6x6& Stiff,
1556  const Mat6x6& StiffPrime,
1557  doublereal dAxTors)
1558  : ElasticConstitutiveLaw<Vec6, Mat6x6>(pDC, PStress),
1559  dRefTorsion(Stiff(4, 4)),
1560  dAxialTorsionCoupling(dAxTors) {
1563  };
1564 
1566  NO_OP;
1567  };
1568 
1571  };
1572 
1573  virtual ConstitutiveLaw<Vec6, Mat6x6>* pCopy(void) const {
1575 
1578  cl,
1583  dAxialTorsionCoupling));
1584  return pCL;
1585  };
1586 
1587  virtual std::ostream& Restart(std::ostream& out) const {
1588  doublereal d = FDE(4, 4);
1589  out << "linear viscoelastic generic axial torsion coupling, ",
1590  Write(out, ConstitutiveLaw<Vec6, Mat6x6>::FDE, ", ") << ", ",
1591  Write(out, ConstitutiveLaw<Vec6, Mat6x6>::FDEPrime, ", ") << ", " << dAxialTorsionCoupling;
1594  return out;
1595  };
1596 
1597  virtual void Update(const Vec6& Eps, const Vec6& EpsPrime = mb_zero<Vec6>()) {
1600  doublereal d = Epsilon.dGet(1);
1601  ((Mat6x6&)ConstitutiveLaw<Vec6, Mat6x6>::FDE)(4, 4) = dRefTorsion + d*dAxialTorsionCoupling;
1605  };
1606 };
1607 
1609 
1610 /* LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw - end */
1611 
1612 
1613 /* CubicViscoElasticGenericConstitutiveLaw - begin */
1614 
1615 template <class T, class Tder>
1617 : public ElasticConstitutiveLaw<T, Tder> {
1618 public:
1620  const T& PStress, const T& Stiff1, const T& Stiff2, const T& Stiff3,
1621  const Tder& StiffPrime)
1622  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
1623  throw (typename ConstitutiveLaw<T, Tder>::Err(std::cerr, "cubic viscoelastic generic constitutive law "
1624  "is allowed only for scalar and 3x3"));
1625  };
1626 
1628  NO_OP;
1629  };
1630 
1631  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1632  return 0;
1633  };
1634 
1635  virtual std::ostream& Restart(std::ostream& out) const {
1636  return out;
1637  };
1638 
1639  virtual void Update(const T& Eps, const T& /* EpsPrime */ = mb_zero<T>()) {
1640  NO_OP;
1641  };
1642 };
1643 
1644 template <>
1646 : public ElasticConstitutiveLaw1D {
1647 private:
1651 
1652 public:
1654  const doublereal& PStress, const doublereal& Stiff1,
1655  const doublereal& Stiff2, const doublereal& Stiff3,
1656  const doublereal& StiffPrime)
1657  : ElasticConstitutiveLaw1D(pDC, PStress),
1658  Stiff1(Stiff1), Stiff2(Stiff2), Stiff3(Stiff3)
1659  {
1660  ConstitutiveLaw1D::FDEPrime = StiffPrime;
1661  };
1662 
1664  NO_OP;
1665  };
1666 
1667  virtual ConstitutiveLaw1D* pCopy(void) const {
1668  ConstitutiveLaw1D* pCL = 0;
1669 
1672  cl,
1675  Stiff1, Stiff2, Stiff3, ConstitutiveLaw1D::FDEPrime));
1676  return pCL;
1677  };
1678 
1679  virtual std::ostream& Restart(std::ostream& out) const {
1680  out << "cubic elastic generic, ",
1681  Write(out, Stiff1, ", ") << ", ",
1682  Write(out, Stiff2, ", ") << ", ",
1683  Write(out, Stiff3, ", ") << ", ",
1684  Write(out, ConstitutiveLaw1D::FDEPrime, ", ") << ", ";
1686  };
1687 
1688  virtual void Update(const doublereal& Eps, const doublereal& EpsPrime = 0.) {
1692  doublereal f1 = fabs(e1);
1693  doublereal e2 = e1*e1;
1694  doublereal f2 = f1*e1;
1695  doublereal e3 = e2*e1;
1696  ConstitutiveLaw1D::FDE = Stiff1 + 2.*Stiff2*f1 + 3.*Stiff3*e2;
1698  + Stiff1*e1 + Stiff2*f2 + Stiff3*e3 + ConstitutiveLaw1D::FDEPrime*EpsPrime;
1699  };
1700 };
1701 
1702 template <>
1704 : public ElasticConstitutiveLaw3D {
1705 private:
1709 
1710 public:
1712  const Vec3& PStress, const Vec3& Stiff1,
1713  const Vec3& Stiff2, const Vec3& Stiff3,
1714  const Mat3x3& StiffPrime)
1715  : ElasticConstitutiveLaw3D(pDC, PStress),
1716  Stiff1(Stiff1), Stiff2(Stiff2), Stiff3(Stiff3)
1717  {
1718  ConstitutiveLaw3D::FDEPrime = StiffPrime;
1719  };
1720 
1722  NO_OP;
1723  };
1724 
1725  virtual ConstitutiveLaw3D* pCopy(void) const {
1726  ConstitutiveLaw3D* pCL = 0;
1727 
1730  cl,
1733  Stiff1, Stiff2, Stiff3, ConstitutiveLaw3D::FDEPrime));
1734  return pCL;
1735  };
1736 
1737  virtual std::ostream& Restart(std::ostream& out) const {
1738  out << "cubic elastic generic, ",
1739  Write(out, Stiff1, ", ") << ", ",
1740  Write(out, Stiff2, ", ") << ", ",
1741  Write(out, Stiff3, ", ") << ", ",
1742  Write(out, ConstitutiveLaw3D::FDEPrime, ", ") << ", ";
1744  };
1745 
1746  virtual void Update(const Vec3& Eps, const Vec3& EpsPrime = Zero3) {
1749  Vec3 v1 = Eps - ElasticConstitutiveLaw3D::Get();
1751 
1752 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
1753  Vec3 FTmp;
1754 #endif // MBDYN_X_WORKAROUND_GCC_3_2 || MBDYN_X_WORKAROUND_GCC_3_3
1755 
1756  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1757  doublereal e1 = v1(iCnt);
1758  doublereal f1 = fabs(e1);
1759  doublereal e2 = e1*e1;
1760  doublereal f2 = f1*e1;
1761  doublereal e3 = e2*e1;
1762 
1763 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
1764  ConstitutiveLaw3D::FDE.Put(iCnt, iCnt,
1765  Stiff1(iCnt)
1766  + 2.*Stiff2(iCnt)*f1
1767  + 3.*Stiff3(iCnt)*e2);
1768  FTmp(iCnt) = Stiff1(iCnt)*e1
1769  + Stiff2(iCnt)*f2
1770  + Stiff3(iCnt)*e3;
1771 #else // ! MBDYN_X_WORKAROUND_GCC_3_2 && ! MBDYN_X_WORKAROUND_GCC_3_3
1772  ConstitutiveLaw3D::FDE(iCnt, iCnt) = Stiff1(iCnt)
1773  + 2.*Stiff2(iCnt)*f1 + 3.*Stiff3(iCnt)*e2;
1774  ConstitutiveLaw3D::F(iCnt) += Stiff1(iCnt)*e1
1775  + Stiff2(iCnt)*f2 + Stiff3(iCnt)*e3;
1776 #endif // ! MBDYN_X_WORKAROUND_GCC_3_2 && ! MBDYN_X_WORKAROUND_GCC_3_3
1777  }
1778 
1779 #if defined(MBDYN_X_WORKAROUND_GCC_3_2) || defined(MBDYN_X_WORKAROUND_GCC_3_3)
1780  ConstitutiveLaw3D::F += FTmp;
1781 #endif // ! MBDYN_X_WORKAROUND_GCC_3_2 && ! MBDYN_X_WORKAROUND_GCC_3_3
1782  };
1783 };
1784 
1785 /* CubicViscoElasticGenericConstitutiveLaw - end */
1786 
1787 
1788 
1789 /* DoubleLinearViscoElasticConstitutiveLaw - begin */
1790 
1791 template <class T, class Tder>
1793 : public ElasticConstitutiveLaw<T, Tder> {
1794  public:
1796  const T& PStress,
1797  doublereal = 0.,
1798  doublereal = 0.,
1799  doublereal = 0.,
1800  doublereal = 0.,
1801  doublereal = 0.,
1802  doublereal = 0.)
1803  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
1804  throw (typename ElasticConstitutiveLaw<T, Tder>::Err(std::cerr, "doublelinear viscoelastic constitutive law "
1805  "is allowed only for rods ad 3D hinges"));
1806  };
1807 
1809  NO_OP;
1810  };
1811 
1814  };
1815 
1816  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
1817  return 0;
1818  };
1819 
1820  virtual std::ostream& Restart(std::ostream& out) const {
1821  return out;
1822  };
1823 
1824  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
1825  NO_OP;
1826  };
1827 };
1828 
1829 
1830 template<>
1832 : public ElasticConstitutiveLaw1D {
1833  private:
1840 
1841  public:
1843  const doublereal& PStress,
1844  doublereal dStiff,
1845  doublereal dUpp,
1846  doublereal dLow,
1847  doublereal dSecondS,
1848  doublereal dStiffPrime,
1849  doublereal dSecondSPrime)
1850  : ElasticConstitutiveLaw1D(pDC, PStress),
1851  dStiffness(dStiff),
1852  dUpperLimitStrain(dUpp), dLowerLimitStrain(dLow),
1853  dSecondStiffness(dSecondS),
1854  dStiffnessPrime(dStiffPrime),
1855  dSecondStiffnessPrime(dSecondSPrime)
1856  {
1857  FDEPrime = dStiffnessPrime;
1858  };
1859 
1861  NO_OP;
1862  };
1863 
1866  };
1867 
1870 
1873  cl,
1874  cl(pGetDriveCaller()->pCopy(),
1875  PreStress,
1876  dStiffness,
1877  dUpperLimitStrain,
1878  dLowerLimitStrain,
1879  dSecondStiffness,
1880  dStiffnessPrime,
1881  dSecondStiffnessPrime));
1882 
1883  return pCL;
1884  };
1885 
1886  virtual std::ostream& Restart(std::ostream& out) const {
1887  out << "double linear viscoelastic, "
1888  << dStiffness << ", "
1889  << dUpperLimitStrain << ", "
1890  << dLowerLimitStrain << ", "
1891  << dSecondStiffness << ", "
1892  << dStiffnessPrime << ", "
1893  "second damping, " << dSecondStiffnessPrime << ", ";
1894  return Restart_int(out);
1895  };
1896 
1897  virtual void Update(const doublereal& Eps, const doublereal& EpsPrime = 0.) {
1898  Epsilon = Eps;
1899  EpsilonPrime = EpsPrime;
1900 
1901  doublereal dPreStrain = Get();
1902  doublereal dCurrStrain = Epsilon-dPreStrain;
1903  if (dCurrStrain <= dUpperLimitStrain && dCurrStrain >= dLowerLimitStrain) {
1904  FDE = dStiffness;
1905  FDEPrime = dStiffnessPrime;
1906  F = PreStress+dStiffness*dCurrStrain
1907  +dStiffnessPrime*EpsilonPrime;
1908  } else {
1909  FDE = dSecondStiffness;
1910  FDEPrime = dSecondStiffnessPrime;
1911 
1912  if (dCurrStrain > dUpperLimitStrain) {
1913  F = PreStress+dStiffness*dUpperLimitStrain
1914  +dSecondStiffness*(dCurrStrain-dUpperLimitStrain)
1915  +dSecondStiffnessPrime*EpsilonPrime;
1916  } else /* if (dCurrStrain < dLowerLimitStrain) */ {
1917  F = PreStress+dStiffness*dLowerLimitStrain
1918  +dSecondStiffness*(dCurrStrain-dLowerLimitStrain)
1919  +dSecondStiffnessPrime*EpsilonPrime;
1920  }
1921  }
1922  };
1923 };
1924 
1925 
1926 template<>
1928 : public ElasticConstitutiveLaw3D {
1929  private:
1930  doublereal dStiffness; /* Isotropa: Eye*dStiffness */
1936 
1937  public:
1939  const Vec3& PStress,
1940  doublereal dStiff,
1941  doublereal dUppLimStrain,
1942  doublereal dLowLimStrain,
1943  doublereal dSecondStiff,
1944  doublereal dStiffPrime,
1945  doublereal dSecondStiffPrime)
1946  : ElasticConstitutiveLaw3D(pDC, PStress),
1947  dStiffness(dStiff),
1948  dUpperLimitStrain(dUppLimStrain),
1949  dLowerLimitStrain(dLowLimStrain),
1950  dSecondStiffness(dSecondStiff),
1951  dStiffnessPrime(dStiffPrime),
1952  dSecondStiffnessPrime(dSecondStiffPrime)
1953  {
1954  Mat3x3DEye.Manipulate(FDE, dStiffness);
1955  Mat3x3DEye.Manipulate(FDEPrime, dStiffnessPrime);
1956  };
1957 
1959  NO_OP;
1960  };
1961 
1964  };
1965 
1966  virtual ConstitutiveLaw<Vec3, Mat3x3>* pCopy(void) const {
1968 
1971  cl,
1972  cl(pGetDriveCaller()->pCopy(),
1973  PreStress,
1974  dStiffness,
1975  dUpperLimitStrain,
1976  dLowerLimitStrain,
1977  dSecondStiffness,
1978  dStiffnessPrime,
1979  dSecondStiffnessPrime));
1980 
1981  return pCL;
1982  };
1983 
1984  virtual std::ostream& Restart(std::ostream& out) const {
1985  out << "double linear viscoelastic, "
1986  << dStiffness << ", "
1987  << dUpperLimitStrain << ", "
1988  << dLowerLimitStrain << ", "
1989  << dSecondStiffness << ", "
1990  << dStiffnessPrime << ", "
1991  << dSecondStiffnessPrime << ", ";
1992  return Restart_int(out);
1993  };
1994 
1995  virtual void Update(const Vec3& Eps, const Vec3& EpsPrime = Zero3) {
1996  Epsilon = Eps;
1997  EpsilonPrime = EpsPrime;
1998 
1999  Vec3 PreStrain = Get();
2000  Vec3 CurrStrain = Epsilon-PreStrain;
2001  doublereal dCurrStrain = CurrStrain.dGet(3);
2002 
2003  if (dCurrStrain <= dUpperLimitStrain && dCurrStrain >= dLowerLimitStrain) {
2004  FDE.Put(3, 3, dStiffness);
2005  FDEPrime.Put(3, 3, dStiffnessPrime);
2006  F = PreStress+CurrStrain*dStiffness+EpsilonPrime*dStiffnessPrime;
2007  } else {
2008  FDE.Put(3, 3, dSecondStiffness);
2009  FDEPrime.Put(3, 3, dSecondStiffnessPrime);
2010 
2011  if (dCurrStrain > dUpperLimitStrain) {
2012  F = PreStress
2013  +Vec3(CurrStrain(1)*dStiffness + EpsilonPrime(1)*dStiffnessPrime,
2014  CurrStrain(2)*dStiffness + EpsilonPrime(2)*dStiffnessPrime,
2015  dUpperLimitStrain*dStiffness
2016  +(dCurrStrain-dUpperLimitStrain)*dSecondStiffness
2017  +EpsilonPrime(3)*dSecondStiffnessPrime);
2018  } else /* if (dCurrStrain < dLowerLimitStrain) */ {
2019  F = PreStress
2020  +Vec3(CurrStrain.dGet(1)*dStiffness + EpsilonPrime(1)*dStiffnessPrime,
2021  CurrStrain.dGet(2)*dStiffness + EpsilonPrime(2)*dStiffnessPrime,
2022  dLowerLimitStrain*dStiffness
2023  +(dCurrStrain-dLowerLimitStrain)*dSecondStiffness
2024  +EpsilonPrime(3)*dSecondStiffnessPrime);
2025  }
2026  }
2027  };
2028 };
2029 
2030 /* DoubleLinearViscoElasticConstitutiveLaw - end */
2031 
2032 
2033 /* TurbulentViscoElasticConstitutiveLaw - begin */
2034 
2035 template <class T, class Tder>
2037 : public ElasticConstitutiveLaw<T, Tder> {
2038  public:
2040  const T& PStress,
2041  doublereal = 0.,
2042  doublereal = 0.,
2043  doublereal = 0.,
2044  doublereal = 0.)
2045  : ElasticConstitutiveLaw<T, Tder>(pDC, PStress) {
2046  throw (typename ElasticConstitutiveLaw<T, Tder>::Err(std::cerr, "Turbulent viscoelastic constitutive law "
2047  "is allowed only for rods"));
2048  };
2049 
2051  NO_OP;
2052  };
2053 
2056  };
2057 
2058  virtual ConstitutiveLaw<T, Tder>* pCopy(void) const {
2059  return 0;
2060  };
2061 
2062  virtual std::ostream& Restart(std::ostream& out) const {
2063  return out;
2064  };
2065 
2066  virtual void Update(const T& /* Eps */ , const T& /* EpsPrime */ = mb_zero<T>()) {
2067  NO_OP;
2068  };
2069 };
2070 
2071 
2072 template<>
2074 : public ElasticConstitutiveLaw1D {
2075  private:
2080 
2081  public:
2083  const doublereal& PStress,
2084  doublereal dStiff,
2085  doublereal dStiffPrime,
2086  doublereal dTres,
2087  doublereal dParabStiff)
2088  : ElasticConstitutiveLaw1D(pDC, PStress),
2089  dStiffness(dStiff), dStiffnessPrime(dStiffPrime),
2090  dTreshold(dTres), dParabolicStiffness(dParabStiff) {
2091  FDE = dStiffness;
2092  };
2093 
2095  NO_OP;
2096  };
2097 
2100  };
2101 
2104 
2107  cl,
2108  cl(pGetDriveCaller()->pCopy(),
2109  PreStress,
2110  dStiffness,
2111  dStiffnessPrime,
2112  dTreshold,
2113  dParabolicStiffness));
2114 
2115  return pCL;
2116  };
2117 
2118  virtual std::ostream& Restart(std::ostream& out) const {
2119  out << "turbulent viscoelastic, "
2120  << dStiffness << ", "
2121  << dStiffnessPrime << ", "
2122  << dTreshold << ", "
2123  << dParabolicStiffness << ", ";
2124  return Restart_int(out);
2125  };
2126 
2127  virtual void Update(const doublereal& Eps, const doublereal& EpsPrime = 0.) {
2128  Epsilon = Eps;
2129  EpsilonPrime = EpsPrime;
2130 
2131  doublereal dPreStrain = Get();
2132 
2134  if (d < dTreshold) {
2135  FDEPrime = dStiffnessPrime;
2136  F = PreStress+dStiffness*(Epsilon-dPreStrain)
2137  +dStiffnessPrime*EpsilonPrime;
2138  } else {
2139  FDEPrime = 2.*dParabolicStiffness*d;
2140  F = PreStress+dStiffness*(Epsilon-dPreStrain)
2141  +dParabolicStiffness*d*EpsilonPrime;
2142  }
2143  };
2144 };
2145 
2146 /* TurbulentViscoElasticConstitutiveLaw - end */
2147 
2148 /* BiStopCLWrapper - begin */
2149 
2150 template <class T, class Tder>
2152 : public ConstitutiveLaw<T, Tder> {
2153 private:
2155 
2161 
2162 public:
2165  bool bInitialStatus,
2166  const DriveCaller *pA,
2167  const DriveCaller *pD
2168  ) :
2169  m_pCL(pCL), m_status(bInitialStatus ? ACTIVE : INACTIVE),
2171  m_EpsRef(mb_zero<T>()) {
2174  };
2175 
2176  virtual
2178  NO_OP;
2179  };
2180 
2182  return m_pCL->GetConstLawType();
2183  };
2184 
2185  virtual
2187  ConstitutiveLaw<T, Tder>* pCL = 0;
2188 
2189  typedef BiStopCLWrapper<T, Tder> cl;
2191  cl,
2192  cl(m_pCL->pCopy(),
2193  m_status == ACTIVE,
2196 
2197  return pCL;
2198  };
2199 
2200  virtual std::ostream&
2201  Restart(std::ostream& out) const {
2202  out << "bistop, initial status, ";
2203  if (m_status == INACTIVE) {
2204  out << "inactive";
2205 
2206  } else {
2207  out << "active";
2208  }
2209  out << ", ",
2210  m_pActivatingCondition->Restart(out) << ", ",
2211  m_pDeactivatingCondition->Restart(out) << ", ";
2212  return m_pCL->Restart(out);
2213  };
2214 
2215  virtual void
2216  Update(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
2219  bool bChangeJac(false);
2220 
2221  switch (m_status) {
2222  case INACTIVE:
2223  if (m_pActivatingCondition->dGet() == 0.) {
2224  /* remains inactive: nothing to do */
2225  break;
2226  }
2227 
2228  /* activates: change data and ask for jacobian rigeneration */
2229  m_status = ACTIVE;
2231  bChangeJac = true;
2232 
2233  case ACTIVE:
2234  if (m_pDeactivatingCondition->dGet() != 0.) {
2235  /* disactivates: reset data and ask for jacobian rigeneration */
2236  m_status = INACTIVE;
2237  ConstitutiveLaw<T, Tder>::F = ::mb_zero<T>();
2238  ConstitutiveLaw<T, Tder>::FDE = ::mb_zero<Tder>();
2239  ConstitutiveLaw<T, Tder>::FDEPrime = ::mb_zero<Tder>();
2241  }
2242 
2243  /* change force as well */
2244  try {
2245  m_pCL->Update(Eps - m_EpsRef, EpsPrime);
2246  }
2247  catch (Elem::ChangedEquationStructure& e) {
2248  bChangeJac = true;
2249  }
2252  ConstitutiveLaw<T, Tder>::FDEPrime = m_pCL->GetFDEPrime();
2253  if (bChangeJac) {
2254  /* if activating, ask for jacobian rigeneration */
2256  }
2257  break;
2258  }
2259  };
2260 
2261  virtual void AfterConvergence(const T& Eps, const T& EpsPrime = mb_zero<T>()) {
2262  if (m_status == ACTIVE) {
2263  m_pCL->AfterConvergence(Eps - m_EpsRef, EpsPrime);
2264  }
2265  };
2266 
2267  // FIXME: OutputAppend() ?
2268 };
2269 
2270 /* BiStopCLWrapper - end */
2271 
2272 /* helpers */
2273 template <class T>
2274 void
2275 GetPreStress(MBDynParser& HP, T& PreStress)
2276 {
2277  if (HP.IsKeyWord("prestress")) {
2278  PreStress = HP.Get(PreStress);
2279  }
2280 }
2281 
2282 template <class T>
2285 {
2286  if (HP.IsKeyWord("prestrain")) {
2287  return HP.GetTplDriveCaller<T>();
2288  }
2289 
2290  TplDriveCaller<T> *pTplDC = 0;
2291 
2292  SAFENEW(pTplDC, ZeroTplDriveCaller<T>);
2293 
2294  return pTplDC;
2295 }
2296 
2297 #endif // CONSTLTP_IMPL_H
Definition: hint.h:38
virtual const T & GetF(void) const
Definition: constltp.h:125
LinearViscoElasticIsotropicConstitutiveLaw< doublereal, doublereal > LinearViscoElasticIsotropicConstitutiveLaw1D
LinearViscoElasticIsotropicConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal dStiff, doublereal dStiffPrime)
LinearViscoElasticGenericConstitutiveLaw< Vec6, Mat6x6 > LinearViscoElasticGenericConstitutiveLaw6D
DoubleLinearViscoElasticConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal=0., doublereal=0., doublereal=0., doublereal=0., doublereal=0., doublereal=0.)
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
TplDriveCaller< T > * GetTplDriveCaller(void)
Definition: mbpar.cc:2112
CubicElasticGenericConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, const doublereal &Stiff1, const doublereal &Stiff2, const doublereal &Stiff3)
IsotropicHardeningConstitutiveLaw< doublereal, doublereal > IsotropicHardeningConstitutiveLaw1D
const Vec3 Zero3(0., 0., 0.)
const Vec6 & mb_zero< Vec6 >(void)
Definition: matvec6.h:631
virtual ~ElasticConstitutiveLaw(void)
virtual std::ostream & Restart(std::ostream &out) const
const DriveCaller * m_pActivatingCondition
virtual ConstitutiveLaw< Vec6, Mat6x6 > * pCopy(void) const
virtual void Update(const T &Eps, const T &=Zero3)
virtual ~LinearElasticGenericConstitutiveLaw(void)
virtual std::ostream & Restart(std::ostream &out) const
long int flag
Definition: mbdyn.h:43
ConstLawType::Type GetConstLawType(void) const
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
Definition: matvec3.h:98
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
Definition: constltp_impl.h:98
LinearViscoElasticGenericConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const Tder &Stiff, const Tder &StiffPrime)
ConstitutiveLaw< T, Tder > * m_pCL
virtual std::ostream & Restart(std::ostream &out) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
Definition: constltp_impl.h:85
ContactConstitutiveLaw< Vec3, Mat3x3 > ContactConstitutiveLaw3D
IsotropicHardeningConstitutiveLaw< Vec6, Mat6x6 > IsotropicHardeningConstitutiveLaw6D
ConstLawType::Type GetConstLawType(void) const
LinearElasticIsotropicConstitutiveLaw< doublereal, doublereal > LinearElasticIsotropicConstitutiveLaw1D
virtual ConstitutiveLaw1D * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
ConstLawType::Type m_type
Definition: constltp_impl.h:53
LinearViscoElasticIsotropicConstitutiveLaw< Vec3, Mat3x3 > LinearViscoElasticIsotropicConstitutiveLaw3D
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
virtual std::ostream & Restart(std::ostream &out) const
LinearElasticGenericConstitutiveLaw< Vec3, Mat3x3 > LinearElasticGenericConstitutiveLaw3D
LTVViscoElasticGenericConstitutiveLaw< Vec6, Mat6x6 > LTVViscoElasticGenericConstitutiveLaw6D
CubicViscoElasticGenericConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const T &Stiff1, const T &Stiff2, const T &Stiff3, const Tder &StiffPrime)
virtual const Tder & GetFDE(void) const
Definition: constltp.h:129
virtual std::ostream & Restart(std::ostream &out) const
DoubleLinearViscoElasticConstitutiveLaw(const TplDriveCaller< Vec3 > *pDC, const Vec3 &PStress, doublereal dStiff, doublereal dUppLimStrain, doublereal dLowLimStrain, doublereal dSecondStiff, doublereal dStiffPrime, doublereal dSecondStiffPrime)
virtual void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
virtual std::ostream & Restart(std::ostream &out) const
virtual void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
virtual void Update(const T &, const T &=mb_zero< T >())
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
ElasticConstitutiveLaw< doublereal, doublereal > ElasticConstitutiveLaw1D
#define NO_OP
Definition: myassert.h:74
virtual ~LogConstitutiveLaw(void)
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
ContactConstitutiveLaw(const TplDriveCaller< Vec3 > *pDC, const Vec3 &PStress, const doublereal &dKappa, const doublereal &dGamma)
ContactConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const doublereal=0., const doublereal=0.)
TurbulentViscoElasticConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, doublereal dStiff, doublereal dStiffPrime, doublereal dTres, doublereal dParabStiff)
DoubleLinearElasticConstitutiveLaw(const TplDriveCaller< Vec3 > *pDC, const Vec3 &PStress, doublereal dStiff, doublereal dUppLimStrain, doublereal dLowLimStrain, doublereal dSecondStiff)
ContactConstitutiveLaw< Vec6, Mat6x6 > ContactConstitutiveLaw6D
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
LinearElasticGenericConstitutiveLaw< Vec6, Mat6x6 > LinearElasticGenericConstitutiveLaw6D
IsotropicHardeningConstitutiveLaw< Vec3, Mat3x3 > IsotropicHardeningConstitutiveLaw3D
LogConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, doublereal dStiff)
virtual std::ostream & Restart(std::ostream &out) const
const Mat3x3DEye_Manip Mat3x3DEye
Definition: matvec3.cc:637
virtual std::ostream & Restart(std::ostream &out) const
ConstLawType::Type GetConstLawType(void) const
virtual std::ostream & Restart(std::ostream &out) const =0
void Set(const TplDriveCaller< T > *pDC)
Definition: tpldrive.h:97
virtual std::ostream & Restart_int(std::ostream &out) const
LinearElasticIsotropicConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal dStiff)
virtual void Update(const Vec6 &Eps, const Vec6 &=mb_zero< Vec6 >())
ConstLawType::Type GetConstLawType(void) const
virtual std::ostream & Restart(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const
BiStopCLWrapper(ConstitutiveLaw< T, Tder > *pCL, bool bInitialStatus, const DriveCaller *pA, const DriveCaller *pD)
CubicElasticGenericConstitutiveLaw(const TplDriveCaller< Vec3 > *pDC, const Vec3 &PStress, const Vec3 &Stiff1, const Vec3 &Stiff2, const Vec3 &Stiff3)
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
virtual std::ostream & Restart(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const
virtual ConstitutiveLaw< Vec6, Mat6x6 > * pCopy(void) const
virtual void Update(const doublereal &Eps, const doublereal &=0.)
virtual ConstitutiveLaw1D * pCopy(void) const
virtual void Update(const doublereal &Eps, const doublereal &=0.)
virtual void Update(const T &Eps, const T &=mb_zero< T >())
virtual void Update(const T &Eps, const T &EpsPrime=::mb_zero< T >())
virtual std::ostream & Restart(std::ostream &out) const
Definition: matvec6.h:37
TplDriveCaller< T > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
virtual ~IsotropicHardeningConstitutiveLaw(void)
ElasticConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress)
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
enum Status m_status
const T & mb_zero(void)
LinearViscousGenericConstitutiveLaw(const T &PStress, const Tder &StiffPrime)
LinearViscoElasticGenericConstitutiveLaw< doublereal, doublereal > LinearViscoElasticGenericConstitutiveLaw1D
DoubleLinearViscoElasticConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, doublereal dStiff, doublereal dUpp, doublereal dLow, doublereal dSecondS, doublereal dStiffPrime, doublereal dSecondSPrime)
struct vector vector
#define SAFENEW(pnt, item)
Definition: mynewmem.h:695
virtual ~BiStopCLWrapper(void)
GradientExpression< UnaryExpr< FuncLog, Expr > > log(const GradientExpression< Expr > &u)
Definition: gradient.h:2976
LTVViscoElasticGenericConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const Tder &Stiff, const DriveCaller *pdc, const Tder &StiffPrime, const DriveCaller *pdcp)
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
LinearElasticIsotropicConstitutiveLaw< Vec6, Mat6x6 > LinearElasticIsotropicConstitutiveLaw6D
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual std::ostream & Restart(std::ostream &out) const
virtual ~DoubleLinearElasticConstitutiveLaw(void)
virtual std::ostream & Restart(std::ostream &out) const
ConstitutiveLawArray(const std::vector< ConstitutiveLaw< T, Tder > * > &clv)
Definition: constltp_impl.h:57
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
LinearElasticIsotropicConstitutiveLaw< Vec3, Mat3x3 > LinearElasticIsotropicConstitutiveLaw3D
virtual std::ostream & OutputAppend(std::ostream &out) const
virtual void Update(const T &, const T &=mb_zero< T >())
ElasticConstitutiveLaw< Vec6, Mat6x6 > ElasticConstitutiveLaw6D
LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw(const TplDriveCaller< Vec6 > *pDC, const Vec6 &PStress, const Mat6x6 &Stiff, const Mat6x6 &StiffPrime, doublereal dAxTors)
LogConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal=0.)
TurbulentViscoElasticConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal=0., doublereal=0., doublereal=0., doublereal=0.)
virtual std::ostream & Restart(std::ostream &out) const
virtual void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
const DriveCaller * m_pDeactivatingCondition
virtual void Update(const Vec6 &Eps, const Vec6 &EpsPrime=mb_zero< Vec6 >())
virtual void Update(const Vec3 &Eps, const Vec3 &EpsPrime=Zero3)
virtual void Update(const Vec3 &Eps, const Vec3 &=Zero3)
virtual void Update(const T &Eps, const T &=mb_zero< T >())
#define ASSERT(expression)
Definition: colamd.c:977
TplDriveCaller< T > * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.h:124
virtual void Update(const T &, const T &=mb_zero< T >())
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
CubicViscoElasticGenericConstitutiveLaw(const TplDriveCaller< Vec3 > *pDC, const Vec3 &PStress, const Vec3 &Stiff1, const Vec3 &Stiff2, const Vec3 &Stiff3, const Mat3x3 &StiffPrime)
ElasticConstitutiveLaw< Vec3, Mat3x3 > ElasticConstitutiveLaw3D
virtual void Update(const doublereal &Eps, const doublereal &=0.)
virtual std::ostream & Restart(std::ostream &out) const
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime=0.)
LTVViscoElasticGenericConstitutiveLaw< Vec3, Mat3x3 > LTVViscoElasticGenericConstitutiveLaw3D
virtual void Update(const T &, const T &EpsPrime=mb_zero< T >())
void GetPreStress(MBDynParser &HP, T &PreStress)
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual ConstitutiveLaw< Vec3, Mat3x3 > * pCopy(void) const
virtual void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:113
virtual std::ostream & Restart(std::ostream &out) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual void Update(const T &, const T &=mb_zero< T >())
virtual DriveCaller * pCopy(void) const =0
LinearElasticGenericAxialTorsionCouplingConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const Tder &=mb_zero< Tder >(), doublereal=0.)
virtual void Update(const Vec3 &Eps, const Vec3 &=Zero3)
virtual doublereal dGet(const doublereal &dVar) const =0
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual void Update(const T &, const T &=mb_zero< T >())
virtual std::ostream & Restart(std::ostream &out) const
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
LinearViscousIsotropicConstitutiveLaw(const T &PStress, doublereal dStiffPrime)
IsotropicHardeningConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal dStiff, doublereal dStiff0, doublereal dEpsHard)
virtual ~LinearViscousGenericConstitutiveLaw(void)
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: constltp_impl.h:76
std::vector< ConstitutiveLaw< T, Tder > * > m_clv
Definition: constltp_impl.h:54
#define STRLENOF(s)
Definition: mbdyn.h:166
ConstLawType::Type GetConstLawType(void) const
virtual void Update(const Vec3 &Eps, const Vec3 &=Zero3)
virtual ~InverseSquareConstitutiveLaw(void)
void Manipulate(Mat3x3 &m, const doublereal d) const
Definition: matvec3.h:1463
LinearViscoElasticIsotropicConstitutiveLaw< Vec6, Mat6x6 > LinearViscoElasticIsotropicConstitutiveLaw6D
ConstLawType::Type GetConstLawType(void) const
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664
virtual ConstitutiveLaw< Vec3, Mat3x3 > * pCopy(void) const
virtual ~ContactConstitutiveLaw(void)
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime=0.)
virtual ~CubicElasticGenericConstitutiveLaw(void)
ConstLawType::Type GetConstLawType(void) const
CubicElasticGenericConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const T &Stiff1, const T &Stiff2, const T &Stiff3)
virtual void Update(const T &, const T &=mb_zero< T >())
virtual ~ConstitutiveLawArray(void)
Definition: constltp_impl.h:67
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual ConstitutiveLaw< Vec3, Mat3x3 > * pCopy(void) const
virtual void Update(const T &Eps, const T &=mb_zero< T >())
virtual std::ostream & Restart(std::ostream &out) const
virtual const Tder & GetFDEPrime(void) const
Definition: constltp.h:133
LinearElasticGenericAxialTorsionCouplingConstitutiveLaw(const TplDriveCaller< Vec6 > *pDC, const Vec6 &PStress, const Mat6x6 &Stiff, doublereal dAxTors)
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
virtual std::ostream & Restart(std::ostream &out) const
virtual void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
ConstLawType::Type GetConstLawType(void) const
virtual ~LinearElasticIsotropicConstitutiveLaw(void)
virtual void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
void Put(unsigned short int iRow, unsigned short int iCol, const doublereal &dCoef)
Definition: matvec3.h:758
ConstLawType::Type GetConstLawType(void) const
T pCreateVec(DataManager *pDM) const
Definition: hint_impl.h:84
virtual void Update(const Vec3 &Eps, const Vec3 &EpsPrime=Zero3)
DoubleLinearElasticConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, doublereal dStiff, doublereal dUppLimStrain, doublereal dLowLimStrain, doublereal dSecondStiff)
virtual doublereal Get(const doublereal &d)
Definition: mbpar.cc:2213
virtual void Update(const doublereal &Eps, const doublereal &=0.)
double doublereal
Definition: colamd.c:52
virtual void Update(const T &Eps, const T &=mb_zero< T >())
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
InverseSquareConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, const doublereal &A, const doublereal &L0)
LinearElasticGenericConstitutiveLaw< doublereal, doublereal > LinearElasticGenericConstitutiveLaw1D
virtual std::ostream & Restart(std::ostream &out) const
LTVViscoElasticGenericConstitutiveLaw< doublereal, doublereal > LTVViscoElasticGenericConstitutiveLaw1D
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
DoubleLinearElasticConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, doublereal=0., doublereal=0., doublereal=0., doublereal=0.)
virtual void Update(const doublereal &Eps, const doublereal &=0.)
virtual void Update(const doublereal &Eps, const doublereal &EpsPrime=0.)
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
ContactConstitutiveLaw< doublereal, doublereal > ContactConstitutiveLaw1D
T Get(void) const
Definition: tpldrive.h:113
virtual std::ostream & Restart(std::ostream &out) const
virtual std::ostream & Restart(std::ostream &out) const
virtual ConstitutiveLaw3D * pCopy(void) const
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
virtual std::ostream & Restart(std::ostream &out) const
ContactConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, const doublereal &dKappa, const doublereal &dGamma)
LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw< Vec6, Mat6x6 > LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw6D
LinearViscoElasticGenericAxialTorsionCouplingConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const Tder &Stiff, const Tder &StiffPrime, doublereal dAxTors)
virtual ConstitutiveLaw3D * pCopy(void) const
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
virtual void Update(const T &, const T &EpsPrime=mb_zero< T >())
ConstLawType::Type GetConstLawType(void) const
Definition: constltp_impl.h:72
LinearElasticGenericConstitutiveLaw(const TplDriveCaller< T > *pDC, const T &PStress, const Tder &Stiff)
virtual ConstitutiveLaw< doublereal, doublereal > * pCopy(void) const
CubicViscoElasticGenericConstitutiveLaw(const TplDriveCaller< doublereal > *pDC, const doublereal &PStress, const doublereal &Stiff1, const doublereal &Stiff2, const doublereal &Stiff3, const doublereal &StiffPrime)
virtual ConstitutiveLaw< T, Tder > * pCopy(void) const
virtual std::ostream & Restart(std::ostream &out) const
LinearViscoElasticGenericConstitutiveLaw< Vec3, Mat3x3 > LinearViscoElasticGenericConstitutiveLaw3D
TplDriveCaller< T > * GetPreStrain(const DataManager *pDM, MBDynParser &HP)