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

Function OPS_doBlock3D

SRC/interpreter/OpenSeesElementCommands.cpp:1292–1462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1290}
1291
1292int OPS_doBlock3D()
1293{
1294 int ndm = OPS_GetNDM();
1295 if (ndm < 3) {
1296 opserr << "WARNING block3D numX? numY? numZ? startNode? startEle? eleType? eleArgs?";
1297 opserr << " : model dimension (ndm) must be at least 3 \n";
1298 return -1;
1299 }
1300
1301 int ndf = OPS_GetNDF();
1302 Domain* theDomain = OPS_GetDomain();
1303 if (theDomain == 0) return -1;
1304
1305 if (OPS_GetNumRemainingInputArgs() < 8) {
1306 opserr << "WARNING incorrect number of args :block3D numX? numY? numZ? startNode? startEle? eleType? eleArgs? coords?";
1307 return -1;
1308 }
1309
1310 // numX, numY, numZ, startNodeNum, startEleNum
1311 int idata[5];
1312 int numdata = 5;
1313 if (OPS_GetIntInput(&numdata, idata) < 0) {
1314 opserr << "WARNING invalid int inputs\n";
1315 return -1;
1316 }
1317
1318 // element type
1319 const char* type = OPS_GetString();
1320
1321 // get mattag
1322 int matTag=-1;
1323 numdata = 1;
1324 if (OPS_GetIntInput(&numdata, &matTag) < 0) {
1325 opserr << "WARNING invalid matTag\n";
1326 return -1;
1327 }
1328
1329 // get coords
1330 Matrix Coordinates(27,3);
1331 ID haveNode(27);
1332 Coordinates.Zero();
1333 for (int k=0; k<27; k++) {
1334 haveNode(k) = -1;
1335 }
1336
1337 int numnodes = OPS_GetNumRemainingInputArgs() / (ndm+1);
1338 if (numnodes < 8) {
1339 opserr<<"WARNING eight points (1-8) are required\n";
1340 return -1;
1341 }
1342
1343 if (numnodes > 27) numnodes = 27;
1344
1345 for (int i=0; i<numnodes; i++) {
1346 int tag;
1347 int numdata = 1;
1348 if (OPS_GetIntInput(&numdata, &tag) < 0) {
1349 opserr<<"WARNING failed to get node tag\n";

Callers 2

Tcl_ops_block3dFunction · 0.85
Py_ops_block3dFunction · 0.85

Calls 12

OPS_GetNDMFunction · 0.70
OPS_GetNDFFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_GetIntInputFunction · 0.70
OPS_GetStringFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
OPS_getNDMaterialFunction · 0.50
ZeroMethod · 0.45
getNodalCoordsMethod · 0.45
addNodeMethod · 0.45
addElementMethod · 0.45

Tested by

no test coverage detected