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
00026
00027
00028
00029
00030
00031 #include <MembranePlateFiberSection.h>
00032 #include <Channel.h>
00033 #include <FEM_ObjectBroker.h>
00034
00035
00036
00037 const double MembranePlateFiberSection::root56 = sqrt(5.0/6.0) ;
00038
00039
00040 Vector MembranePlateFiberSection::stressResultant(8) ;
00041 Matrix MembranePlateFiberSection::tangent(8,8) ;
00042 ID MembranePlateFiberSection::array(8) ;
00043
00044
00045 const double MembranePlateFiberSection::sg[] = { -1,
00046 -0.65465367,
00047 0,
00048 0.65465367,
00049 1 } ;
00050
00051 const double MembranePlateFiberSection::wg[] = { 0.1,
00052 0.5444444444,
00053 0.7111111111,
00054 0.5444444444,
00055 0.1 };
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 MembranePlateFiberSection::MembranePlateFiberSection( ) :
00076 SectionForceDeformation( 0, SEC_TAG_MembranePlateFiberSection ),
00077 strainResultant(8)
00078 {
00079 for ( int i = 0; i < 5; i++ )
00080 theFibers[i] = 0 ;
00081 }
00082
00083
00084
00085
00086 MembranePlateFiberSection::MembranePlateFiberSection(
00087 int tag,
00088 double thickness,
00089 NDMaterial &Afiber ) :
00090 SectionForceDeformation( tag, SEC_TAG_MembranePlateFiberSection ),
00091 strainResultant(8)
00092 {
00093 this->h = thickness ;
00094
00095 int i ;
00096 for ( i = 0; i < 5; i++ )
00097 theFibers[i] = Afiber.getCopy( "PlateFiber" ) ;
00098
00099 }
00100
00101
00102
00103
00104 MembranePlateFiberSection::~MembranePlateFiberSection( )
00105 {
00106 int i ;
00107 for ( i = 0; i < 5; i++ )
00108 delete theFibers[i] ;
00109 }
00110
00111
00112
00113
00114 SectionForceDeformation *MembranePlateFiberSection::getCopy( )
00115 {
00116 MembranePlateFiberSection *clone ;
00117
00118 clone = new MembranePlateFiberSection( this->getTag(),
00119 this->h,
00120 *theFibers[0] ) ;
00121 return clone ;
00122 }
00123
00124
00125
00126
00127 int MembranePlateFiberSection::getOrder( ) const
00128 {
00129 return 8 ;
00130 }
00131
00132
00133
00134 const ID& MembranePlateFiberSection::getType( )
00135 {
00136 return array ;
00137 }
00138
00139
00140
00141
00142 int MembranePlateFiberSection::commitState( )
00143 {
00144 int success = 0 ;
00145
00146 int i ;
00147 for ( i = 0; i < 5; i++ )
00148 success += theFibers[i]->commitState( ) ;
00149
00150 return success ;
00151 }
00152
00153
00154
00155
00156 int MembranePlateFiberSection::revertToLastCommit( )
00157 {
00158 int success = 0 ;
00159
00160 int i ;
00161 for ( i = 0; i < 5; i++ )
00162 success += theFibers[i]->revertToLastCommit( ) ;
00163
00164 return success ;
00165 }
00166
00167
00168 int MembranePlateFiberSection::revertToStart( )
00169 {
00170 int success = 0 ;
00171
00172 int i ;
00173 for ( i = 0; i < 5; i++ )
00174 success += theFibers[i]->revertToStart( ) ;
00175
00176 return success ;
00177 }
00178
00179
00180
00181 double
00182 MembranePlateFiberSection::getRho( )
00183 {
00184
00185 double weight ;
00186
00187 double rhoH = 0.0 ;
00188
00189 for ( int i = 0; i < 5; i++ ) {
00190
00191 weight = ( 0.5*h ) * wg[i] ;
00192
00193 rhoH += ( theFibers[i]->getRho() ) * weight ;
00194
00195 }
00196
00197 return rhoH ;
00198
00199 }
00200
00201
00202
00203 int MembranePlateFiberSection ::
00204 setTrialSectionDeformation( const Vector &strainResultant_from_element)
00205 {
00206 this->strainResultant = strainResultant_from_element ;
00207
00208 static Vector strain(5) ;
00209
00210 int success = 0 ;
00211
00212 int i ;
00213
00214 double z ;
00215
00216 for ( i = 0; i < 5; i++ ) {
00217
00218 z = ( 0.5*h ) * sg[i] ;
00219
00220 strain(0) = strainResultant(0) - z*strainResultant(3) ;
00221
00222 strain(1) = strainResultant(1) - z*strainResultant(4) ;
00223
00224 strain(2) = strainResultant(2) - z*strainResultant(5) ;
00225
00226 strain(3) = root56*strainResultant(6) ;
00227
00228 strain(4) = root56*strainResultant(7) ;
00229
00230 success += theFibers[i]->setTrialStrain( strain ) ;
00231
00232 }
00233
00234 return success ;
00235 }
00236
00237
00238
00239 const Vector& MembranePlateFiberSection::getSectionDeformation( )
00240 {
00241 return this->strainResultant ;
00242 }
00243
00244
00245
00246 const Vector& MembranePlateFiberSection::getStressResultant( )
00247 {
00248
00249 static Vector stress(5) ;
00250
00251 int i ;
00252
00253 double z, weight ;
00254
00255 stressResultant.Zero( ) ;
00256
00257 for ( i = 0; i < 5; i++ ) {
00258
00259 z = ( 0.5*h ) * sg[i] ;
00260
00261 weight = ( 0.5*h ) * wg[i] ;
00262
00263 stress = theFibers[i]->getStress( ) ;
00264
00265
00266 stressResultant(0) += stress(0)*weight ;
00267
00268 stressResultant(1) += stress(1)*weight ;
00269
00270 stressResultant(2) += stress(2)*weight ;
00271
00272
00273 stressResultant(3) += ( z*stress(0) ) * weight ;
00274
00275 stressResultant(4) += ( z*stress(1) ) * weight ;
00276
00277 stressResultant(5) += ( z*stress(2) ) * weight ;
00278
00279
00280 stressResultant(6) += stress(3)*weight ;
00281
00282 stressResultant(7) += stress(4)*weight ;
00283
00284 }
00285
00286
00287 stressResultant(6) *= root56 ;
00288 stressResultant(7) *= root56 ;
00289
00290 return this->stressResultant ;
00291 }
00292
00293
00294
00295 const Matrix& MembranePlateFiberSection::getSectionTangent( )
00296 {
00297 static Matrix dd(5,5) ;
00298
00299 static Matrix Aeps(5,8) ;
00300
00301 static Matrix Asig(8,5) ;
00302
00303 int i ;
00304
00305 double z, weight ;
00306
00307 tangent.Zero( ) ;
00308
00309 for ( i = 0; i < 5; i++ ) {
00310
00311 z = ( 0.5*h ) * sg[i] ;
00312
00313 weight = (0.5*h) * wg[i] ;
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350 dd = theFibers[i]->getTangent( ) ;
00351
00352 dd *= weight ;
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 tangent(0,0) += dd(0,0) ;
00369 tangent(0,1) += dd(0,1) ;
00370 tangent(0,2) += dd(0,2) ;
00371 tangent(0,3) += -z*dd(0,0) ;
00372 tangent(0,3) += -z*dd(0,1) ;
00373 tangent(0,5) += -z*dd(0,2) ;
00374 tangent(0,6) += root56*dd(0,3) ;
00375 tangent(0,7) += root56*dd(0,4) ;
00376
00377
00378
00379 tangent(1,0) += dd(1,0) ;
00380 tangent(1,1) += dd(1,1) ;
00381 tangent(1,2) += dd(1,2) ;
00382 tangent(1,3) += -z*dd(1,0) ;
00383 tangent(1,4) += -z*dd(1,1) ;
00384 tangent(1,5) += -z*dd(1,2) ;
00385 tangent(1,6) += root56*dd(1,3) ;
00386 tangent(1,7) += root56*dd(1,4) ;
00387
00388
00389
00390 tangent(2,0) += dd(2,0) ;
00391 tangent(2,1) += dd(2,1) ;
00392 tangent(2,2) += dd(2,2) ;
00393 tangent(2,3) += -z*dd(2,0) ;
00394 tangent(2,4) += -z*dd(2,1) ;
00395 tangent(2,5) += -z*dd(2,2) ;
00396 tangent(2,6) += root56*dd(2,3) ;
00397 tangent(2,7) += root56*dd(2,4) ;
00398
00399
00400
00401 tangent(3,0) += z*dd(0,0) ;
00402 tangent(3,1) += z*dd(0,1) ;
00403 tangent(3,2) += z*dd(0,2) ;
00404 tangent(3,3) += -z*z*dd(0,0) ;
00405 tangent(3,4) += -z*z*dd(0,1) ;
00406 tangent(3,5) += -z*z*dd(0,2) ;
00407 tangent(3,6) += z*root56*dd(0,3) ;
00408 tangent(3,7) += z*root56*dd(0,4) ;
00409
00410
00411
00412 tangent(4,0) += z*dd(1,0) ;
00413 tangent(4,1) += z*dd(1,1) ;
00414 tangent(4,2) += z*dd(1,2) ;
00415 tangent(4,3) += -z*z*dd(1,0) ;
00416 tangent(4,4) += -z*z*dd(1,1) ;
00417 tangent(4,5) += -z*z*dd(1,2) ;
00418 tangent(4,6) += z*root56*dd(1,3) ;
00419 tangent(4,7) += z*root56*dd(1,4) ;
00420
00421
00422
00423 tangent(5,0) += z*dd(2,0) ;
00424 tangent(5,1) += z*dd(2,1) ;
00425 tangent(5,2) += z*dd(2,2) ;
00426 tangent(5,3) += -z*z*dd(2,0) ;
00427 tangent(5,4) += -z*z*dd(2,1) ;
00428 tangent(5,5) += -z*z*dd(2,2) ;
00429 tangent(5,6) += z*root56*dd(2,3) ;
00430 tangent(5,7) += z*root56*dd(2,4) ;
00431
00432
00433
00434 tangent(6,0) += root56*dd(3,0) ;
00435 tangent(6,1) += root56*dd(3,1) ;
00436 tangent(6,2) += root56*dd(3,2) ;
00437 tangent(6,3) += -root56*z*dd(3,0) ;
00438 tangent(6,4) += -root56*z*dd(3,1) ;
00439 tangent(6,5) += -root56*z*dd(3,2) ;
00440 tangent(6,6) += root56*root56*dd(3,3) ;
00441 tangent(6,7) += root56*root56*dd(3,4) ;
00442
00443
00444
00445 tangent(7,0) += root56*dd(4,0) ;
00446 tangent(7,1) += root56*dd(4,1) ;
00447 tangent(7,2) += root56*dd(4,2) ;
00448 tangent(7,3) += -root56*z*dd(4,0) ;
00449 tangent(7,4) += -root56*z*dd(4,1) ;
00450 tangent(7,5) += -root56*z*dd(4,2) ;
00451 tangent(7,6) += root56*root56*dd(4,3) ;
00452 tangent(7,7) += root56*root56*dd(4,4) ;
00453
00454 }
00455
00456 return this->tangent ;
00457 }
00458
00459
00460
00461 void MembranePlateFiberSection::Print( OPS_Stream &s, int flag )
00462 {
00463 s << "MembranePlateFiberSection: \n " ;
00464 s << " Thickness h = " << h << endln ;
00465
00466 theFibers[0]->Print( s, flag ) ;
00467
00468 return ;
00469 }
00470
00471 int
00472 MembranePlateFiberSection::sendSelf(int commitTag, Channel &theChannel)
00473 {
00474 int res = 0;
00475
00476
00477
00478
00479 int dataTag = this->getDbTag();
00480
00481
00482
00483 int matDbTag;
00484
00485 static ID idData(11);
00486
00487 int i;
00488 for (i = 0; i < 5; i++) {
00489 idData(i) = theFibers[i]->getClassTag();
00490 matDbTag = theFibers[i]->getDbTag();
00491
00492
00493 if (matDbTag == 0) {
00494 matDbTag = theChannel.getDbTag();
00495 if (matDbTag != 0)
00496 theFibers[i]->setDbTag(matDbTag);
00497 }
00498 idData(i+5) = matDbTag;
00499 }
00500
00501 idData(10) = this->getTag();
00502
00503 res += theChannel.sendID(dataTag, commitTag, idData);
00504 if (res < 0) {
00505 opserr << "WARNING MembranePlateFiberSection::sendSelf() - " << this->getTag() << " failed to send ID\n";
00506
00507 return res;
00508 }
00509
00510
00511 for (i = 0; i < 5; i++) {
00512 res += theFibers[i]->sendSelf(commitTag, theChannel);
00513 if (res < 0) {
00514 opserr << "WARNING MembranePlateFiberSection::sendSelf() - " << this->getTag() << " failed to send its Material\n";
00515 return res;
00516 }
00517 }
00518
00519 return res;
00520 }
00521
00522
00523 int
00524 MembranePlateFiberSection::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
00525 {
00526 int res = 0;
00527
00528 int dataTag = this->getDbTag();
00529
00530 static ID idData(11);
00531
00532 res += theChannel.recvID(dataTag, commitTag, idData);
00533 if (res < 0) {
00534 opserr << "WARNING MembranePlateFiberSection::recvSelf() - " << this->getTag() << " failed to receive ID\n";
00535 return res;
00536 }
00537
00538 this->setTag(idData(11));
00539
00540 int i;
00541
00542 if (theFibers[0] == 0) {
00543 for (i = 0; i < 5; i++) {
00544 int matClassTag = idData(i);
00545 int matDbTag = idData(i+5);
00546
00547 theFibers[i] = theBroker.getNewNDMaterial(matClassTag);
00548 if (theFibers[i] == 0) {
00549 opserr << "MembranePlateFiberSection::recvSelf() - " <<
00550 "Broker could not create NDMaterial of class type " << matClassTag << endln;
00551 return -1;
00552 }
00553
00554 theFibers[i]->setDbTag(matDbTag);
00555 res += theFibers[i]->recvSelf(commitTag, theChannel, theBroker);
00556 if (res < 0) {
00557 opserr << "NLBeamColumn3d::recvSelf() - material " <<
00558 i << "failed to recv itself\n";
00559 return res;
00560 }
00561 }
00562 }
00563
00564 else {
00565 for (i = 0; i < 5; i++) {
00566 int matClassTag = idData(i);
00567 int matDbTag = idData(i+5);
00568
00569
00570 if (theFibers[i]->getClassTag() != matClassTag) {
00571 delete theFibers[i];
00572 theFibers[i] = theBroker.getNewNDMaterial(matClassTag);
00573 if (theFibers[i] == 0) {
00574 opserr << "MembranePlateFiberSection::recvSelf() - " <<
00575 "Broker could not create NDMaterial of class type" << matClassTag << endln;
00576 exit(-1);
00577 }
00578 }
00579
00580 theFibers[i]->setDbTag(matDbTag);
00581 res += theFibers[i]->recvSelf(commitTag, theChannel, theBroker);
00582 if (res < 0) {
00583 opserr << "MembranePlateFiberSection::recvSelf() - material " <<
00584 i << ", failed to recv itself\n";
00585 return res;
00586 }
00587 }
00588 }
00589
00590 return res;
00591 }
00592
00593
00594