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

Function TclCommand_addHFiber

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

add Hfiber to fiber section

Source from the content-addressed store, hash-verified

1385
1386// add Hfiber to fiber section
1387int
1388TclCommand_addHFiber(ClientData clientData, Tcl_Interp *interp, int argc,
1389 TCL_Char ** const argv)
1390{
1391 assert(clientData != nullptr);
1392 BasicModelBuilder* builder = static_cast<BasicModelBuilder*>(clientData);
1393
1394
1395 SectionBuilder* fiberSectionRepr = findSectionBuilder(builder, interp, argc, argv);
1396 if (fiberSectionRepr == nullptr) {
1397 opserr << OpenSees::PromptValueError << "cannot retrieve section\n";
1398 return TCL_ERROR;
1399 }
1400
1401 // make sure at least one other argument to contain patch type
1402 if (argc < 5) {
1403 opserr << OpenSees::PromptValueError << "invalid num args: Hfiber yLoc zLoc area matTag\n";
1404 return TCL_ERROR;
1405 }
1406
1407
1408 int matHTag;
1409 double yHLoc, zHLoc, Harea;
1410
1411 if (Tcl_GetDouble(interp, argv[1], &yHLoc) != TCL_OK) {
1412 opserr << OpenSees::PromptValueError << "invalid yLoc: Hfiber yLoc zLoc area matTag\n";
1413 return TCL_ERROR;
1414 }
1415 if (Tcl_GetDouble(interp, argv[2], &zHLoc) != TCL_OK) {
1416 opserr << OpenSees::PromptValueError << "invalid zLoc: Hfiber yLoc zLoc area matTag\n";
1417 return TCL_ERROR;
1418 }
1419 if (Tcl_GetDouble(interp, argv[3], &Harea) != TCL_OK) {
1420 opserr << OpenSees::PromptValueError << "invalid area: Hfiber yLoc zLoc area matTag\n";
1421 return TCL_ERROR;
1422 }
1423
1424 if (Tcl_GetInt(interp, argv[4], &matHTag) != TCL_OK) {
1425 opserr << OpenSees::PromptValueError << "invalid matTag: Hfiber yLoc zLoc area matTag\n";
1426 return TCL_ERROR;
1427 }
1428
1429 Vector fiberHPosition(2);
1430 fiberHPosition(0) = yHLoc;
1431 fiberHPosition(1) = zHLoc;
1432
1433 // add patch to section builder
1434 int error = fiberSectionRepr->addHFiber(0, matHTag, Harea, fiberHPosition);
1435
1436 if (error)
1437 return TCL_ERROR;
1438
1439 return TCL_OK;
1440}
1441
1442// add layers of reinforcing bars to fiber section
1443

Callers

nothing calls this directly

Calls 2

findSectionBuilderFunction · 0.85
addHFiberMethod · 0.45

Tested by

no test coverage detected