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 <UserDefinedHingeIntegration3d.h>
00026
00027 #include <Matrix.h>
00028 #include <Vector.h>
00029 #include <Channel.h>
00030 #include <FEM_ObjectBroker.h>
00031 #include <Information.h>
00032
00033 UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d(int npL,
00034 const Vector &ptL,
00035 const Vector &wtL,
00036 int npR,
00037 const Vector &ptR,
00038 const Vector &wtR,
00039 double ee,
00040 double aa,
00041 double iiz,
00042 double iiy,
00043 double gg,
00044 double jj):
00045 BeamIntegration(BEAM_INTEGRATION_TAG_UserHinge3d),
00046 ptsL(npL), wtsL(npL), ptsR(npR), wtsR(npR),
00047 E(ee), A(aa), Iz(iiz), Iy(iiy), G(gg), J(jj)
00048 {
00049 int i;
00050 for (i = 0; i < npL; i++) {
00051 if (ptL(i) < 0.0 || ptL(i) > 1.0)
00052 opserr << "UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d -- point lies outside [0,1]" << endln;
00053 if (wtL(i) < 0.0 || wtL(i) > 1.0)
00054 opserr << "UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d -- weight lies outside [0,1]" << endln;
00055 ptsL(i) = ptL(i);
00056 wtsL(i) = wtL(i);
00057 }
00058
00059 for (i = 0; i < npR; i++) {
00060 if (ptR(i) < 0.0 || ptR(i) > 1.0)
00061 opserr << "UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d -- point lies outside [0,1]" << endln;
00062 if (wtR(i) < 0.0 || wtR(i) > 1.0)
00063 opserr << "UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d -- weight lies outside [0,1]" << endln;
00064 ptsR(i) = ptR(i);
00065 wtsR(i) = wtR(i);
00066 }
00067 }
00068
00069 UserDefinedHingeIntegration3d::UserDefinedHingeIntegration3d():
00070 BeamIntegration(BEAM_INTEGRATION_TAG_UserHinge3d),
00071 E(0.0), A(0.0), Iz(0.0), Iy(0.0), G(0.0), J(0.0)
00072 {
00073
00074 }
00075
00076 UserDefinedHingeIntegration3d::~UserDefinedHingeIntegration3d()
00077 {
00078
00079 }
00080
00081 void
00082 UserDefinedHingeIntegration3d::getSectionLocations(int numSections,
00083 double L, double *xi)
00084 {
00085 int npL = ptsL.Size();
00086 int npR = ptsR.Size();
00087
00088 int i, j;
00089 for (i = 0; i < npL; i++)
00090 xi[i] = ptsL(i);
00091 for (j = 0; j < npR; j++, i++)
00092 xi[i] = ptsR(j);
00093 for ( ; i < numSections; i++)
00094 xi[i] = 0.0;
00095 }
00096
00097 void
00098 UserDefinedHingeIntegration3d::getSectionWeights(int numSections,
00099 double L, double *wt)
00100 {
00101 int npL = wtsL.Size();
00102 int npR = wtsR.Size();
00103
00104 int i, j;
00105 for (i = 0; i < npL; i++)
00106 wt[i] = wtsL(i);
00107 for (j = 0; j < npR; j++, i++)
00108 wt[i] = wtsR(j);
00109 for ( ; i < numSections; i++)
00110 wt[i] = 1.0;
00111 }
00112
00113 int
00114 UserDefinedHingeIntegration3d::addElasticFlexibility(double L, Matrix &fElastic)
00115 {
00116 int npL = wtsL.Size();
00117 int npR = wtsR.Size();
00118
00119 double betaI = 0.0;
00120 double betaJ = 0.0;
00121
00122 int i;
00123 for (i = 0; i < npL; i++)
00124 betaI += wtsL(i);
00125 for (i = 0; i < npR; i++)
00126 betaJ += wtsR(i);
00127
00128
00129 double Le = L*(1.0-betaI-betaJ);
00130 double Lover3EI = Le/(3*E*Iz);
00131 double Lover6EI = 0.5*Lover3EI;
00132
00133
00134 static Matrix fe(2,2);
00135 fe(0,0) = fe(1,1) = Lover3EI;
00136 fe(0,1) = fe(1,0) = -Lover6EI;
00137
00138
00139 static Matrix B(2,2);
00140 B(0,0) = 1.0 - betaI;
00141 B(1,1) = 1.0 - betaJ;
00142 B(0,1) = -betaI;
00143 B(1,0) = -betaJ;
00144
00145
00146
00147 static Matrix ftmp(2,2);
00148 ftmp.addMatrixTripleProduct(0.0, B, fe, 1.0);
00149
00150 fElastic(1,1) += ftmp(0,0);
00151 fElastic(1,2) += ftmp(0,1);
00152 fElastic(2,1) += ftmp(1,0);
00153 fElastic(2,2) += ftmp(1,1);
00154
00155 Lover3EI = Le/(3*E*Iy);
00156 Lover6EI = 0.5*Lover3EI;
00157 fe(0,0) = fe(1,1) = Lover3EI;
00158 fe(0,1) = fe(1,0) = -Lover6EI;
00159 ftmp.addMatrixTripleProduct(0.0, B, fe, 1.0);
00160 fElastic(3,3) += ftmp(0,0);
00161 fElastic(3,4) += ftmp(0,1);
00162 fElastic(4,3) += ftmp(1,0);
00163 fElastic(4,4) += ftmp(1,1);
00164
00165 fElastic(0,0) += Le/(E*A);
00166 fElastic(5,5) += Le/(G*J);
00167
00168 return -1;
00169 }
00170
00171 void
00172 UserDefinedHingeIntegration3d::addElasticDeformations(ElementalLoad *theLoad,
00173 double loadFactor,
00174 double L, double *v0)
00175 {
00176 return;
00177 }
00178
00179 BeamIntegration*
00180 UserDefinedHingeIntegration3d::getCopy(void)
00181 {
00182 int npL = ptsL.Size();
00183 int npR = ptsR.Size();
00184
00185 return new UserDefinedHingeIntegration3d(npL, ptsL, wtsL,
00186 npR, ptsR, wtsR,
00187 E, A, Iz, Iy, G, J);
00188 }
00189
00190 int
00191 UserDefinedHingeIntegration3d::sendSelf(int cTag, Channel &theChannel)
00192 {
00193 return -1;
00194 }
00195
00196 int
00197 UserDefinedHingeIntegration3d::recvSelf(int cTag, Channel &theChannel,
00198 FEM_ObjectBroker &theBroker)
00199 {
00200 return -1;
00201 }
00202
00203 int
00204 UserDefinedHingeIntegration3d::setParameter(const char **argv,
00205 int argc, Information &info)
00206 {
00207 if (strcmp(argv[0],"E") == 0) {
00208 info.theType = DoubleType;
00209 return 1;
00210 }
00211 else if (strcmp(argv[0],"A") == 0) {
00212 info.theType = DoubleType;
00213 return 2;
00214 }
00215 else if (strcmp(argv[0],"Iz") == 0) {
00216 info.theType = DoubleType;
00217 return 3;
00218 }
00219 else if (strcmp(argv[0],"Iy") == 0) {
00220 info.theType = DoubleType;
00221 return 4;
00222 }
00223 else if (strcmp(argv[0],"G") == 0) {
00224 info.theType = DoubleType;
00225 return 5;
00226 }
00227 else if (strcmp(argv[0],"J") == 0) {
00228 info.theType = DoubleType;
00229 return 6;
00230 }
00231 else
00232 return -1;
00233 }
00234
00235 int
00236 UserDefinedHingeIntegration3d::updateParameter(int parameterID,
00237 Information &info)
00238 {
00239 switch (parameterID) {
00240 case 1:
00241 E = info.theDouble;
00242 return 0;
00243 case 2:
00244 A = info.theDouble;
00245 return 0;
00246 case 3:
00247 Iz = info.theDouble;
00248 return 0;
00249 case 4:
00250 Iy = info.theDouble;
00251 return 0;
00252 case 5:
00253 G = info.theDouble;
00254 return 0;
00255 case 6:
00256 J = info.theDouble;
00257 return 0;
00258 default:
00259 return -1;
00260 }
00261 }
00262
00263 int
00264 UserDefinedHingeIntegration3d::activateParameter(int parameterID)
00265 {
00266
00267 return 0;
00268 }
00269
00270 void
00271 UserDefinedHingeIntegration3d::Print(OPS_Stream &s, int flag)
00272 {
00273 s << "UserHinge3d" << endln;
00274 s << " E = " << E;
00275 s << " A = " << A;
00276 s << " Iz = " << Iz;
00277 s << " Iy = " << Iy;
00278 s << " G = " << G;
00279 s << " J = " << J << endln;
00280 s << " Points left hinge: " << ptsL;
00281 s << " Weights left hinge: " << wtsL;
00282 s << " Points right hinge: " << ptsR;
00283 s << " Weights right hinge: " << wtsR;
00284 }