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

Function TclCommand_addReinfLayer

SRC/runtime/commands/modeling/section.cpp:1444–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1442// add layers of reinforcing bars to fiber section
1443
1444int
1445TclCommand_addReinfLayer(ClientData clientData, Tcl_Interp *interp, int argc,
1446 TCL_Char ** const argv)
1447{
1448 assert(clientData != nullptr);
1449 BasicModelBuilder *builder = static_cast<BasicModelBuilder*>(clientData);
1450
1451 SectionBuilder* fiberSectionRepr = findSectionBuilder(builder, interp, argc, argv);
1452 if (fiberSectionRepr == nullptr) {
1453 opserr << OpenSees::PromptValueError << "cannot retrieve section\n";
1454 return TCL_ERROR;
1455 }
1456
1457 // make sure at least one other argument to contain layer type
1458 if (argc < 2) {
1459 opserr << OpenSees::PromptValueError << "need to specify a layer type \n";
1460 return TCL_ERROR;
1461 }
1462
1463 // check argv[1] for type of layer and create the object
1464 if (strcmp(argv[1], "straight") == 0 ||
1465 strcmp(argv[1], "line") == 0) {
1466 if (argc < 9) {
1467 opserr << OpenSees::PromptValueError << "invalid number of parameters: layer straight matTag "
1468 "numReinfBars reinfBarArea yStartPt zStartPt yEndPt zEndPt\n";
1469 return TCL_ERROR;
1470 }
1471
1472 int matTag, numReinfBars;
1473 double reinfBarArea;
1474 double yStartPt, zStartPt, yEndPt, zEndPt;
1475
1476 int argi = 2;
1477
1478 if (Tcl_GetInt(interp, argv[argi++], &matTag) != TCL_OK) {
1479 opserr << OpenSees::PromptValueError << "invalid matTag: layer straight matTag numReinfBars "
1480 "reinfBarArea yStartPt zStartPt yEndPt zEndPt\n";
1481 return TCL_ERROR;
1482 }
1483
1484 if (Tcl_GetInt(interp, argv[argi++], &numReinfBars) != TCL_OK) {
1485 opserr << OpenSees::PromptValueError << "invalid numReinfBars: layer straight matTag "
1486 "numReinfBars reinfBarArea yStartPt zStartPt yEndPt zEndPt\n";
1487 return TCL_ERROR;
1488 }
1489
1490 if (Tcl_GetDouble(interp, argv[argi++], &reinfBarArea) != TCL_OK) {
1491 opserr << OpenSees::PromptValueError << "invalid reinfBarArea: layer straight matTag "
1492 "numReinfBars reinfBarArea yStartPt zStartPt yEndPt zEndPt\n";
1493 return TCL_ERROR;
1494 }
1495
1496 if (Tcl_GetDouble(interp, argv[argi++], &yStartPt) != TCL_OK) {
1497 opserr << OpenSees::PromptValueError << "invalid yStartPt: layer straight matTag numReinfBars "
1498 "reinfBarArea yStartPt zStartPt yEndPt zEndPt\n";
1499 return TCL_ERROR;
1500 }
1501

Callers

nothing calls this directly

Calls 2

findSectionBuilderFunction · 0.85
addLayerMethod · 0.80

Tested by

no test coverage detected