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

Public Member Functions

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

Detailed Description

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

Member Function Documentation

virtual ConstitutiveLaw<doublereal, doublereal>* ContContactCLR::Read ( const DataManager pDM,
MBDynParser HP,
ConstLawType::Type CLType 
)
inlinevirtual

Implements ConstitutiveLawRead< doublereal, doublereal >.

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

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

241  {
243 
245 
246  if (HP.IsKeyWord("help")) {
247  silent_cerr("ContContactCLR:\n"
248  " continuous contact ,\n"
249  " [ , sign , { negative | positive | <sign> } , ]\n"
250  " [ , formulation, { flores | lankarani nikravesh | hunt crossley } , ]\n"
251  " restitution , <restitution_coefficient> , (0 -> 1)\n"
252  " kappa , <stiffness> , (> 0)\n"
253  " exp , <exponent> , (>= 1)\n"
254  " [ , EpsPrimeTol , <EpsPrimeTol> ]\n"
255  " [ , prestrain , (DriveCaller) <prestrain> ]\n"
256  << std::endl);
257 
258  if (!HP.IsArg()) {
259  throw NoErr(MBDYN_EXCEPT_ARGS);
260  }
261  }
262 
263  doublereal dSign = -1.;
264  if (HP.IsKeyWord("sign")) {
265  if (HP.IsKeyWord("positive")) {
266  dSign = 1.;
267  } else if (HP.IsKeyWord("negative")) {
268  dSign = -1.;
269  } else {
270  doublereal d = HP.GetReal();
271  if (d == 0.) {
272  silent_cerr("ContContactCLR: invalid sign " << d
273  << " at line " << HP.GetLineData() << std::endl);
275  }
276  dSign = copysign(1., d);
277  }
278  }
279 
281  if (HP.IsKeyWord("formulation")) {
282  if (HP.IsKeyWord("flores")) {
284 
285  } else if (HP.IsKeyWord("hunt" "crossley")) {
287 
288  } else if (HP.IsKeyWord("lankarani" "nikravesh")) {
290 
291  } else {
292  silent_cerr("ContContactCLR: invalid formulation"
293  << " at line " << HP.GetLineData() << std::endl);
295  }
296  }
297 
298  if (!HP.IsKeyWord("restitution")) {
299  silent_cerr("ContContactCLR: \"restitution\" expected at line "
300  << HP.GetLineData() << std::endl);
302  }
303  doublereal dRest = HP.GetReal();
304  if (dRest < 0.) {
305  silent_cerr("ContContactCLR: invalid \"restitution\" at line "
306  << HP.GetLineData() << std::endl);
308 
309  } else if ((type == ContContactCL::CC_FLORES_ET_AL) && (dRest <= 0.)) {
310  silent_cerr("ContContactCLR: null \"restitution\" incompatible with \"Flores\" at line "
311  << HP.GetLineData() << std::endl);
313  }
314 
315  if (!HP.IsKeyWord("kappa")) {
316  silent_cerr("ContContactCLR: \"kappa\" expected at line " << HP.GetLineData() << std::endl);
318  }
319  doublereal dK = HP.GetReal();
320  if (dK <= 0.) {
321  silent_cerr("ContContactCLR: invalid \"kappa\" at line " << HP.GetLineData() << std::endl);
323  }
324 
325  if (!HP.IsKeyWord("exp")) {
326  silent_cerr("ContContactCLR: \"exp\" expected at line " << HP.GetLineData() << std::endl);
328  }
329  doublereal dExp = HP.GetReal();
330  if (dExp < 1.) {
331  silent_cerr("ContContactCLR: invalid \"exp\" at line " << HP.GetLineData() << std::endl);
333  }
334 
335  doublereal dInitialEpsPrimeTol = 1.e-6;
336  if (HP.IsKeyWord("EpsPrimeTol")) {
337  dInitialEpsPrimeTol = HP.GetReal();
338  if (dInitialEpsPrimeTol < 0.) {
339  silent_cerr("ContContactCLR: invalid \"EpsPrimeTol\" at line " << HP.GetLineData() << std::endl);
341  }
342  }
343 
344  /* Prestrain */
345  TplDriveCaller<doublereal> *pTplDC = GetPreStrain<doublereal>(pDM, HP);
346 
348  ContContactCL(pTplDC, dSign, type, dRest, dK, dExp, dInitialEpsPrimeTol));
349 
350  return pCL;
351  };
#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: