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

Method Print

SRC/element/componentElement/ComponentElement2d.cpp:1017–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1015}
1016
1017void
1018ComponentElement2d::Print(OPS_Stream &s, int flag)
1019{
1020 // to update forces!
1021 this->getResistingForce();
1022
1023 if (flag == -1) {
1024 int eleTag = this->getTag();
1025 s << "EL_BEAM\t" << eleTag << "\t";
1026 s << 0 << "\t" << 0 << "\t" << connectedExternalNodes(0) << "\t" << connectedExternalNodes(1);
1027 s << "0\t0.0000000\n";
1028 }
1029
1030 if (flag == OPS_PRINT_CURRENTSTATE) {
1031 this->getResistingForce();
1032 s << "\nComponentElement2d: " << this->getTag() << endln;
1033 s << "\tConnected Nodes: " << connectedExternalNodes;
1034 s << "\tCoordTransf: " << theCoordTransf->getTag() << endln;
1035 s << "\tmass density: " << rho << endln;
1036 double P = q(0);
1037 double M1 = q(1);
1038 double M2 = q(2);
1039 double L = theCoordTransf->getInitialLength();
1040 double V = (M1 + M2) / L;
1041 s << "\tEnd 1 Forces (P V M): " << -P + p0[0]
1042 << " " << V + p0[1] << " " << M1 << endln;
1043 s << "\tEnd 2 Forces (P V M): " << P
1044 << " " << -V + p0[2] << " " << M2 << endln;
1045 }
1046
1047 if (flag == OPS_PRINT_PRINTMODEL_JSON) {
1048 s << "\t\t\t{";
1049 s << "\"name\": " << this->getTag() << ", ";
1050 s << "\"type\": \"ComponentElement2d\", ";
1051 s << "\"nodes\": [" << connectedExternalNodes(0) << ", " << connectedExternalNodes(1) << "], ";
1052 s << "\"E\": " << E << ", ";
1053 s << "\"A\": " << A << ", ";
1054 s << "\"Iz\": " << I << ", ";
1055 s << "\"massperlength\": " << rho << ", ";
1056 s << "\"materials\": [" ;
1057 if (end1Hinge)
1058 s << "\"" << end1Hinge->getTag() << "\", ";
1059 else
1060 s << "null, ";
1061 if (end2Hinge)
1062 s << "\"" << end2Hinge->getTag() << "\"], ";
1063 else
1064 s << "null], ";
1065 s << "\"crdTransformation\": \"" << theCoordTransf->getTag() << "\"}";
1066 }
1067}
1068
1069int
1070ComponentElement2d::displaySelf(Renderer &theViewer, int displayMode, float fact, const char **modes, int numMode)

Callers

nothing calls this directly

Calls 3

getResistingForceMethod · 0.80
getTagMethod · 0.45
getInitialLengthMethod · 0.45

Tested by

no test coverage detected