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

Function OPS_Layer

SRC/interpreter/OpenSeesSectionCommands.cpp:613–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613int OPS_Layer()
614{
615 // num args
616 if(OPS_GetNumRemainingInputArgs() < 1) {
617 opserr<<"WARNING insufficient args: layer type ...\n";
618 return -1;
619 }
620
621 // create patch
622 ReinfLayer *theLayer = 0;
623 const char* type = OPS_GetString();
624
625 if(strcmp(type,"straight")==0) {
626 theLayer = (ReinfLayer*) OPS_StraightReinfLayer();
627 } else if(strcmp(type,"circ")==0 || strcmp(type,"circular")==0) {
628 theLayer = (ReinfLayer*) OPS_CircReinfLayer();
629 } else {
630 opserr<<"ERROR unknown layer type\n";
631 return -1;
632 }
633
634 if (theLayer == 0) {
635 opserr<<"WARNING failed to create layer\n";
636 return -1;
637 }
638
639 // add fibers to the section
640 int numReinfBars = theLayer->getNumReinfBars();
641 ReinfBar* reinfBar = theLayer->getReinfBars();
642 int matTag = theLayer->getMaterialID();
643
644 if(reinfBar == 0) {
645 opserr<<"ERROR out of run to create fibers\n";
646 delete theLayer;
647 return -1;
648 }
649
650 for(int j=0; j<numReinfBars; j++) {
651
652 // get fiber data
653 double area = reinfBar[j].getArea();
654 const Vector& cPos = reinfBar[j].getPosition();
655
656 // create fibers
657 Fiber *theFiber = 0;
658 UniaxialMaterial *material = 0;
659 NDMaterial *ndmaterial = 0;
660
661 if (theActiveFiberSection2d != 0) {
662
663 material = OPS_getUniaxialMaterial(matTag);
664 if (material == 0) {
665 opserr << "WARNING material "<<matTag<<" cannot be found\n";
666 delete theLayer;
667 return -1;
668 }
669 theFiber = new UniaxialFiber2d(j,*material,area,cPos(0));
670 theActiveFiberSection2d->addFiber(*theFiber);

Callers 2

Tcl_ops_layerFunction · 0.85
Py_ops_layerFunction · 0.85

Calls 12

OPS_StraightReinfLayerFunction · 0.85
OPS_CircReinfLayerFunction · 0.85
OPS_GetStringFunction · 0.70
OPS_getUniaxialMaterialFunction · 0.50
OPS_getNDMaterialFunction · 0.50
getNumReinfBarsMethod · 0.45
getReinfBarsMethod · 0.45
getMaterialIDMethod · 0.45
getAreaMethod · 0.45
getPositionMethod · 0.45
addFiberMethod · 0.45

Tested by

no test coverage detected