Skip to content

Commit

Permalink
Merge branch 'OpenSees:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jaabell authored May 31, 2022
2 parents b45fc18 + bdd0d1a commit b43a3ae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 10 additions & 2 deletions SRC/material/section/FiberSection2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,9 @@ FiberSection2d::setResponse(const char **argv, int argc,
else if ((strcmp(argv[0], "energy") == 0) || (strcmp(argv[0], "Energy") == 0)) {
theResponse = new MaterialResponse(this, 8, getEnergy());
}

else if (strcmp(argv[0],"centroid") == 0)
theResponse = new MaterialResponse(this, 20, Vector(2));

if (theResponse == 0)
return SectionForceDeformation::setResponse(argv, argc, output);

Expand Down Expand Up @@ -1038,7 +1040,13 @@ FiberSection2d::getResponse(int responseID, Information &sectInfo)
else if (responseID == 8) {
return sectInfo.setDouble(getEnergy());
}

else if (responseID == 20) {
static Vector centroid(2);
centroid(0) = yBar;
centroid(1) = 0.0;
return sectInfo.setVector(centroid);
}

return SectionForceDeformation::getResponse(responseID, sectInfo);
}

Expand Down
12 changes: 10 additions & 2 deletions SRC/material/section/FiberSection3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ FiberSection3d::setResponse(const char **argv, int argc, OPS_Stream &output)
}
Vector theResponseData(numData);
theResponse = new MaterialResponse(this, 55, theResponseData);

} else if ((strcmp(argv[0],"numFailedFiber") == 0) ||
(strcmp(argv[0],"numFiberFailed") == 0)) {
int count = 0;
Expand All @@ -1244,7 +1244,9 @@ FiberSection3d::setResponse(const char **argv, int argc, OPS_Stream &output)
else if ((strcmp(argv[0], "energy") == 0) || (strcmp(argv[0], "Energy") == 0)) {
theResponse = new MaterialResponse(this, 10, getEnergy());
}

else if (strcmp(argv[0],"centroid") == 0)
theResponse = new MaterialResponse(this, 20, Vector(2));

if (theResponse == 0)
return SectionForceDeformation::setResponse(argv, argc, output);

Expand Down Expand Up @@ -1309,6 +1311,12 @@ FiberSection3d::getResponse(int responseID, Information &sectInfo)

return sectInfo.setDouble(getEnergy());
}
else if (responseID == 20) {
static Vector centroid(2);
centroid(0) = yBar;
centroid(1) = zBar;
return sectInfo.setVector(centroid);
}

return SectionForceDeformation::getResponse(responseID, sectInfo);
}
Expand Down
10 changes: 9 additions & 1 deletion SRC/material/section/FiberSectionAsym3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,9 @@ FiberSectionAsym3d::setResponse(const char **argv, int argc, OPS_Stream &output)
int count = 0;
theResponse = new MaterialResponse(this, 7, count);
}

else if (strcmp(argv[0],"centroid") == 0)
theResponse = new MaterialResponse(this, 20, Vector(2));

if (theResponse == 0)
return SectionForceDeformation::setResponse(argv, argc, output);

Expand Down Expand Up @@ -1321,6 +1323,12 @@ FiberSectionAsym3d::getResponse(int responseID, Information &sectInfo)

return sectInfo.setInt(count);
}
else if (responseID == 20) {
static Vector centroid(2);
centroid(0) = yBar;
centroid(1) = zBar;
return sectInfo.setVector(centroid);
}

return SectionForceDeformation::getResponse(responseID, sectInfo);
}
Expand Down

0 comments on commit b43a3ae

Please sign in to comment.