MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / TclModelBuilder_addWheelRail

Function TclModelBuilder_addWheelRail

SRC/element/TclElementCommands.cpp:3336–3527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3334
3335
3336int
3337TclModelBuilder_addWheelRail(ClientData clientData, Tcl_Interp *interp, int argc,
3338 TCL_Char **argv, Domain *theTclDomain, TclModelBuilder *theTclBuilder,
3339 int eleArgStart)
3340{
3341 // ensure the destructor has not been called -
3342 if (theTclBuilder == 0) {
3343 opserr << "WARNING builder has been destroyed - elasticBeamColumn \n";
3344 return TCL_ERROR;
3345 }
3346
3347 int ndm = theTclBuilder->getNDM();
3348 int ndf = theTclBuilder->getNDF();
3349
3350 Element *theElement = 0;
3351
3352 int pTag, pnLoad;
3353 //-------------Beginning of a 2D wheel-rail element(By Quan Gu, Yongdou Liu, et al.) on 2018/10/29
3354 if (ndm == 2) {
3355
3356 // check plane frame problem has 3 dof per node
3357 if (ndf != 3) {
3358 opserr << "WARNING invalid ndf: " << ndf;
3359 opserr << ", for plane problem need 3 - elasticBeamColumn \n";
3360 return TCL_ERROR;
3361 }
3362
3363 // check the number of arguments
3364 if ((argc - eleArgStart) < 8) {
3365 opserr << "WARNING bad command - want: elasticBeamColumn beamId iNode jNode A E I <alpha> <d> transTag <-mass m> <-cMass>\n";
3366 printCommand(argc, argv);
3367 return TCL_ERROR;
3368 }
3369
3370 // get the id, end nodes, and section properties
3371 int pNd1, transTag;
3372
3373 double pDeltT, pVel, pInitLocation, pRWheel, pI, pE, pA;
3374
3375 if (Tcl_GetInt(interp, argv[1 + eleArgStart], &pTag) != TCL_OK) {
3376 opserr << "WARNING invalid pTag: " << argv[1 + eleArgStart];
3377 opserr << " - WheelRail pTag iNode jNode";
3378 return TCL_ERROR;
3379 }
3380
3381 if (Tcl_GetDouble(interp, argv[2 + eleArgStart], &pDeltT) != TCL_OK) {
3382 opserr << "WARNING invalid pDeltT - WheelRail " << pTag << " iNode jNode A E I\n";
3383 return TCL_ERROR;
3384 }
3385
3386 if (Tcl_GetDouble(interp, argv[3 + eleArgStart], &pVel) != TCL_OK) {
3387 opserr << "WARNING invalid pVel - WheelRail " << pTag << " iNode jNode A E I\n";
3388 return TCL_ERROR;
3389 }
3390
3391 if (Tcl_GetDouble(interp, argv[4 + eleArgStart], &pInitLocation) != TCL_OK) {
3392 opserr << "WARNING invalid pInitLocation - WheelRail " << pTag << " iNode jNode A E I\n";
3393 return TCL_ERROR;

Callers 1

Calls 5

OPS_getCrdTransfFunction · 0.85
printCommandFunction · 0.50
getNDMMethod · 0.45
getNDFMethod · 0.45
addElementMethod · 0.45

Tested by

no test coverage detected