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

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 154 of file module-hunt-crossley.cc.

Member Function Documentation

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

Implements ConstitutiveLawRead< doublereal, doublereal >.

Definition at line 156 of file module-hunt-crossley.cc.

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

156  {
158 
160 
161  if (HP.IsKeyWord("help")) {
162  silent_cerr("HuntCrossleyCL:\n"
163  " hunt crossley,\n"
164  " [ , sign, { negative | positive | <sign> } , ]\n"
165  " alpha, <alpha>,\n"
166  " kappa, <kappa>,\n"
167  " exp, <exp>,\n"
168  " [ , prestress, <prestress> ]\n"
169  " [ , prestrain, (DriveCaller)<prestrain> ]\n"
170  << std::endl);
171 
172  if (!HP.IsArg()) {
173  throw NoErr(MBDYN_EXCEPT_ARGS);
174  }
175  }
176 
177  doublereal dSign = -1.;
178  if (HP.IsKeyWord("sign")) {
179  if (HP.IsKeyWord("positive")) {
180  dSign = 1.;
181  } else if (HP.IsKeyWord("negative")) {
182  dSign = -1.;
183  } else {
184  doublereal d = HP.GetReal();
185  if (d == 0.) {
186  silent_cerr("HuntCrossleyCLR: invalid sign " << d
187  << " at line " << HP.GetLineData() << std::endl);
189  }
190  dSign = copysign(1., d);
191  }
192  }
193 
194  if (!HP.IsKeyWord("alpha")) {
195  silent_cerr("HuntCrossleyCLR: \"alpha\" expected at line " << HP.GetLineData() << std::endl);
197  }
198  doublereal dAlpha = HP.GetReal();
199  if (dAlpha < 0.) {
200  silent_cerr("HuntCrossleyCLR: invalid \"alpha\" at line " << HP.GetLineData() << std::endl);
202  }
203 
204  if (!HP.IsKeyWord("kappa")) {
205  silent_cerr("HuntCrossleyCLR: \"kappa\" expected at line " << HP.GetLineData() << std::endl);
207  }
208  doublereal dK = HP.GetReal();
209  if (dK <= 0.) {
210  silent_cerr("HuntCrossleyCLR: invalid \"kappa\" at line " << HP.GetLineData() << std::endl);
212  }
213 
214  if (!HP.IsKeyWord("exp")) {
215  silent_cerr("HuntCrossleyCLR: \"exp\" expected at line " << HP.GetLineData() << std::endl);
217  }
218  doublereal dExp = HP.GetReal();
219  if (dExp < 1.) {
220  silent_cerr("HuntCrossleyCLR: invalid \"exp\" at line " << HP.GetLineData() << std::endl);
222  }
223 
224  /* Prestress and prestrain */
225  // doublereal PreStress(0.);
226  // GetPreStress(HP, PreStress);
227  TplDriveCaller<doublereal> *pTplDC = GetPreStrain<doublereal>(pDM, HP);
228 
230  HuntCrossleyCL(pTplDC, dSign, dAlpha, dK, dExp));
231 
232  return pCL;
233  };
#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: