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 <WideFlangeSectionIntegration.h>
00026 #include <Matrix.h>
00027 #include <Vector.h>
00028 #include <Channel.h>
00029 #include <FEM_ObjectBroker.h>
00030 #include <Information.h>
00031 #include <Parameter.h>
00032
00033 WideFlangeSectionIntegration::WideFlangeSectionIntegration(double D,
00034 double TW,
00035 double BF,
00036 double TF,
00037 int NFDW,
00038 int NFTF):
00039 SectionIntegration(SECTION_INTEGRATION_TAG_WideFlange),
00040 d(D), tw(TW), bf(BF), tf(TF), Nfdw(NFDW), Nftf(NFTF), parameterID(0)
00041 {
00042
00043 }
00044
00045 WideFlangeSectionIntegration::WideFlangeSectionIntegration():
00046 SectionIntegration(SECTION_INTEGRATION_TAG_WideFlange),
00047 d(0.0), tw(0.0), bf(0.0), tf(0.0), Nfdw(0), Nftf(0), parameterID(0)
00048 {
00049
00050 }
00051
00052 WideFlangeSectionIntegration::~WideFlangeSectionIntegration()
00053 {
00054
00055 }
00056
00057 int
00058 WideFlangeSectionIntegration::getNumFibers(void)
00059 {
00060 return Nfdw + 2*Nftf;
00061 }
00062
00063 int
00064 WideFlangeSectionIntegration::arrangeFibers(UniaxialMaterial **theMaterials,
00065 UniaxialMaterial *theSteel)
00066 {
00067 int numFibers = this->getNumFibers();
00068
00069 for (int i = 0; i < numFibers; i++)
00070 theMaterials[i] = theSteel;
00071
00072 return 0;
00073 }
00074
00075 void
00076 WideFlangeSectionIntegration::getFiberLocations(int nFibers, double *xi)
00077 {
00078 double dw = d-2*tf;
00079
00080 int loc;
00081
00082 double yIncr = tf/Nftf;
00083 double yStart = 0.5 * (d-yIncr);
00084
00085 for (loc = 0; loc < Nftf; loc++) {
00086 xi[loc] = yStart - yIncr*loc;
00087 xi[nFibers-loc-1] = -xi[loc];
00088 }
00089
00090 yIncr = dw/Nfdw;
00091 yStart = 0.5 * (dw-yIncr);
00092
00093 for (int count = 0; loc < nFibers-Nftf; loc++, count++) {
00094 xi[loc] = yStart - yIncr*count;
00095 }
00096
00097 return;
00098 }
00099
00100 void
00101 WideFlangeSectionIntegration::getFiberWeights(int nFibers, double *wt)
00102 {
00103 double dw = d-2*tf;
00104
00105 double a_f = bf*tf/Nftf;
00106 double a_w = dw*tw/Nfdw;
00107
00108 int loc = 0;
00109
00110 for (loc = 0; loc < Nftf; loc++) {
00111 wt[loc] = a_f;
00112 wt[nFibers-loc-1] = a_f;
00113 }
00114
00115 for ( ; loc < nFibers-Nftf; loc++) {
00116 wt[loc] = a_w;
00117 }
00118
00119 return;
00120 }
00121
00122 SectionIntegration*
00123 WideFlangeSectionIntegration::getCopy(void)
00124 {
00125 return new WideFlangeSectionIntegration(d, tw, bf, tf, Nfdw, Nftf);
00126 }
00127
00128 int
00129 WideFlangeSectionIntegration::setParameter(const char **argv, int argc,
00130 Parameter ¶m)
00131 {
00132 if (argc < 1)
00133 return -1;
00134
00135 if (strcmp(argv[0],"d") == 0 || strcmp(argv[0],"db") == 0)
00136 return param.addObject(1, this);
00137
00138 if (strcmp(argv[0],"tw") == 0)
00139 return param.addObject(2, this);
00140
00141 if (strcmp(argv[0],"bf") == 0)
00142 return param.addObject(3, this);
00143
00144 if (strcmp(argv[0],"tf") == 0)
00145 return param.addObject(4, this);
00146
00147 return -1;
00148 }
00149
00150 int
00151 WideFlangeSectionIntegration::updateParameter(int parameterID,
00152 Information &info)
00153 {
00154 switch (parameterID) {
00155 case 1:
00156 d = info.theDouble;
00157 return 0;
00158 case 2:
00159 tw = info.theDouble;
00160 return 0;
00161 case 3:
00162 bf = info.theDouble;
00163 return 0;
00164 case 4:
00165 tf = info.theDouble;
00166 return 0;
00167 default:
00168 return -1;
00169 }
00170 }
00171
00172 int
00173 WideFlangeSectionIntegration::activateParameter(int paramID)
00174 {
00175 parameterID = paramID;
00176
00177 return 0;
00178 }
00179
00180 void
00181 WideFlangeSectionIntegration::getLocationsDeriv(int nFibers, double *dptsdh)
00182 {
00183 double dw = d-2*tf;
00184
00185 double dddh = 0.0;
00186 double ddwdh = 0.0;
00187
00188
00189 double dtfdh = 0.0;
00190
00191 if (parameterID == 1) {
00192 dddh = 1.0;
00193 ddwdh = 1.0;
00194 }
00195
00196
00197
00198
00199 if (parameterID == 4) {
00200 dtfdh = 1.0;
00201 ddwdh = -2.0;
00202 }
00203
00204
00205
00206 double dyIncrdh = dtfdh/Nftf;
00207 double dyStartdh = 0.5 * (dddh-dyIncrdh);
00208
00209 int loc;
00210
00211 for (loc = 0; loc < Nftf; loc++) {
00212
00213
00214 dptsdh[loc] = dyStartdh - dyIncrdh*loc;
00215 dptsdh[nFibers-loc-1] = -dptsdh[loc];
00216 }
00217
00218
00219
00220 dyIncrdh = ddwdh/Nfdw;
00221 dyStartdh = 0.5 * (ddwdh-dyIncrdh);
00222
00223 for (int count = 0; loc < nFibers-Nftf; loc++, count++) {
00224
00225 dptsdh[loc] = dyStartdh - dyIncrdh*count;
00226 }
00227
00228
00229
00230
00231
00232 return;
00233 }
00234
00235 void
00236 WideFlangeSectionIntegration::getWeightsDeriv(int nFibers, double *dwtsdh)
00237 {
00238 double dw = d-2*tf;
00239
00240 double ddwdh = 0.0;
00241 double dtwdh = 0.0;
00242 double dbfdh = 0.0;
00243 double dtfdh = 0.0;
00244
00245 if (parameterID == 1)
00246 ddwdh = 1.0;
00247 if (parameterID == 2)
00248 dtwdh = 1.0;
00249 if (parameterID == 3)
00250 dbfdh = 1.0;
00251 if (parameterID == 4) {
00252 dtfdh = 1.0;
00253 ddwdh = -2.0;
00254 }
00255
00256 double dAfdh = (bf*dtfdh + dbfdh*tf) / Nftf;
00257 double dAwdh = (dw*dtwdh + ddwdh*tw) / Nfdw;
00258
00259 int loc = 0;
00260
00261 for (loc = 0; loc < Nftf; loc++) {
00262 dwtsdh[loc] = dAfdh;
00263 dwtsdh[nFibers-loc-1] = dAfdh;
00264 }
00265
00266 for ( ; loc < nFibers-Nftf; loc++)
00267 dwtsdh[loc] = dAwdh;
00268
00269
00270
00271
00272
00273 return;
00274 }
00275
00276 void
00277 WideFlangeSectionIntegration::Print(OPS_Stream &s, int flag)
00278 {
00279 s << "WideFlange" << endln;
00280 s << " d = " << d;
00281 s << " tw = " << tw;
00282 s << " bf = " << bf;
00283 s << " tf = " << tf << endln;
00284 s << " Nfdw = " << Nfdw;
00285 s << " Nftf = " << Nftf << endln;
00286
00287 return;
00288 }
00289
00290 int
00291 WideFlangeSectionIntegration::sendSelf(int cTag, Channel &theChannel)
00292 {
00293 static Vector data(6);
00294
00295 data(0) = d;
00296 data(1) = tw;
00297 data(2) = bf;
00298 data(3) = tf;
00299 data(4) = Nfdw;
00300 data(5) = Nftf;
00301
00302 int dbTag = this->getDbTag();
00303
00304 if (theChannel.sendVector(dbTag, cTag, data) < 0) {
00305 opserr << "WideFlangeSectionIntegration::sendSelf() - failed to send Vector data\n";
00306 return -1;
00307 }
00308
00309 return 0;
00310 }
00311
00312 int
00313 WideFlangeSectionIntegration::recvSelf(int cTag, Channel &theChannel,
00314 FEM_ObjectBroker &theBroker)
00315 {
00316 static Vector data(6);
00317
00318 int dbTag = this->getDbTag();
00319
00320 if (theChannel.recvVector(dbTag, cTag, data) < 0) {
00321 opserr << "WideFlangeSectionIntegration::recvSelf() - failed to receive Vector data\n";
00322 return -1;
00323 }
00324
00325 d = data(0);
00326 tw = data(1);
00327 bf = data(2);
00328 tf = data(3);
00329 Nfdw = (int)data(4);
00330 Nftf = (int)data(5);
00331
00332 return 0;
00333 }