00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <HingeMidpointBeamIntegration3d.h>
00026 #include <ElementalLoad.h>
00027
00028 #include <Matrix.h>
00029 #include <Vector.h>
00030 #include <Channel.h>
00031 #include <FEM_ObjectBroker.h>
00032 #include <Information.h>
00033
00034 HingeMidpointBeamIntegration3d::HingeMidpointBeamIntegration3d(double e,
00035 double a,
00036 double iz,
00037 double iy,
00038 double g,
00039 double j,
00040 double lpi,
00041 double lpj):
00042 BeamIntegration(BEAM_INTEGRATION_TAG_HingeMidpoint3d),
00043 E(e), A(a), Iz(iz), Iy(iy), G(g), J(j), lpI(lpi), lpJ(lpj)
00044 {
00045
00046 }
00047
00048 HingeMidpointBeamIntegration3d::HingeMidpointBeamIntegration3d():
00049 BeamIntegration(BEAM_INTEGRATION_TAG_HingeMidpoint3d),
00050 E(0.0), A(0.0), Iz(0.0), Iy(0.0), G(0.0), J(0.0), lpI(0.0), lpJ(0.0)
00051 {
00052
00053 }
00054
00055 HingeMidpointBeamIntegration3d::~HingeMidpointBeamIntegration3d()
00056 {
00057
00058 }
00059
00060 void
00061 HingeMidpointBeamIntegration3d::getSectionLocations(int numSections, double L,
00062 double *xi)
00063 {
00064 double halfOneOverL = 0.5/L;
00065
00066 xi[0] = lpI*halfOneOverL;
00067 xi[1] = 1.0-lpJ*halfOneOverL;
00068 for (int i = 2; i < numSections; i++)
00069 xi[i] = 0.0;
00070 }
00071
00072 void
00073 HingeMidpointBeamIntegration3d::getSectionWeights(int numSections, double L,
00074 double *wt)
00075 {
00076 double oneOverL = 1.0/L;
00077
00078 wt[0] = lpI*oneOverL;
00079 wt[1] = lpJ*oneOverL;
00080 for (int i = 2; i < numSections; i++)
00081 wt[i] = 1.0;
00082 }
00083
00084 int
00085 HingeMidpointBeamIntegration3d::addElasticFlexibility(double L, Matrix &fElastic)
00086 {
00087 double oneOverL = 1.0/L;
00088
00089
00090 double Le = L-lpI-lpJ;
00091 double Lover3EI = Le/(3*E*Iz);
00092 double Lover6EI = 0.5*Lover3EI;
00093
00094
00095 static Matrix fe(2,2);
00096 fe(0,0) = fe(1,1) = Lover3EI;
00097 fe(0,1) = fe(1,0) = -Lover6EI;
00098
00099
00100 static Matrix B(2,2);
00101 double betaI = lpI*oneOverL;
00102 double betaJ = lpJ*oneOverL;
00103 B(0,0) = 1.0 - betaI;
00104 B(1,1) = 1.0 - betaJ;
00105 B(0,1) = -betaI;
00106 B(1,0) = -betaJ;
00107
00108
00109
00110 static Matrix ftmp(2,2);
00111 ftmp.addMatrixTripleProduct(0.0, B, fe, 1.0);
00112
00113 fElastic(1,1) += ftmp(0,0);
00114 fElastic(1,2) += ftmp(0,1);
00115 fElastic(2,1) += ftmp(1,0);
00116 fElastic(2,2) += ftmp(1,1);
00117
00118 Lover3EI = Le/(3*E*Iy);
00119 Lover6EI = 0.5*Lover3EI;
00120 fe(0,0) = fe(1,1) = Lover3EI;
00121 fe(0,1) = fe(1,0) = -Lover6EI;
00122 ftmp.addMatrixTripleProduct(0.0, B, fe, 1.0);
00123 fElastic(3,3) += ftmp(0,0);
00124 fElastic(3,4) += ftmp(0,1);
00125 fElastic(4,3) += ftmp(1,0);
00126 fElastic(4,4) += ftmp(1,1);
00127
00128 fElastic(0,0) += Le/(E*A);
00129 fElastic(5,5) += Le/(G*J);
00130
00131 return -1;
00132 }
00133
00134 void
00135 HingeMidpointBeamIntegration3d::addElasticDeformations(ElementalLoad *theLoad,
00136 double loadFactor,
00137 double L, double *v0)
00138 {
00139
00140 double Le = L-lpI-lpJ;
00141 if (Le == 0.0)
00142 return;
00143
00144 int type;
00145 const Vector &data = theLoad->getData(type, loadFactor);
00146
00147 double oneOverL = 1.0/L;
00148
00149 if (type == LOAD_TAG_Beam3dUniformLoad) {
00150 double wy = data(0)*loadFactor;
00151 double wz = data(1)*loadFactor;
00152 double wx = data(2)*loadFactor;
00153
00154
00155
00156 v0[0] += wx*0.5*(L-lpI+lpJ)/(E*A)*Le;
00157
00158
00159
00160 double x1 = lpI + 0.5*Le*(1.0-1.0/sqrt(3.0));
00161 double x2 = lpI + 0.5*Le*(1.0+1.0/sqrt(3.0));
00162
00163 double Mz1 = 0.5*wy*x1*(x1-L);
00164 double Mz2 = 0.5*wy*x2*(x2-L);
00165
00166 double My1 = -0.5*wz*x1*(x1-L);
00167 double My2 = -0.5*wz*x2*(x2-L);
00168
00169 double Le2EIz = Le/(2*E*Iz);
00170 double Le2EIy = Le/(2*E*Iy);
00171
00172 double b1, b2;
00173 b1 = x1*oneOverL;
00174 b2 = x2*oneOverL;
00175 v0[2] += Le2EIz*(b1*Mz1+b2*Mz2);
00176 v0[4] += Le2EIy*(b1*My1+b2*My2);
00177
00178 b1 -= 1.0;
00179 b2 -= 1.0;
00180 v0[1] += Le2EIz*(b1*Mz1+b2*Mz2);
00181 v0[3] += Le2EIy*(b1*My1+b2*My2);
00182 }
00183
00184 else if (type == LOAD_TAG_Beam3dPointLoad) {
00185 double Py = data(0)*loadFactor;
00186 double Pz = data(1)*loadFactor;
00187 double N = data(2)*loadFactor;
00188 double aOverL = data(3);
00189 double a = aOverL*L;
00190
00191 double Vy2 = Py*aOverL;
00192 double Vy1 = Py-Vy2;
00193
00194 double Vz2 = Pz*aOverL;
00195 double Vz1 = Pz-Vz2;
00196
00197
00198 double M1, M2, M3;
00199 double b1, b2, b3;
00200
00201
00202 if (a < lpI) {
00203 M1 = (lpI-L)*Vy2;
00204 M2 = -lpJ*Vy2;
00205
00206 double Le_6EI;
00207 Le_6EI = Le/(6*E*Iz);
00208
00209 b1 = lpI*oneOverL;
00210 b2 = 1.0-lpJ*oneOverL;
00211 v0[2] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00212
00213 b1 -= 1.0;
00214 b2 -= 1.0;
00215 v0[1] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00216
00217 M1 = (L-lpI)*Vz2;
00218 M2 = lpJ*Vz2;
00219
00220 Le_6EI = Le/(6*E*Iy);
00221
00222 b1 = lpI*oneOverL;
00223 b2 = 1.0-lpJ*oneOverL;
00224 v0[4] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00225
00226 b1 -= 1.0;
00227 b2 -= 1.0;
00228 v0[3] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00229
00230
00231
00232 }
00233
00234 else if (a > L-lpJ) {
00235 M1 = -lpI*Vy1;
00236 M2 = (lpJ-L)*Vy1;
00237
00238 double Le_6EI;
00239 Le_6EI = Le/(6*E*Iz);
00240
00241 b1 = lpI*oneOverL;
00242 b2 = 1.0-lpJ*oneOverL;
00243 v0[2] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00244
00245 b1 -= 1.0;
00246 b2 -= 1.0;
00247 v0[1] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00248
00249 M1 = lpI*Vz1;
00250 M2 = (L-lpJ)*Vz1;
00251
00252 Le_6EI = Le/(6*E*Iy);
00253
00254 b1 = lpI*oneOverL;
00255 b2 = 1.0-lpJ*oneOverL;
00256 v0[4] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00257
00258 b1 -= 1.0;
00259 b2 -= 1.0;
00260 v0[3] += Le_6EI*(M1*(2*b1+b2)+M2*(b1+2*b2));
00261
00262 v0[0] += N*Le/(E*A);
00263 }
00264
00265 else {
00266 M1 = -lpI*Vy1;
00267 M2 = -lpJ*Vy2;
00268 M3 = -a*Vy1;
00269
00270 double L1_6EI;
00271 double L2_6EI;
00272
00273 L1_6EI = (a-lpI)/(6*E*Iz);
00274 L2_6EI = (Le-a+lpI)/(6*E*Iz);
00275
00276 b1 = lpI*oneOverL;
00277 b2 = 1.0-lpJ*oneOverL;
00278 b3 = a*oneOverL;
00279 v0[2] += L1_6EI*(M1*(2*b1+b3)+M3*(b1+2*b3));
00280 v0[2] += L2_6EI*(M2*(2*b2+b3)+M3*(b2+2*b3));
00281
00282 b1 -= 1.0;
00283 b2 -= 1.0;
00284 b3 -= 1.0;
00285 v0[1] += L1_6EI*(M1*(2*b1+b3)+M3*(b1+2*b3));
00286 v0[1] += L2_6EI*(M2*(2*b2+b3)+M3*(b2+2*b3));
00287
00288 M1 = lpI*Vz1;
00289 M2 = lpJ*Vz2;
00290 M3 = a*Vz1;
00291
00292 L1_6EI = (a-lpI)/(6*E*Iy);
00293 L2_6EI = (Le-a+lpI)/(6*E*Iy);
00294
00295 b1 = lpI*oneOverL;
00296 b2 = 1.0-lpJ*oneOverL;
00297 b3 = a*oneOverL;
00298 v0[4] += L1_6EI*(M1*(2*b1+b3)+M3*(b1+2*b3));
00299 v0[4] += L2_6EI*(M2*(2*b2+b3)+M3*(b2+2*b3));
00300
00301 b1 -= 1.0;
00302 b2 -= 1.0;
00303 b3 -= 1.0;
00304 v0[3] += L1_6EI*(M1*(2*b1+b3)+M3*(b1+2*b3));
00305 v0[3] += L2_6EI*(M2*(2*b2+b3)+M3*(b2+2*b3));
00306
00307 v0[0] += N*(a-lpI)/(E*A);
00308 }
00309 }
00310
00311 return;
00312 }
00313
00314 double
00315 HingeMidpointBeamIntegration3d::getTangentDriftI(double L, double LI,
00316 double q2, double q3, bool yAxis)
00317 {
00318 double oneOverL = 1.0/L;
00319
00320 double betaI = lpI*oneOverL;
00321
00322 double qq2 = (1-betaI)*q2 - betaI*q3;
00323
00324 if (LI < lpI)
00325 return 0.0;
00326 else {
00327 double EI = yAxis ? E*Iy : E*Iz;
00328 return (LI-lpI)/3*(LI-lpI)*qq2/(EI);
00329 }
00330 }
00331
00332 double
00333 HingeMidpointBeamIntegration3d::getTangentDriftJ(double L, double LI,
00334 double q2, double q3, bool yAxis)
00335 {
00336 double oneOverL = 1.0/L;
00337
00338 double betaJ = lpJ*oneOverL;
00339
00340 double qq3 = (1-betaJ)*q3 - betaJ*q2;
00341
00342 if (LI > L-lpJ)
00343 return 0.0;
00344 else {
00345 double EI = yAxis ? E*Iy : E*Iz;
00346 return (L-LI-lpJ)/3*(L-LI-lpJ)*qq3/EI;
00347 }
00348 }
00349
00350 BeamIntegration*
00351 HingeMidpointBeamIntegration3d::getCopy(void)
00352 {
00353 return new HingeMidpointBeamIntegration3d(E, A, Iz, Iy, G, J, lpI, lpJ);
00354 }
00355
00356 int
00357 HingeMidpointBeamIntegration3d::sendSelf(int cTag, Channel &theChannel)
00358 {
00359 static Vector data(8);
00360
00361 data(0) = E;
00362 data(1) = A;
00363 data(2) = Iz;
00364 data(3) = Iy;
00365 data(4) = G;
00366 data(5) = J;
00367 data(6) = lpI;
00368 data(7) = lpJ;
00369
00370 int dbTag = this->getDbTag();
00371
00372 if (theChannel.sendVector(dbTag, cTag, data) < 0) {
00373 opserr << "HingeMidpointBeamIntegration3d::sendSelf() - failed to send Vector data\n";
00374 return -1;
00375 }
00376
00377 return 0;
00378 }
00379
00380 int
00381 HingeMidpointBeamIntegration3d::recvSelf(int cTag, Channel &theChannel,
00382 FEM_ObjectBroker &theBroker)
00383 {
00384 static Vector data(8);
00385
00386 int dbTag = this->getDbTag();
00387
00388 if (theChannel.recvVector(dbTag, cTag, data) < 0) {
00389 opserr << "HingeMidpointBeamIntegration3d::recvSelf() - failed to receive Vector data\n";
00390 return -1;
00391 }
00392
00393 E = data(0);
00394 A = data(1);
00395 Iz = data(2);
00396 Iy = data(3);
00397 G = data(4);
00398 J = data(5);
00399 lpI = data(6);
00400 lpJ = data(7);
00401
00402 return 0;
00403 }
00404
00405 int
00406 HingeMidpointBeamIntegration3d::setParameter(const char **argv,
00407 int argc, Information &info)
00408 {
00409 if (strcmp(argv[0],"E") == 0) {
00410 info.theType = DoubleType;
00411 return 1;
00412 }
00413 else if (strcmp(argv[0],"A") == 0) {
00414 info.theType = DoubleType;
00415 return 2;
00416 }
00417 else if (strcmp(argv[0],"Iz") == 0) {
00418 info.theType = DoubleType;
00419 return 3;
00420 }
00421 else if (strcmp(argv[0],"Iy") == 0) {
00422 info.theType = DoubleType;
00423 return 4;
00424 }
00425 else if (strcmp(argv[0],"G") == 0) {
00426 info.theType = DoubleType;
00427 return 5;
00428 }
00429 else if (strcmp(argv[0],"J") == 0) {
00430 info.theType = DoubleType;
00431 return 6;
00432 }
00433 else if (strcmp(argv[0],"lpI") == 0) {
00434 info.theType = DoubleType;
00435 return 7;
00436 }
00437 else if (strcmp(argv[0],"lpJ") == 0) {
00438 info.theType = DoubleType;
00439 return 8;
00440 }
00441 else
00442 return -1;
00443 }
00444
00445 int
00446 HingeMidpointBeamIntegration3d::updateParameter(int parameterID,
00447 Information &info)
00448 {
00449 switch (parameterID) {
00450 case 1:
00451 E = info.theDouble;
00452 return 0;
00453 case 2:
00454 A = info.theDouble;
00455 return 0;
00456 case 3:
00457 Iz = info.theDouble;
00458 return 0;
00459 case 4:
00460 Iy = info.theDouble;
00461 return 0;
00462 case 5:
00463 G = info.theDouble;
00464 return 0;
00465 case 6:
00466 J = info.theDouble;
00467 return 0;
00468 case 7:
00469 lpI = info.theDouble;
00470 return 0;
00471 case 8:
00472 lpJ = info.theDouble;
00473 return 0;
00474 default:
00475 return -1;
00476 }
00477 }
00478
00479 int
00480 HingeMidpointBeamIntegration3d::activateParameter(int parameterID)
00481 {
00482
00483 return 0;
00484 }
00485
00486 void
00487 HingeMidpointBeamIntegration3d::Print(OPS_Stream &s, int flag)
00488 {
00489 s << "HingeMidpoint3d" << endln;
00490 s << " E = " << E;
00491 s << " A = " << A;
00492 s << " Iz = " << Iz;
00493 s << " Iy = " << Iy;
00494 s << " G = " << G;
00495 s << " J = " << J << endln;
00496 s << " lpI = " << lpI;
00497 s << " lpJ = " << lpJ << endln;
00498
00499 return;
00500 }