Skip to content

Commit

Permalink
Merge pull request #680 from mhscott/mixedBeamColumn
Browse files Browse the repository at this point in the history
Adding section displacement to element recorder
  • Loading branch information
mhscott committed Oct 10, 2021
2 parents 0dfbf52 + 077f35a commit e82f886
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions SRC/element/mixedBeamColumn/MixedBeamColumn3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,13 @@ Response* MixedBeamColumn3d::setResponse(const char **argv, int argc,

}

else if (strcmp(argv[0],"sectionDisplacements") == 0) {
if (argc > 1 && strcmp(argv[1],"local") == 0)
theResponse = new ElementResponse(this, 1111, Matrix(numSections,3));
else
theResponse = new ElementResponse(this, 111, Matrix(numSections,3));
}

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

Expand Down Expand Up @@ -1567,6 +1574,53 @@ int MixedBeamColumn3d::getResponse(int responseID, Information &eleInfo) {

}

else if (responseID == 111 || responseID == 1111) {
double L = crdTransf->getInitialLength();
double pts[MAX_NUM_SECTIONS];
beamIntegr->getSectionLocations(numSections, L, pts);
// CBDI influence matrix
Matrix ls(numSections, numSections);
getCBDIinfluenceMatrix(numSections, pts, L, ls);
// Curvature vector
Vector kappaz(numSections); // about section z
Vector kappay(numSections); // about section y
for (int i = 0; i < numSections; i++) {
const ID &code = sections[i]->getType();
const Vector &e = sections[i]->getSectionDeformation();
int order = sections[i]->getOrder();
for (int j = 0; j < order; j++) {
if (code(j) == SECTION_RESPONSE_MZ)
kappaz(i) += e(j);
if (code(j) == SECTION_RESPONSE_MY)
kappay(i) += e(j);
}
}
// Displacement vector
Vector dispsy(numSections); // along local y
Vector dispsz(numSections); // along local z
dispsy.addMatrixVector(0.0, ls, kappaz, 1.0);
dispsz.addMatrixVector(0.0, ls, kappay, -1.0);
beamIntegr->getSectionLocations(numSections, L, pts);
static Vector uxb(3);
static Vector uxg(3);
Matrix disps(numSections,3);
static Vector vp(6);
vp = crdTransf->getBasicTrialDisp();
for (int i = 0; i < numSections; i++) {
uxb(0) = pts[i]*vp(0); // linear shape function
uxb(1) = dispsy(i);
uxb(2) = dispsz(i);
if (responseID == 111)
uxg = crdTransf->getPointGlobalDisplFromBasic(pts[i],uxb);
else
uxg = crdTransf->getPointLocalDisplFromBasic(pts[i],uxb);
disps(i,0) = uxg(0);
disps(i,1) = uxg(1);
disps(i,2) = uxg(2);
}
return eleInfo.setMatrix(disps);
}

else if (responseID >= 201 && responseID <= 203) {
static Vector xlocal(3);
static Vector ylocal(3);
Expand Down

0 comments on commit e82f886

Please sign in to comment.