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

Method Print

SRC/material/section/FiberSection3dThermal.cpp:1221–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1219}
1220
1221void
1222FiberSection3dThermal::Print(OPS_Stream &s, int flag)
1223{
1224 if (flag == 2) {
1225 for (int i = 0; i < numFibers; i++) {
1226 s << -matData[3*i] << " " << matData[3*i+1] << " " << matData[3*i+2] << " " ;
1227 s << theMaterials[i]->getStress() << " " << theMaterials[i]->getStrain() << endln;
1228 }
1229 } else {
1230 s << "\nFiberSection3dThermal, tag: " << this->getTag() << endln;
1231 s << "\tSection code: " << code;
1232 s << "\tNumber of Fibers: " << numFibers << endln;
1233 s << "\tCentroid: (" << yBar << ", " << zBar << ')' << endln;
1234 if (theTorsion != 0)
1235 theTorsion->Print(s, flag);
1236
1237 if (flag == 1) {
1238 for (int i = 0; i < numFibers; i++) {
1239 s << "\nLocation (y, z) = (" << -matData[3*i] << ", " << matData[3*i+1] << ")";
1240 s << "\nArea = " << matData[3*i+2] << endln;
1241 theMaterials[i]->Print(s, flag);
1242 }
1243 }
1244 }
1245 if (flag == 3) {
1246 for (int i = 0; i < numFibers; i++) {
1247 s << theMaterials[i]->getTag() << " " << matData[3*i] << " " << matData[3*i+1] << " " << matData[3*i+2] << " " ;
1248 s << theMaterials[i]->getStress() << " " << theMaterials[i]->getStrain() << endln;
1249 }
1250 }
1251
1252 if (flag == 4) {
1253 for (int i = 0; i < numFibers; i++) {
1254 s << "add fiber # " << i+1 << " using material # " << theMaterials[i]->getTag() << " to section # 1\n";
1255 s << "fiber_cross_section = " << matData[3*i+2] << "*m^2\n";
1256 s << "fiber_location = (" << matData[3*i] << "*m, " << matData[3*i+1] << "*m);\n\n";
1257 }
1258 }
1259
1260 if (flag == OPS_PRINT_PRINTMODEL_JSON) {
1261 s << "\t\t\t{";
1262 s << "\"name\": \"" << this->getTag() << "\", ";
1263 s << "\"type\": \"FiberSection3d\", ";
1264 if (theTorsion != 0)
1265 s << "\"torsion\": " << theTorsion->getInitialTangent() << ", ";
1266 s << "\"fibers\": [\n";
1267 for (int i = 0; i < numFibers; i++) {
1268 s << "\t\t\t\t{\"coord\": [" << matData[3*i] << ", " << matData[3*i+1] << "], ";
1269 s << "\"area\": " << matData[3*i+2] << ", ";
1270 s << "\"material\": \"" << theMaterials[i]->getTag() << "\"";
1271 if (i < numFibers - 1)
1272 s << "},\n";
1273 else
1274 s << "}\n";
1275 }
1276 s << "\t\t\t]}";
1277 }
1278}

Callers

nothing calls this directly

Calls 4

getStressMethod · 0.45
getStrainMethod · 0.45
getTagMethod · 0.45
getInitialTangentMethod · 0.45

Tested by

no test coverage detected