template<class T, class Tder, ConstLawType::Type Typ>
struct NLPViscoElasticCLR< T, Tder, Typ >
Definition at line 322 of file constltp_nlp.cc.
template<class T , class Tder , ConstLawType::Type Typ>
Implements ConstitutiveLawRead< T, Tder >.
Definition at line 324 of file constltp_nlp.cc.
References ConstLawType::ELASTIC, MBDynParser::Get(), IncludeParser::GetLineData(), GetPreStress(), HighParser::GetReal(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, ParseScalarFunction(), SAFENEWWITHCONSTRUCTOR, ConstLawType::VISCOELASTIC, and ConstLawType::VISCOUS.
332 }
else if (
typeid(T) ==
typeid(
Vec3)) {
335 }
else if (
typeid(T) ==
typeid(
Vec6)) {
339 silent_cerr(
"Invalid dimensionality "
340 "for NLP viscoelastic constitutive law "
347 Tder FDE0(mb_zero<Tder>());
348 bool bElastic(
false);
349 std::vector<const DifferentiableScalarFunction *> FDEsc(dim);
350 for (
unsigned i = 0; i < dim; i++) {
358 bElastic = !IsNull<Tder>(FDE0);
359 for (
unsigned i = 0; i < dim; i++) {
365 silent_cerr(
"NLPViscoElasticCLR: "
366 "stiffness scalar function #" << i <<
" "
368 "must be differentiable" << std::endl);
377 Tder FDEPrime0(mb_zero<Tder>());
378 bool bViscous(
false);
379 std::vector<const DifferentiableScalarFunction *> FDEPrimesc(dim);
380 for (
unsigned i = 0; i < dim; i++) {
385 if ((Typ & ConstLawType::ELASTIC) && HP.
IsKeyWord(
"proportional")) {
388 FDEPrime0 = HP.
Get(FDEPrime0);
392 bViscous = !IsNull<Tder>(FDEPrime0);
393 for (
unsigned i = 0; i < dim; i++) {
398 if (FDEPrimesc[i] == 0) {
399 silent_cerr(
"NLPViscoElasticCLR: "
400 "damping scalar function #" << i <<
" "
402 "must be differentiable" << std::endl);
411 T PreStress(mb_zero<T>());
415 if (bElastic && bViscous) {
417 }
else if (bElastic) {
419 }
else if (bViscous) {
431 FDEPrime0, FDEPrimesc));
#define MBDYN_EXCEPT_ARGS
virtual bool IsKeyWord(const char *sKeyWord)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
void GetPreStress(MBDynParser &HP, T &PreStress)
virtual doublereal Get(const doublereal &d)
virtual HighParser::ErrOut GetLineData(void) const
const BasicScalarFunction *const ParseScalarFunction(MBDynParser &HP, DataManager *const pDM)
virtual doublereal GetReal(const doublereal &dDefval=0.0)