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
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include <PBowlLoading.h>
00045 #include <math.h>
00046
00047 #include <iomanip>
00048 using std::ios;
00049
00050 #include <fstream>
00051 using std::ifstream;
00052
00053 PBowlLoading::PBowlLoading()
00054 :LoadPattern(0, PATTERN_TAG_PBowlLoading),
00055 PBowlElements(0),
00056 ExteriorNodes(0),
00057 BoundaryNodes(0),
00058 PBowlLoads(0),
00059 U(0),
00060 Udd(0)
00061 {
00062
00063 }
00064
00065 PBowlLoading::PBowlLoading(int tag,
00066 const char *PBEfName,
00067 const char *DispfName,
00068 const char *AccefName,
00069 double theTimeIncr,
00070 double theFactor,
00071 double xplus,
00072 double xminus,
00073 double yplus,
00074 double yminus,
00075 double zplus,
00076 double zminus)
00077 :LoadPattern(tag,
00078 PATTERN_TAG_PBowlLoading),
00079 PBTimeIncr(theTimeIncr),
00080 cFactor(theFactor),
00081 xPlus(xplus),
00082 xMinus(xminus),
00083 yPlus(yplus),
00084 yMinus(yminus),
00085 zPlus(zplus),
00086 zMinus(zminus)
00087 {
00088
00089 int timeSteps1 = 0;
00090 int timeSteps2 = 0;
00091 int numDataPoints =0;
00092 double dataPoint;
00093 int eleID;
00094
00095
00096 ifstream theFileACC;
00097 ifstream theFileDIS;
00098 ifstream theFileELE;
00099
00100
00101
00102
00103 theFileDIS.open(DispfName);
00104 if (theFileDIS.bad())
00105 {
00106 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00107 opserr << " - could not open file " << DispfName << endln;
00108 exit(1);
00109 }
00110 else
00111 {
00112
00113 theFileDIS >> timeSteps1;
00114 fprintf(stderr, "timesteps1= %d", timeSteps1);
00115
00116 while (theFileDIS >> dataPoint)
00117 numDataPoints++;
00118 }
00119 theFileDIS.close();
00120 UnumDataPoints = numDataPoints;
00121 thetimeSteps = timeSteps1;
00122 if ( timeSteps1 == 0)
00123 {
00124 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00125 opserr << " - Time steps for displacement equal to zero... " << AccefName << endln;
00126 exit(0);
00127 }
00128
00129
00130 if (numDataPoints != 0) {
00131
00132
00133 ifstream theFileDIS1;
00134 theFileDIS1.open(DispfName, ios::in);
00135 if (theFileDIS1.bad()) {
00136 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00137 opserr << " - could not open file " << DispfName << endln;
00138 } else {
00139
00140
00141 if ( numDataPoints - thetimeSteps*(numDataPoints/thetimeSteps) != 0 ) {
00142 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00143 opserr << " - Input data not sufficient...Patched with zeros " << DispfName << endln;
00144 }
00145 int cols = numDataPoints/thetimeSteps;
00146 U = new Matrix(cols, thetimeSteps);
00147
00148
00149 if (U == 0 || U->noRows() == 0 || U->noCols() == 0) {
00150 opserr << "PBowlLoading::PBowlLoading() - ran out of memory constructing";
00151 opserr << " a Matrix of size (cols*rows): " << cols << " * " << thetimeSteps << endln;
00152
00153 if (U != 0)
00154 delete U;
00155 U = 0;
00156 }
00157
00158
00159 else {
00160 theFileDIS1 >> timeSteps1;
00161 for (int t=0; t< thetimeSteps; t++)
00162 for (int j=0;j<cols; j++) {
00163 theFileDIS1 >> dataPoint;
00164 (*U)(j, t) = dataPoint;
00165
00166 }
00167 }
00168 }
00169
00170
00171 theFileDIS1.close();
00172 }
00173
00174
00175
00176
00177 theFileACC.open(AccefName);
00178 numDataPoints = 0;
00179
00180 if (theFileACC.bad()) {
00181 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00182 opserr << " - could not open file " << AccefName << endln;
00183 exit(2);
00184 } else {
00185
00186 theFileACC >> timeSteps2;
00187 fprintf(stderr, "timesteps2= %d", timeSteps2);
00188
00189 while (theFileACC >> dataPoint)
00190 numDataPoints++;
00191 }
00192 theFileACC.close();
00193
00194 UddnumDataPoints = numDataPoints;
00195 if ( timeSteps1 != timeSteps2) {
00196 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00197 opserr << " - Time steps for displacement not equal to that for acceleration... " << AccefName << endln;
00198 }
00199
00200
00201
00202 if (numDataPoints != 0)
00203 {
00204
00205
00206 ifstream theFileACC1;
00207 theFileACC1.open(AccefName, ios::in);
00208 if (theFileACC1.bad())
00209 {
00210 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00211 opserr << " - could not open file " << AccefName << endln;
00212 }
00213 else
00214 {
00215
00216
00217 if ( numDataPoints - thetimeSteps*(numDataPoints/thetimeSteps) != 0 ) {
00218 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00219 opserr << " - Input data not sufficient...Patched with zeros " << AccefName << endln;
00220 }
00221 int cols = numDataPoints/thetimeSteps;
00222 Udd = new Matrix(cols, thetimeSteps);
00223
00224
00225 if (Udd == 0 || Udd->noRows() == 0 || Udd->noCols() == 0) {
00226 opserr << "PBowlLoading::PBowlLoading() - ran out of memory constructing";
00227 opserr << " a Matrix of size (cols*rows): " << cols << " * " << thetimeSteps << endln;
00228
00229 if (Udd != 0)
00230 delete Udd;
00231 Udd = 0;
00232 }
00233
00234
00235 else
00236 {
00237 theFileACC1 >> timeSteps2;
00238 for (int t=0; t< thetimeSteps; t++)
00239 {
00240 for (int j=0;j<cols; j++)
00241 {
00242 theFileACC1 >> dataPoint;
00243 (*Udd)(j, t) = dataPoint;
00244
00245 }
00246 }
00247 }
00248 }
00249
00250
00251 theFileACC1.close();
00252 }
00253
00254
00255
00256
00257
00258
00259
00260
00261 theFileELE.open(PBEfName);
00262 numDataPoints = 0;
00263 int numPBE = 0;
00264
00265 if (theFileELE.bad()) {
00266 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00267 opserr << " - could not open file " << PBEfName << endln;
00268 exit(2);
00269 } else {
00270
00271 theFileELE >> numPBE;
00272
00273 while (theFileELE >> eleID)
00274 numDataPoints++;
00275 }
00276 theFileELE.close();
00277 if ( numPBE != numDataPoints) {
00278 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00279 opserr << " - Number of plastic bowl elements not equal to the number of elements provided... " << numDataPoints << numPBE << PBEfName << endln;
00280 exit(3);
00281 }
00282
00283
00284
00285 if (numDataPoints != 0) {
00286
00287
00288 ifstream theFileELE1;
00289 theFileELE1.open(PBEfName, ios::in);
00290 if (theFileELE1.bad()) {
00291 opserr << "WARNING - PBowlLoading::PBowlLoading()";
00292 opserr << " - could not open file " << PBEfName << endln;
00293 } else {
00294
00295
00296 PBowlElements = new ID(numPBE);
00297
00298
00299 if (PBowlElements == 0 || PBowlElements->Size() == 0 ) {
00300 opserr << "PBowlLoading::PBowlLoading() - ran out of memory constructing";
00301 opserr << " a ID of size: " << PBowlElements->Size()<< endln;
00302
00303 if (PBowlElements != 0)
00304 delete PBowlElements;
00305 PBowlElements = 0;
00306 }
00307
00308
00309 else {
00310 theFileELE1 >> numPBE;
00311 int i;
00312 for (i=0; i< numPBE; i++) {
00313 theFileELE1 >> eleID;
00314 (*PBowlElements)(i) = eleID;
00315 }
00316 }
00317
00318
00319 theFileELE1.close();
00320
00321
00322
00323 opserr << "# of plastic bowl element: " << numPBE << endln;
00324 opserr << (*PBowlElements);
00325
00326 }
00327 }
00328
00329 LoadComputed = false;
00330 }
00331
00332
00333
00334 PBowlLoading::~PBowlLoading()
00335 {
00336
00337
00338 if ( PBowlElements != 0)
00339 delete PBowlElements;
00340
00341 if ( ExteriorNodes != 0)
00342 delete ExteriorNodes;
00343
00344 if ( BoundaryNodes != 0)
00345 delete BoundaryNodes;
00346
00347 if ( PBowlLoads != 0)
00348 delete PBowlLoads;
00349
00350 if ( U != 0)
00351 delete U;
00352
00353 if ( Udd != 0)
00354 delete Udd;
00355
00356 }
00357
00358
00359 void
00360 PBowlLoading::setDomain(Domain *theDomain)
00361 {
00362 this->LoadPattern::setDomain(theDomain);
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381 }
00382
00383
00384 void
00385 PBowlLoading::applyLoad(double time)
00386 {
00387
00388 Domain *theDomain = this->getDomain();
00389 if (theDomain == 0)
00390 return;
00391
00392
00393 if ( !LoadComputed )
00394 this->CompPBLoads();
00395
00396
00397 int numBnodes = BoundaryNodes->Size();
00398 int numEnodes = ExteriorNodes->Size();
00399 if ( (numBnodes + numEnodes) == 0)
00400 return;
00401
00402
00403 Node *theNode;
00404 int i;
00405 for (i=0; i<numBnodes; i++) {
00406 Vector load=this->getNodalLoad((*BoundaryNodes)[i], time);
00407
00408 load = load*(-1.0);
00409 theNode = theDomain->getNode( (*BoundaryNodes)[i] );
00410 theNode->addUnbalancedLoad(load);
00411 }
00412
00413
00414 for (i=0; i<numEnodes; i++) {
00415 const Vector &load=this->getNodalLoad((*ExteriorNodes)[i], time);
00416 theNode = theDomain->getNode( (*ExteriorNodes)[i] );
00417 theNode->addUnbalancedLoad(load);
00418 }
00419 }
00420
00421 int
00422 PBowlLoading::sendSelf(int commitTag, Channel &theChannel)
00423 {
00424 opserr << "PBowlLoading::sendSelf() - not yet implemented\n";
00425 return 0;
00426 }
00427
00428 int
00429 PBowlLoading::recvSelf(int commitTag, Channel &theChannel,
00430 FEM_ObjectBroker &theBroker)
00431 {
00432 opserr << "PBowlLoading::recvSelf() - not yet implemented\n";
00433 return 0;
00434 }
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575 void
00576 PBowlLoading::Print(OPS_Stream &s, int flag)
00577 {
00578 opserr << "PBowlLoading::Print() - not yet implemented\n";
00579 }
00580
00581
00582
00583
00584 LoadPattern *
00585 PBowlLoading::getCopy(void)
00586 {
00587
00588 opserr << "PBowlLoading::getCopy() - not yet implemented\n";
00589 return 0;
00590 }
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625 void
00626 PBowlLoading::CompPBLoads()
00627 {
00628
00629
00630
00631 Domain *theDomain = this->getDomain();
00632
00633
00634 Element *theElement = theDomain->getElement( (*PBowlElements)(0) );
00635 int NIE = theElement->getNumExternalNodes();
00636
00637 int max_bnode = PBowlElements->Size() * NIE;
00638 ID *Bowl_node = new ID(max_bnode);
00639 ID *Bound_node = new ID(max_bnode);
00640 ID NidesinFirstEle = theElement->getExternalNodes();
00641
00642 int i, j, k, bi;
00643
00644 for (i = 0; i<NIE; i++)
00645 (*Bowl_node)(i) = NidesinFirstEle(i);
00646
00647 int no_bnode = NIE;
00648 int no_boundarynodes = 0, no_exteriornodes = 0;
00649 int Bowl_elem_nb = PBowlElements->Size();
00650 ID Temp;
00651
00652 for ( i=1; i<Bowl_elem_nb; i++)
00653 {
00654 theElement = theDomain->getElement( (*PBowlElements)(i) );
00655 Temp = theElement->getExternalNodes();
00656 for ( j=0;j<NIE;j++)
00657 {
00658 for (k = 0; k< no_bnode; k++)
00659 {
00660 if ( Temp(j) == (*Bowl_node)(k) )
00661
00662 break;
00663 }
00664
00665
00666 if ( k == no_bnode)
00667 {
00668 (*Bowl_node)(no_bnode) = Temp(j);
00669 no_bnode ++;
00670 }
00671
00672 }
00673
00674 }
00675
00676
00677
00678
00679 opserr << "\nCheck all plastic bowl nodes...\n";
00680 for (bi=0;bi<no_bnode;bi++)
00681 opserr<< (*Bowl_node)(bi) <<" ";
00682 opserr<< endln << "# of pbowl nodes = " << no_bnode<<endln;
00683
00684
00685
00686
00687
00688 if ( (BoundaryNodes == 0) && ( (xPlus == xMinus) || (yPlus == yMinus) || (zPlus == zMinus) ) ) {
00689 opserr << "PBowlLoading::CompPBLoads() - Boundary node specification not correct..." << endln;
00690 exit(1);
00691 }
00692
00693 no_boundarynodes = 0;
00694 for (i =0; i < no_bnode; i++) {
00695 Node *theNode = theDomain->getNode( (*Bowl_node)(i) );
00696 const Vector &coor = theNode->getCrds();
00697
00698
00699 if ( (coor(0) == xPlus) && (coor(1) >= yMinus) && (coor(1) <= yPlus) && (coor(2) >= zMinus) && (coor(2) <= zPlus) ) {
00700 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00701 no_boundarynodes++;
00702 }
00703
00704 else if ( (coor(0) == xMinus) && (coor(1) >= yMinus) && (coor(1) <= yPlus) && (coor(2) >= zMinus) && (coor(2) <= zPlus)) {
00705 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00706 no_boundarynodes++;
00707 }
00708
00709 else if ( (coor(1) == yPlus) && (coor(0) >= xMinus) && (coor(0) <= xPlus) && (coor(2) >= zMinus) && (coor(2) <= zPlus)) {
00710 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00711 no_boundarynodes++;
00712 }
00713
00714 else if ( (coor(1) == yMinus) && (coor(0) >= xMinus) && (coor(0) <= xPlus) && (coor(2) >= zMinus) && (coor(2) <= zPlus)) {
00715 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00716 no_boundarynodes++;
00717 }
00718
00719 else if ( (coor(2) == zPlus) && (coor(0) >= xMinus) && (coor(0) <= xPlus) && (coor(1) >= yMinus) && (coor(1) <= yPlus)) {
00720 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00721 no_boundarynodes++;
00722 }
00723
00724 else if ( (coor(2) == zMinus) && (coor(0) >= xMinus) && (coor(0) <= xPlus) && (coor(1) >= yMinus) && (coor(1) <= yPlus)) {
00725 (*Bound_node)(no_boundarynodes) = (*Bowl_node)(i);
00726 no_boundarynodes++;
00727 }
00728 }
00729
00730
00731 BoundaryNodes = new ID(no_boundarynodes);
00732
00733 if (BoundaryNodes == 0 || BoundaryNodes->Size() == 0) {
00734 opserr << "PBowlLoading::CompPBLoads() - ran out of memory constructing";
00735 opserr << " a Vector of size: " << BoundaryNodes->Size() << endln;
00736 if (BoundaryNodes != 0)
00737 delete BoundaryNodes;
00738 BoundaryNodes = 0;
00739 }
00740
00741 no_exteriornodes = no_bnode;
00742 for (i =0; i < no_boundarynodes; i++) {
00743 (*BoundaryNodes)(i) = (*Bound_node)(i);
00744
00745
00746 for (j = 0; j < no_bnode; j++) {
00747 if ( (*Bowl_node)(j) == (*Bound_node)(i) ) {
00748 (*Bowl_node)(j) = 0;
00749 no_exteriornodes --;
00750 }
00751 }
00752 }
00753
00754
00755 ExteriorNodes = new ID(no_exteriornodes);
00756 if (ExteriorNodes == 0 || ExteriorNodes->Size() == 0) {
00757 opserr << "PBowlLoading::CompPBLoads() - ran out of memory constructing";
00758 opserr << " a Vector of size: " << ExteriorNodes->Size() << endln;
00759 if (ExteriorNodes != 0)
00760 delete ExteriorNodes;
00761 ExteriorNodes = 0;
00762 }
00763
00764 j = 0;
00765 for (i =0; i < no_bnode; i++) {
00766 if ( (*Bowl_node)(i) != 0 ) {
00767 (*ExteriorNodes)(j) = (*Bowl_node)(i);
00768 j++;
00769 }
00770 }
00771
00772
00773
00774 opserr << "\nCheck all boundary bowl nodes...\n";
00775 for (bi = 0; bi < no_boundarynodes; bi++)
00776 opserr << (*BoundaryNodes)(bi) <<" ";
00777 opserr<< endln << "# of boundary bowl nodes = " << no_boundarynodes << endln;
00778
00779
00780 opserr << "\nCheck all exterior bowl nodes...\n";
00781 for (bi = 0; bi < no_exteriornodes; bi++)
00782 opserr << (*ExteriorNodes)(bi) <<" ";
00783 opserr<< endln << "# of exterior bowl nodes = " << no_exteriornodes << endln;
00784
00785 opserr<<"finish inputting and organizing the Bowl_node array"<<endln;
00786
00787
00788
00789
00790
00791
00792
00793 opserr<<"Computing the equivalent(effective) forces for all plastic bowl nodes"<<endln;
00794 int cols = Udd->noRows();
00795
00796 Matrix *F = new Matrix(cols, thetimeSteps);
00797
00798
00799 Node *theNode = theDomain->getNode((*BoundaryNodes)(0));
00800 int NDOF = theNode->getNumberDOF();
00801
00802 Vector *Fm = new Vector(NIE*NDOF);
00803 Vector *Fk = new Vector(NIE*NDOF);
00804
00805
00806 Vector *u_e = new Vector(NIE*NDOF);
00807 Vector *udd_e = new Vector(NIE*NDOF);
00808
00809
00810
00811 for ( i=0;i<cols; i++)
00812 for ( j=0;j<thetimeSteps; j++)
00813 (*F)(i,j)=0;
00814
00815 Element *theBowlElements;
00816
00817 for ( i=0; i<Bowl_elem_nb; i++)
00818 {
00819
00820 theBowlElements = theDomain->getElement( (*PBowlElements)(i) );
00821 const ID &nd = theBowlElements->getExternalNodes();
00822
00823 Matrix Me = theBowlElements ->getMass();
00824 Matrix Ke = theBowlElements ->getTangentStiff();
00825
00826
00827
00828
00829
00830
00831 ID *B_node = new ID(NIE);
00832 ID *E_node = new ID(NIE);
00833 int nB=0, nE=0;
00834 bool bdnode;
00835
00836 for ( int ii = 0; ii < NIE; ii++) {
00837
00838 bdnode = false;
00839 for (int id = 0; id < no_boundarynodes; id++) {
00840 if ( nd(ii) == (*BoundaryNodes)(id) ) {
00841 bdnode = true;
00842 break;
00843 }
00844 }
00845
00846 if ( bdnode ) {
00847 (*B_node)(nB) = ii;
00848 nB ++;
00849 }
00850 else {
00851 (*E_node)(nE) = ii;
00852 nE ++;
00853 }
00854 }
00855
00856
00857 opserr << "B nodes: " << nB << " " << *B_node;
00858 opserr << "E nodes: " << nE << " " << *E_node;
00859
00860 opserr << " ...Me before " << Me;
00861
00862
00863 int m;
00864 for (m = 0; m < nB; m++)
00865 for (int n = 0; n < nB; n++)
00866 for (int d = 0; d < NDOF; d++)
00867 for (int e= 0; e < NDOF; e++) {
00868 Me( (*B_node)(m)*NDOF+d, (*B_node)(n)*NDOF+e ) = 0.0;
00869 Ke( (*B_node)(m)*NDOF+d, (*B_node)(n)*NDOF+e ) = 0.0;
00870 }
00871
00872
00873 for (m = 0; m < nE; m++)
00874 for (int n = 0; n < nE; n++)
00875 for (int d = 0; d < NDOF; d++)
00876 for (int e= 0; e < NDOF; e++) {
00877 Me( (*E_node)(m)*NDOF+d, (*E_node)(n)*NDOF+e ) = 0.0;
00878 Ke( (*E_node)(m)*NDOF+d, (*E_node)(n)*NDOF+e ) = 0.0;
00879 }
00880
00881
00882 opserr << " ...Me after " << Me;
00883 opserr << " ...Ke after " << Ke;
00884
00885
00886
00887 for ( int t=0;t<thetimeSteps; t++)
00888 {
00889
00890 for (int j=0;j<NIE;j++)
00891 {
00892 for (int d=0;d<NDOF;d++)
00893 {
00894 (*u_e)(j*NDOF+d) = (*U)( nd(j)*NDOF-NDOF+d,t);
00895 (*udd_e)(j*NDOF+d) = (*Udd)( nd(j)*NDOF-NDOF+d,t);
00896 }
00897 }
00898
00899 Fm->addMatrixVector(0.0, Me, (*udd_e), 1.0);
00900 Fk->addMatrixVector(0.0, Ke, (*u_e), 1.0);
00901
00902 for (int k=0;k<NIE; k++)
00903 for (int d=0;d<NDOF;d++) {
00904 (*F)( nd(k)*NDOF-NDOF+d,t) = (*F)( nd(k)*NDOF-NDOF+d,t) + (*Fk)(k*NDOF+d) + (*Fm)(k*NDOF+d);
00905 }
00906
00907 }
00908
00909 }
00910
00911 PBowlLoads = new Matrix(*F);
00912
00913
00914 if (PBowlLoads->noRows() == 0 || PBowlLoads->noCols() == 0 ) {
00915 opserr << "PBowlLoading::PBowlLoads() - ran out of memory";
00916 opserr << " a Matrix of size: " << PBowlLoads->noRows() << " * " << PBowlLoads->noCols() << endln;
00917 }
00918
00919
00920
00921 opserr<<"\nFinish calculating the forces..." << endln << endln;
00922
00923 LoadComputed = true;
00924
00925 delete Fm;
00926 delete Fk;
00927 delete u_e;
00928 delete udd_e;
00929 delete F;
00930
00931 }
00932
00933
00934 const Vector &
00935 PBowlLoading::getNodalLoad(int nodeTag, double time)
00936 {
00937 Vector *dummy = new Vector(0);
00938
00939 Domain *theDomain = this->getDomain();
00940 Node *theNode = theDomain->getNode(nodeTag);
00941 if (theNode == 0)
00942 {
00943 opserr << "PBowlLoading::getNodalLoad() - no nodes associtated to the nodeTag " << nodeTag << "\n";
00944 return ( *dummy );
00945 }
00946
00947 delete dummy;
00948
00949
00950 int numDOF = theNode->getNumberDOF();
00951 Vector *nodalLoad = new Vector(numDOF);
00952
00953
00954
00955
00956 if (time < 0.0 || PBowlLoads == 0)
00957 return (*nodalLoad);
00958
00959
00960 double incr = time/PBTimeIncr;
00961 int incr1 = (int) floor(incr)-1;
00962 int incr2 = incr1 + 1;
00963
00964 double value1=0;
00965 double value2=0;
00966
00967 int i;
00968 if ( incr2 == thetimeSteps ) {
00969 for (i = 0; i < numDOF; i++)
00970 (*nodalLoad)(i) = (*PBowlLoads)(i, incr1);
00971 }
00972
00973
00974 else if (incr2 > thetimeSteps ) {
00975
00976
00977 return (*nodalLoad);
00978 }
00979
00980
00981 else {
00982 for (i = 0; i < numDOF; i++){
00983 value1 = (*PBowlLoads)(numDOF*(nodeTag-1)+i, incr1);
00984 value2 = (*PBowlLoads)(numDOF*(nodeTag-1)+i, incr2);
00985 (*nodalLoad)(i) = cFactor*(value1 + (value2-value1)*(time/PBTimeIncr - incr2));
00986 }
00987 }
00988
00989
00990
00991
00992
00993 return (*nodalLoad);
00994
00995 }
00996