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

Function TclModelBuilderElementCommand

SRC/element/TclElementCommands.cpp:405–2141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403 Domain*, TclModelBuilder*);
404
405int
406TclModelBuilderElementCommand(ClientData clientData, Tcl_Interp *interp,
407 int argc, TCL_Char **argv,
408 Domain *theTclDomain, TclModelBuilder *theTclBuilder)
409{
410 // ensure the destructor has not been called -
411 if (theTclBuilder == 0) {
412 opserr << "WARNING builder has been destroyed\n";
413 return TCL_ERROR;
414 }
415
416
417 OPS_ResetInput(clientData, interp, 2, argc, argv, theTclDomain, theTclBuilder);
418
419 // check at least two arguments so don't segemnt fault on strcmp
420 if (argc < 2) {
421 opserr << "WARNING need to specify an element type\n";
422 opserr << "Want: element eleType <specific element args> .. see manual for valid eleTypes & arguments\n";
423 return TCL_ERROR;
424 }
425
426 Element *theElement = 0;
427
428 if ((strcmp(argv[1],"truss") == 0) || (strcmp(argv[1],"Truss") == 0)) {
429
430 void *theEle = OPS_TrussElement();
431 // for backward compatibility
432 if (theEle == 0) {
433 theEle = OPS_TrussSectionElement();
434 }
435
436 if (theEle != 0)
437 theElement = (Element *)theEle;
438
439 else {
440 opserr << "TclElementCommand -- unable to create element of type : " << argv[1] << endln;
441 return TCL_ERROR;
442 }
443
444 } else if ((strcmp(argv[1],"trussSection") == 0) || (strcmp(argv[1],"TrussSection") == 0)) {
445
446 void *theEle = OPS_TrussSectionElement();
447 if (theEle != 0)
448 theElement = (Element *)theEle;
449 else {
450 opserr << "TclElementCommand -- unable to create element of type : " << argv[1] << endln;
451 return TCL_ERROR;
452 }
453 }
454
455 else if ((strcmp(argv[1],"corotTruss") == 0) || (strcmp(argv[1],"CorotTruss") == 0)) {
456
457 void *theEle = OPS_CorotTrussElement();
458
459 // for backward compatibility
460 if (theEle == 0)
461 theEle = OPS_CorotTrussSectionElement();
462

Callers 1

TclCommand_addElementFunction · 0.85

Calls 15

OPS_TrussElementFunction · 0.85
OPS_TrussSectionElementFunction · 0.85
OPS_CorotTrussElementFunction · 0.85
OPS_ComponentElement2dFunction · 0.85
OPS_ComponentElement3dFunction · 0.85
OPS_ZeroLengthImpact3DFunction · 0.85
OPS_ModElasticBeam2dFunction · 0.85
OPS_ModElasticBeam3dFunction · 0.85
OPS_ElasticBeam2dFunction · 0.85

Tested by

no test coverage detected