70 bool IsWord(
const std::string& s)
const {
76 bool IsWord(
const std::string& s)
const {
82 bool IsWord(
const std::string& s)
const {
95 pedantic_cout(
"registering constitutive law 1D \"" << name <<
"\""
97 return CL1DFuncMap.insert(CL1DFuncMapType::value_type(name, rf)).second;
103 pedantic_cout(
"registering constitutive law 3D \"" << name <<
"\""
105 return CL3DFuncMap.insert(CL3DFuncMapType::value_type(name, rf)).second;
111 pedantic_cout(
"registering constitutive law 6D \"" << name <<
"\""
113 return CL6DFuncMap.insert(CL6DFuncMapType::value_type(name, rf)).second;
120 const char *s, *sOrig = HP.
IsWord(CL1DWordSet);
123 s =
"linear" "elastic";
132 silent_cerr(
"unknown constitutive law 1D type "
133 "\"" << sOrig <<
"\" "
138 return func->second->Read(pDM, HP, CLType);
144 const char *s, *sOrig = HP.
IsWord(CL3DWordSet);
147 s =
"linear" "elastic";
150 silent_cerr(
"unknown constitutive law 3D type "
161 silent_cerr(
"unknown constitutive law 3D type "
162 "\"" << sOrig <<
"\" "
167 return func->second->Read(pDM, HP, CLType);
173 const char *s, *sOrig = HP.
IsWord(CL6DWordSet);
176 s =
"linear" "elastic";
179 silent_cerr(
"unknown constitutive law 6D type "
190 silent_cerr(
"unknown constitutive law 6D type "
191 "\"" << sOrig <<
"\" "
196 return func->second->Read(pDM, HP, CLType);
207 silent_cerr(
"constitutive law array 1D: invalid constitutive law number " << n
216 std::vector<ConstitutiveLaw<doublereal, doublereal> *> clv(n);
217 for (
unsigned i = 0; i < n; i++) {
237 silent_cerr(
"constitutive law array 1D: invalid constitutive law number " << n
246 std::vector<ConstitutiveLaw<Vec3, Mat3x3> *> clv(n);
247 for (
unsigned i = 0; i < n; i++) {
267 silent_cerr(
"constitutive law array 1D: invalid constitutive law number " << n
276 std::vector<ConstitutiveLaw<Vec6, Mat6x6> *> clv(n);
277 for (
unsigned i = 0; i < n; i++) {
290 template <
class T,
class Tder>
299 DEBUGCOUT(
"Linear Elastic Isotropic Constitutive Law, stiffness = "
303 silent_cerr(
"warning, null or negative stiffness at line "
308 T PreStress(mb_zero<T>());
319 template <
class T,
class Tder>
327 DEBUGCOUT(
"Linear Elastic Generic Constitutive Law" << std::endl);
328 Tder S(mb_zero<Tder>());
332 T PreStress(mb_zero<T>());
343 template <
class T,
class Tder>
351 DEBUGCOUT(
"Linear Elastic Generic Constitutive Law with Axial-Torsion Coupling" << std::endl);
352 Tder S(mb_zero<Tder>());
357 DEBUGCOUT(
"coupling coefficient: " << dCoupl << std::endl);
360 T PreStress(mb_zero<T>());
371 template <
class T,
class Tder>
379 Tder S(mb_zero<Tder>());
382 Tder SP(mb_zero<Tder>());
392 DEBUGCOUT(
"coupling coefficient: " << dCoupl << std::endl);
395 T PreStress(mb_zero<T>());
413 DEBUGCOUT(
"Inverse Square Elastic Constitutive Law" << std::endl);
416 silent_cerr(
"warning, null or negative stiffness at line "
422 silent_cerr(
"warning, null or negative reference length at line "
440 template <
class T,
class Tder>
448 DEBUGCOUT(
"Logarithmic Elastic Constitutive Law" << std::endl);
451 silent_cerr(
"warning, null or negative stiffness at line "
456 T PreStress(mb_zero<T>());
467 template <
class T,
class Tder>
476 DEBUGCOUT(
"stiffness = " << dS << std::endl);
479 silent_cerr(
"warning, null or negative stiffness at line "
485 silent_cerr(
"warning, null or negative upper limit strain at line "
491 silent_cerr(
"warning, null or positive lower limit strain at line "
496 if (dSecondS <= 0.) {
497 silent_cerr(
"warning, null or negative second stiffness at line "
502 T PreStress(mb_zero<T>());
509 L(pTplDC, PreStress, dS, dUpp, dLow, dSecondS));
515 template <
class T,
class Tder>
524 DEBUGCOUT(
"Stiffness = " << dS << std::endl);
527 silent_cerr(
"warning, null or negative stiffness at line "
532 DEBUGCOUT(
"Reference strain = " << dE << std::endl);
535 silent_cerr(
"error, null or negative reference strain at line "
541 if (HP.
IsKeyWord(
"linear" "stiffness")) {
546 T PreStress(mb_zero<T>());
557 template <
class T,
class Tder>
566 DEBUGCOUT(
"Stiffness = " << dK << std::endl);
569 silent_cerr(
"warning, null or negative stiffness at line "
574 DEBUGCOUT(
"Exponent = " << dGamma << std::endl);
577 silent_cerr(
"error, exponent < 1. at line "
583 T PreStress(mb_zero<T>());
594 template <
class T,
class Tder>
604 }
else if (
typeid(T) ==
typeid(
Vec3)) {
607 }
else if (
typeid(T) ==
typeid(
Vec6)) {
611 silent_cerr(
"Invalid dimensionality "
612 "for symbolic constitutive law "
618 std::vector<std::string> epsilon;
621 silent_cerr(
"keyword \"epsilon\" expected at line " << HP.
GetLineData() << std::endl);
627 for (
unsigned row = 0; row < dim; row++) {
631 silent_cerr(
"unable to get \"epsilon\" "
632 "symbol #" << row <<
" "
640 std::vector<std::string> epsilonPrime;
643 silent_cerr(
"keyword \"epsilon prime\" expected at line " << HP.
GetLineData() << std::endl);
647 epsilonPrime.resize(dim);
649 for (
unsigned row = 0; row < dim; row++) {
653 silent_cerr(
"unable to get \"epsilonPrime\" "
654 "symbol #" << row <<
" "
658 epsilonPrime[row] = tmp;
663 silent_cerr(
"keyword \"expression\" expected at line " << HP.
GetLineData() << std::endl);
667 std::vector<std::string> expression(dim);
668 for (
unsigned row = 0; row < dim; row++) {
671 silent_cerr(
"unable to get \"expression\" "
677 expression[row] = tmp;
681 T PreStress(mb_zero<T>());
686 GetPreStrain<T>(pDM, HP);
689 case ConstLawType::ELASTIC: {
697 silent_cerr(
"symbolic constitutive law not supported "
704 case ConstLawType::VISCOUS: {
708 L(PreStress, epsilonPrime, expression));
710 silent_cerr(
"symbolic constitutive law not supported "
722 epsilon, epsilonPrime,
725 silent_cerr(
"symbolic constitutive law not supported "
741 template <
class T,
class Tder>
750 template <
class T,
class Tder>
759 template <
class T,
class Tder>
768 template <
class T,
class Tder>
777 DEBUGCOUT(
"stiffness prime = " << dSP << std::endl);
780 silent_cerr(
"warning, null or negative stiffness prime at line "
785 T PreStress(mb_zero<T>());
795 template <
class T,
class Tder>
803 Tder SP(mb_zero<Tder>());
807 T PreStress(mb_zero<T>());
817 template <
class T,
class Tder>
826 DEBUGCOUT(
"Stiffness = " << dS << std::endl);
829 silent_cerr(
"warning, null or negative stiffness at line "
840 DEBUGCOUT(
"stiffness prime = " << dSP << std::endl);
843 silent_cerr(
"warning, null or negative stiffness prime at line "
848 T PreStress(mb_zero<T>());
852 #if 0 // TODO: implement a "null" constitutive law that does nothing
853 if (dS == 0. && dSP == 0.) {
858 silent_cerr(
"warning, null stiffness, "
859 "using linear viscous constitutive law instead"
868 }
else if (dSP == 0.) {
869 silent_cerr(
"warning, null stiffness prime, "
870 "using linear elastic constitutive law instead"
885 template <
class T,
class Tder>
893 Tder S(mb_zero<Tder>());
896 Tder SP(mb_zero<Tder>());
906 T PreStress(mb_zero<T>());
910 #if 0 // TODO: implement a "null" constitutive law that does nothing
916 silent_cerr(
"warning, null stiffness, "
917 "using linear viscous generic constitutive law instead"
927 silent_cerr(
"warning, null stiffness prime, "
928 "using linear elastic generic constitutive law instead"
943 template <
class T,
class Tder>
951 Tder S(mb_zero<Tder>());
956 Tder SP(mb_zero<Tder>());
968 T PreStress(mb_zero<T>());
972 #if 0 // TODO: implement a "null" constitutive law that does nothing
976 silent_cerr(
"warning, null stiffness, "
977 "using linear viscous generic constitutive law instead"
982 typedef LTVViscousGenericConstitutiveLaw<T, Tder> L;
990 silent_cerr(
"warning, null stiffness prime, "
991 "using linear elastic generic constitutive law instead"
996 typedef LTVElasticGenericConstitutiveLaw<T, Tder> L;
1010 template <
class T,
class Tder>
1028 T PreStress(mb_zero<T>());
1039 template <
class T,
class Tder>
1056 Tder SP(mb_zero<Tder>());
1060 T PreStress(mb_zero<T>());
1071 template <
class T,
class Tder>
1080 DEBUGCOUT(
"stiffness = " << dS << std::endl);
1083 silent_cerr(
"warning, null or negative stiffness at line "
1089 silent_cerr(
"warning, null or negative upper limit strain at line "
1095 silent_cerr(
"warning, null or positive lower limit strain at line "
1100 if (dSecondS <= 0.) {
1101 silent_cerr(
"warning, null or negative second stiffness at line "
1106 DEBUGCOUT(
"stiffness prime = " << dSP << std::endl);
1109 silent_cerr(
"warning, null or negative stiffness prime at line "
1116 DEBUGCOUT(
"second stiffness prime = " << dSecondSP << std::endl);
1118 if (dSecondSP <= 0.) {
1119 silent_cerr(
"warning, null or negative second stiffness prime at line "
1125 T PreStress(mb_zero<T>());
1132 L(pTplDC, PreStress,
1133 dS, dUpp, dLow, dSecondS, dSP, dSecondSP));
1139 template <
class T,
class Tder>
1148 DEBUGCOUT(
"Visco-Elastic Turbulent Rod Joint, stiffness = "
1149 << dS << std::endl);
1152 silent_cerr(
"warning, null or negative stiffness at line "
1157 DEBUGCOUT(
"stiffness prime = " << dParabStiff << std::endl);
1159 if (dParabStiff <= 0.) {
1160 silent_cerr(
"warning, null or negative derivative stiffness at line "
1166 dTreshold = HP.
GetReal(dTreshold);
1191 T PreStress(mb_zero<T>());
1198 L(pTplDC, PreStress,
1199 dS, dSP, dTreshold, dParabStiff));
1205 template <
class T,
class Tder>
1215 DEBUGCOUT(
"Linear Viscoelastic Bi Stop Constitutive Law" << std::endl);
1218 silent_cerr(
"warning, null or negative stiffness at line "
1226 silent_cerr(
"warning, null or negative stiffness prime at line "
1248 T PreStress(mb_zero<T>());
1266 template <
class T,
class Tder>
1275 template <
class T,
class Tder>
1312 bool bStatus(
false);
1331 bool bStatus(
false);
1350 bool bStatus(
false);
1368 template <
class T,
class Tder>
1416 SetCL6D(
"linear" "elastic" "generic" "axial" "torsion" "coupling",
1418 SetCL6D(
"linear" "viscoelastic" "generic" "axial" "torsion" "coupling",
1552 silent_cerr(
"DestroyCL() called once too many" << std::endl);
static CL1DWordSetType CL1DWordSet
virtual ConstitutiveLaw< Vec3, Mat3x3 > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
#define MBDYN_EXCEPT_ARGS
static CL3DFuncMapType CL3DFuncMap
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual integer GetInt(integer iDefval=0)
bool SetCL3D(const char *name, ConstitutiveLawRead< Vec3, Mat3x3 > *rf)
virtual ConstitutiveLaw< Vec6, Mat6x6 > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual const char * IsWord(const HighParser::WordSet &ws)
bool IsNull(const doublereal &d)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
ConstitutiveLaw< Vec6, Mat6x6 > * ReadCL6D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool IsWord(const std::string &s) const
virtual bool GetBool(bool bDefval=false)
static CL6DFuncMapType CL6DFuncMap
virtual ConstitutiveLaw< doublereal, doublereal > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool SetCL6D(const char *name, ConstitutiveLawRead< Vec6, Mat6x6 > *rf)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
ConstitutiveLaw< doublereal, doublereal > * ReadCL1D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< doublereal, doublereal > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool SetCL1D(const char *name, ConstitutiveLawRead< doublereal, doublereal > *rf)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
static CL6DWordSetType CL6DWordSet
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
static CL3DWordSetType CL3DWordSet
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
virtual ConstitutiveLaw< Vec6, Mat6x6 > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstLawType::Type GetConstLawType(void) const =0
virtual bool IsKeyWord(const char *sKeyWord)
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool IsWord(const std::string &s) const
std::map< std::string, ConstitutiveLawRead< doublereal, doublereal > *, ltstrcase > CL1DFuncMapType
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
#define ASSERT(expression)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
void GetPreStress(MBDynParser &HP, T &PreStress)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
std::map< std::string, ConstitutiveLawRead< Vec3, Mat3x3 > *, ltstrcase > CL3DFuncMapType
static CL1DFuncMapType CL1DFuncMap
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
DriveCaller * GetDriveCaller(bool bDeferred=false)
ConstitutiveLaw< Vec3, Mat3x3 > * ReadCL3D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual doublereal Get(const doublereal &d)
const doublereal & mb_zero< doublereal >(void)
virtual ConstitutiveLaw< doublereal, doublereal > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual HighParser::ErrOut GetLineData(void) const
bool IsWord(const std::string &s) const
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
static void ReadBiStopBase(MBDynParser &HP, bool &bStatus, const DriveCaller *&pA, const DriveCaller *&pD)
virtual ConstitutiveLaw< Vec3, Mat3x3 > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
virtual ConstitutiveLaw< T, Tder > * Read(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
std::map< std::string, ConstitutiveLawRead< Vec6, Mat6x6 > *, ltstrcase > CL6DFuncMapType
virtual doublereal GetReal(const doublereal &dDefval=0.0)