Skip to content

Commit

Permalink
Merge pull request #665 from mhscott/sectionTags
Browse files Browse the repository at this point in the history
Adding output command for section tags and modifying commands for locations and weights
  • Loading branch information
mhscott committed Sep 17, 2021
2 parents 43054b5 + 28b4151 commit 65b8e52
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 35 deletions.
11 changes: 11 additions & 0 deletions SRC/element/dispBeamColumn/DispBeamColumn2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,9 @@ DispBeamColumn2d::setResponse(const char **argv, int argc,
else if (strcmp(argv[0],"integrationWeights") == 0)
return new ElementResponse(this, 8, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0], "energy") == 0) //by SAJalali
{
return new ElementResponse(this, 10, 0.0);
Expand Down Expand Up @@ -1735,6 +1738,14 @@ DispBeamColumn2d::getResponse(int responseID, Information &eleInfo)
weights(i) = wt[i]*L;
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

//by SAJalali
else if (responseID == 10) {
double xi[maxNumSections];
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/dispBeamColumn/DispBeamColumn3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,9 @@ DispBeamColumn3d::setResponse(const char **argv, int argc, OPS_Stream &output)
else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0],"xaxis") == 0 || strcmp(argv[0],"xlocal") == 0)
theResponse = new ElementResponse(this, 201, Vector(3));

Expand Down Expand Up @@ -1557,6 +1560,13 @@ DispBeamColumn3d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID >= 201 && responseID <= 203) {
static Vector xlocal(3);
static Vector ylocal(3);
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/dispBeamColumn/DispBeamColumnAsym3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,9 @@ DispBeamColumnAsym3d::setResponse(const char **argv, int argc, OPS_Stream &outpu

else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

// section response -
else if (strstr(argv[0],"sectionX") != 0) {
Expand Down Expand Up @@ -1900,6 +1903,13 @@ DispBeamColumnAsym3d::getResponse(int responseID, Information &eleInfo)
weights(i) = wts[i]*L;
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

else
return -1;
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/dispBeamColumn/DispBeamColumnNL2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,9 @@ DispBeamColumnNL2d::setResponse(const char **argv, int argc,

else if (strcmp(argv[0],"integrationWeights") == 0)
return new ElementResponse(this, 8, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

output.endTag();
return theResponse;
Expand Down Expand Up @@ -1723,6 +1726,13 @@ DispBeamColumnNL2d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

else
return Element::getResponse(responseID, eleInfo);
}
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/dispBeamColumn/DispBeamColumnNL3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,9 @@ DispBeamColumnNL3d::setResponse(const char **argv, int argc,
else if (strcmp(argv[0],"integrationWeights") == 0)
return new ElementResponse(this, 8, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

output.endTag();
return theResponse;
}
Expand Down Expand Up @@ -1854,6 +1857,13 @@ DispBeamColumnNL3d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID == 111 || responseID == 1111) {
double L = crdTransf->getInitialLength();
double pts[maxNumSections];
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/dispBeamColumn/TimoshenkoBeamColumn2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,9 @@ TimoshenkoBeamColumn2d::setResponse(const char **argv, int argc,

else if (strcmp(argv[0],"integrationWeights") == 0)
return new ElementResponse(this, 8, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

output.endTag();
return theResponse;
Expand Down Expand Up @@ -1431,6 +1434,13 @@ TimoshenkoBeamColumn2d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = theSections[i]->getTag();
return eleInfo.setID(tags);
}

else
return -1;
}
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/forceBeamColumn/ForceBeamColumn2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,9 @@ ForceBeamColumn2d::setResponse(const char **argv, int argc, OPS_Stream &output)
else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0],"sectionDisplacements") == 0)
theResponse = new ElementResponse(this, 111, Matrix(numSections,3));

Expand Down Expand Up @@ -2887,6 +2890,13 @@ ForceBeamColumn2d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID == 111) {
double L = crdTransf->getInitialLength();
double pts[maxNumSections];
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/forceBeamColumn/ForceBeamColumn3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2727,6 +2727,9 @@ ForceBeamColumn3d::getInitialDeformations(Vector &v0)
else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0],"sectionDisplacements") == 0) {
if (argc > 1 && strcmp(argv[1],"local") == 0)
theResponse = new ElementResponse(this, 1111, Matrix(numSections,3));
Expand Down Expand Up @@ -2900,6 +2903,13 @@ ForceBeamColumn3d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID == 111 || responseID == 1111) {
double L = crdTransf->getInitialLength();
double pts[maxNumSections];
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/forceBeamColumn/ForceBeamColumnCBDI2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,9 @@ ForceBeamColumnCBDI2d::setResponse(const char **argv, int argc, OPS_Stream &outp
else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0],"sectionDisplacements") == 0)
theResponse = new ElementResponse(this, 111, Matrix(numSections,3));

Expand Down Expand Up @@ -3230,6 +3233,13 @@ ForceBeamColumnCBDI2d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID == 111) {
double L = crdTransf->getInitialLength();
double pts[maxNumSections];
Expand Down
10 changes: 10 additions & 0 deletions SRC/element/forceBeamColumn/ForceBeamColumnCBDI3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3481,6 +3481,9 @@ ForceBeamColumnCBDI3d::setResponse(const char **argv, int argc, OPS_Stream &outp
else if (strcmp(argv[0],"integrationWeights") == 0)
theResponse = new ElementResponse(this, 11, Vector(numSections));

else if (strcmp(argv[0],"sectionTags") == 0)
theResponse = new ElementResponse(this, 110, ID(numSections));

else if (strcmp(argv[0],"sectionDisplacements") == 0)
theResponse = new ElementResponse(this, 111, Matrix(numSections,3));

Expand Down Expand Up @@ -3755,6 +3758,13 @@ ForceBeamColumnCBDI3d::getResponse(int responseID, Information &eleInfo)
return eleInfo.setVector(weights);
}

else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);
}

else if (responseID == 111) {
double L = crdTransf->getInitialLength();
double pts[maxNumSections];
Expand Down
11 changes: 10 additions & 1 deletion SRC/element/mixedBeamColumn/MixedBeamColumn2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,14 +1273,17 @@ Response* MixedBeamColumn2d::setResponse(const char **argv, int argc,
} else if (strcmp(argv[0],"integrationWeights") == 0) {
theResponse = new ElementResponse(this, 101, Vector(numSections));

} else if (strcmp(argv[0],"sectionTags") == 0) {
theResponse = new ElementResponse(this, 110, ID(numSections));

} else if (strcmp(argv[0],"connectedNodes") == 0) {
theResponse = new ElementResponse(this, 102, Vector(2));

} else if (strcmp(argv[0],"numSections") == 0 ||
strcmp(argv[0],"numberOfSections") == 0 ) {
theResponse = new ElementResponse(this, 103, Vector(1));

} else if (strcmp(argv[0],"section") ==0) {
} else if (strcmp(argv[0],"section") ==0) {
if (argc > 2) {

int sectionNum = atoi(argv[1]);
Expand Down Expand Up @@ -1396,6 +1399,12 @@ int MixedBeamColumn2d::getResponse(int responseID, Information &eleInfo) {
weights(i) = wts[i]*L;
return eleInfo.setVector(weights);

} else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);

} else if (responseID == 102) { // connected nodes
Vector tempVector(2);
tempVector(0) = connectedExternalNodes(0);
Expand Down
9 changes: 9 additions & 0 deletions SRC/element/mixedBeamColumn/MixedBeamColumn3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,9 @@ Response* MixedBeamColumn3d::setResponse(const char **argv, int argc,
} else if (strcmp(argv[0],"integrationWeights") == 0) {
theResponse = new ElementResponse(this, 101, Vector(numSections));

} else if (strcmp(argv[0],"sectionTags") == 0) {
theResponse = new ElementResponse(this, 110, ID(numSections));

} else if (strcmp(argv[0],"connectedNodes") == 0) {
theResponse = new ElementResponse(this, 102, Vector(2));

Expand Down Expand Up @@ -1545,6 +1548,12 @@ int MixedBeamColumn3d::getResponse(int responseID, Information &eleInfo) {
weights(i) = wts[i]*L;
return eleInfo.setVector(weights);

} else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);

} else if (responseID == 102) { // connected nodes
Vector tempVector(2);
tempVector(0) = connectedExternalNodes(0);
Expand Down
9 changes: 9 additions & 0 deletions SRC/element/mixedBeamColumn/MixedBeamColumnAsym3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,9 @@ Response* MixedBeamColumnAsym3d::setResponse(const char **argv, int argc,
} else if (strcmp(argv[0],"integrationWeights") == 0) {
theResponse = new ElementResponse(this, 101, Vector(numSections));

} else if (strcmp(argv[0],"sectionTags") == 0) {
theResponse = new ElementResponse(this, 110, ID(numSections));

} else if (strcmp(argv[0],"connectedNodes") == 0) {
theResponse = new ElementResponse(this, 102, Vector(2));

Expand Down Expand Up @@ -1713,6 +1716,12 @@ int MixedBeamColumnAsym3d::getResponse(int responseID, Information &eleInfo) {
weights(i) = wts[i]*L;
return eleInfo.setVector(weights);

} else if (responseID == 110) {
ID tags(numSections);
for (int i = 0; i < numSections; i++)
tags(i) = sections[i]->getTag();
return eleInfo.setID(tags);

} else if (responseID == 102) { // connected nodes
Vector tempVector(2);
tempVector(0) = connectedExternalNodes(0);
Expand Down
1 change: 1 addition & 0 deletions SRC/interpreter/OpenSeesCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ int OPS_sectionStiffness();
int OPS_sectionFlexibility();
int OPS_sectionLocation();
int OPS_sectionWeight();
int OPS_sectionTag();
int OPS_sectionDisplacement();
int OPS_cbdiDisplacement();
int OPS_basicDeformation();
Expand Down
Loading

0 comments on commit 65b8e52

Please sign in to comment.