MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ContContact3DCLR Struct Reference
Inheritance diagram for ContContact3DCLR:
Collaboration diagram for ContContact3DCLR:

Public Member Functions

virtual ConstitutiveLaw< Vec3,
Mat3x3 > * 
Read (const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
 
- Public Member Functions inherited from ConstitutiveLawRead< Vec3, Mat3x3 >
virtual ~ConstitutiveLawRead (void)
 

Detailed Description

Definition at line 548 of file module-cont-contact.cc.

Member Function Documentation

virtual ConstitutiveLaw<Vec3, Mat3x3>* ContContact3DCLR::Read ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)
inlinevirtual

Implements ConstitutiveLawRead< Vec3, Mat3x3 >.

Definition at line 550 of file module-cont-contact.cc.

References ContContact3DCL::CC_FLORES_ET_AL, ContContact3DCL::CC_HUNT_CROSSLEY, ContContact3DCL::CC_LANKARANI_NIKRAVESH, copysign(), IncludeParser::GetLineData(), HighParser::GetReal(), HighParser::IsArg(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, SAFENEWWITHCONSTRUCTOR, and ConstLawType::VISCOELASTIC.

550  {
552 
554 
555  if (HP.IsKeyWord("help")) {
556  silent_cerr("ContContact3DCL:\n"
557  " continuous contact ,\n"
558  " [ , sign , { negative | positive | <sign> } , ]\n"
559  " [ , formulation , { flores | lankarani nikravesh | hunt crossley } , ]\n"
560  " restitution , <restitution_coefficient>, (0 -> 1)\n"
561  " kappa , <stiffness> , (> 0)\n"
562  " exp , <exponent> , (>= 1)\n"
563  " [ , EpsPrimeTol , <EpsPrimeTol> ]\n"
564  " [ , prestrain , (DriveCaller) <prestrain> ]\n"
565  << std::endl);
566 
567  if (!HP.IsArg()) {
568  throw NoErr(MBDYN_EXCEPT_ARGS);
569  }
570  }
571 
572  doublereal dSign = -1.;
573  if (HP.IsKeyWord("sign")) {
574  if (HP.IsKeyWord("positive")) {
575  dSign = 1.;
576  } else if (HP.IsKeyWord("negative")) {
577  dSign = -1.;
578  } else {
579  doublereal d = HP.GetReal();
580  if (d == 0.) {
581  silent_cerr("ContContact3DCLR: invalid sign " << d
582  << " at line " << HP.GetLineData() << std::endl);
584  }
585  dSign = copysign(1., d);
586  }
587  }
588 
590  if (HP.IsKeyWord("formulation")) {
591  if (HP.IsKeyWord("flores")) {
593 
594  } else if (HP.IsKeyWord("hunt" "crossley")) {
596 
597  } else if (HP.IsKeyWord("lankarani" "nikravesh")) {
599 
600  } else {
601  silent_cerr("ContContact3DCLR: invalid formulation"
602  << " at line " << HP.GetLineData() << std::endl);
604  }
605  }
606 
607  if (!HP.IsKeyWord("restitution")) {
608  silent_cerr("ContContact3DCLR: \"restitution\" expected at line "
609  << HP.GetLineData() << std::endl);
611  }
612  doublereal dRest = HP.GetReal();
613  if (dRest < 0.) {
614  silent_cerr("ContContact3DCLR: invalid \"restitution\" at line "
615  << HP.GetLineData() << std::endl);
617 
618  } else if ((type == ContContact3DCL::CC_FLORES_ET_AL) && (dRest <= 0.)) {
619  silent_cerr("ContContact3DCLR: null \"restitution\" incompatible with \"Flores\" at line "
620  << HP.GetLineData() << std::endl);
622  }
623 
624  if (!HP.IsKeyWord("kappa")) {
625  silent_cerr("ContContact3DCLR: \"kappa\" expected at line " << HP.GetLineData() << std::endl);
627  }
628  doublereal dK = HP.GetReal();
629  if (dK <= 0.) {
630  silent_cerr("ContContact3DCLR: invalid \"kappa\" at line " << HP.GetLineData() << std::endl);
632  }
633 
634  if (!HP.IsKeyWord("exp")) {
635  silent_cerr("ContContact3DCLR: \"exp\" expected at line " << HP.GetLineData() << std::endl);
637  }
638  doublereal dExp = HP.GetReal();
639  if (dExp < 1.) {
640  silent_cerr("ContContact3DCLR: invalid \"exp\" at line " << HP.GetLineData() << std::endl);
642  }
643 
644  doublereal dInitialEpsPrimeTol = 1.e-6;
645  if (HP.IsKeyWord("EpsPrimeTol")) {
646  dInitialEpsPrimeTol = HP.GetReal();
647  if (dInitialEpsPrimeTol < 0.) {
648  silent_cerr("ContContact3DCLR: invalid \"EpsPrimeTol\" at line " << HP.GetLineData() << std::endl);
650  }
651  }
652 
653  /* Prestrain */
654  TplDriveCaller<Vec3> *pTplDC = GetPreStrain<Vec3>(pDM, HP);
655 
657  ContContact3DCL(pTplDC, dSign, type, dRest, dK, dExp, dInitialEpsPrimeTol));
658 
659  return pCL;
660  };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
Definition: except.h:79
virtual bool IsArg(void)
Definition: parser.cc:807
double doublereal
Definition: colamd.c:52
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:


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