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
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef Template3Dep_CPP
00060
00061 #define Template3Dep_CPP
00062
00063
00064
00065 #define ITMAX 30
00066
00067 #define MAX_STEP_COUNT 30
00068
00069 #define NUM_OF_SUB_INCR 30
00070
00071 #define KK 1000.0
00072
00073
00074
00075 #include "Template3Dep.h"
00076
00077
00078
00079
00080
00081 stresstensor Template3Dep::Stress;
00082
00083 straintensor Template3Dep::Strain;
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 Template3Dep::Template3Dep( int tag ,
00098
00099 NDMaterial &theElMat,
00100
00101 YieldSurface *YS_ ,
00102
00103 PotentialSurface *PS_ ,
00104
00105 EPState *EPS_ ,
00106
00107 EvolutionLaw_S *ELS1_ ,
00108
00109 EvolutionLaw_S *ELS2_ ,
00110
00111 EvolutionLaw_S *ELS3_ ,
00112
00113 EvolutionLaw_S *ELS4_ ,
00114
00115 EvolutionLaw_T *ELT1_ ,
00116
00117 EvolutionLaw_T *ELT2_ ,
00118
00119 EvolutionLaw_T *ELT3_ ,
00120
00121 EvolutionLaw_T *ELT4_ )
00122
00123 :NDMaterial(tag, ND_TAG_Template3Dep)
00124
00125 {
00126
00127
00128
00129 theElasticMat = theElMat.getCopy();
00130
00131 if (theElasticMat == 0) {
00132
00133 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00134
00135 exit(-1);
00136
00137 }
00138
00139
00140
00141 if ( YS_ )
00142
00143 YS = YS_->newObj();
00144
00145 else
00146
00147 {
00148
00149 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00150
00151 exit(-1);
00152
00153 }
00154
00155
00156
00157 if ( PS_ )
00158
00159 PS = PS_->newObj();
00160
00161 else
00162
00163 {
00164
00165 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00166
00167 exit(-1);
00168
00169 }
00170
00171
00172
00173 if ( EPS_ )
00174
00175 EPS = EPS_->newObj();
00176
00177 else
00178
00179 {
00180
00181 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00182
00183 exit(-1);
00184
00185 }
00186
00187
00188
00189
00190
00191 if ( ELS1_ )
00192
00193 ELS1 = ELS1_->newObj();
00194
00195 else
00196
00197 ELS1 = 0;
00198
00199
00200
00201 if ( ELS2_ )
00202
00203 ELS2 = ELS2_->newObj();
00204
00205 else
00206
00207 ELS2 = 0;
00208
00209
00210
00211 if ( ELS3_ )
00212
00213 ELS3 = ELS3_->newObj();
00214
00215 else
00216
00217 ELS3 = 0;
00218
00219
00220
00221 if ( ELS4_ )
00222
00223 ELS4 = ELS4_->newObj();
00224
00225 else
00226
00227 ELS4 = 0;
00228
00229
00230
00231 if ( ELT1_ )
00232
00233 ELT1 = ELT1_->newObj();
00234
00235 else
00236
00237 ELT1 = 0;
00238
00239
00240
00241 if ( ELT2_ )
00242
00243 ELT2 = ELT2_->newObj();
00244
00245 else
00246
00247 ELT2 = 0;
00248
00249
00250
00251 if ( ELT3_ )
00252
00253 ELT3 = ELT3_->newObj();
00254
00255 else
00256
00257 ELT3 = 0;
00258
00259
00260
00261 if ( ELT4_ )
00262
00263 ELT4 = ELT4_->newObj();
00264
00265 else
00266
00267 ELT4 = 0;
00268
00269
00270
00271
00272
00273 tensor E = ElasticStiffnessTensor();
00274
00275 EPS->setEep( E );
00276
00277
00278
00279 }
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 Template3Dep::Template3Dep( int tag ,
00290
00291 NDMaterial &theElMat,
00292
00293 YieldSurface *YS_ ,
00294
00295 PotentialSurface *PS_ ,
00296
00297 EPState *EPS_)
00298
00299 :NDMaterial(tag, ND_TAG_Template3Dep)
00300
00301 {
00302
00303
00304
00305 theElasticMat = theElMat.getCopy();
00306
00307 if (theElasticMat == 0) {
00308
00309 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00310
00311 exit(-1);
00312
00313 }
00314
00315
00316
00317 if ( YS_ )
00318
00319 YS = YS_->newObj();
00320
00321 else
00322
00323 {
00324
00325 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00326
00327 exit(-1);
00328
00329 }
00330
00331
00332
00333 if ( PS_ )
00334
00335 PS = PS_->newObj();
00336
00337 else
00338
00339 {
00340
00341 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00342
00343 exit(-1);
00344
00345 }
00346
00347
00348
00349 if ( EPS_ )
00350
00351 EPS = EPS_->newObj();
00352
00353 else
00354
00355 {
00356
00357 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00358
00359 exit(-1);
00360
00361 }
00362
00363
00364
00365
00366
00367 ELS1 = 0;
00368
00369 ELS2 = 0;
00370
00371 ELS3 = 0;
00372
00373 ELS4 = 0;
00374
00375 ELT1 = 0;
00376
00377 ELT2 = 0;
00378
00379 ELT3 = 0;
00380
00381 ELT4 = 0;
00382
00383 }
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397 Template3Dep::Template3Dep( int tag ,
00398
00399 NDMaterial &theElMat,
00400
00401 YieldSurface *YS_ ,
00402
00403 PotentialSurface *PS_ ,
00404
00405 EPState *EPS_,
00406
00407 EvolutionLaw_S *ELS1_ )
00408
00409 :NDMaterial(tag, ND_TAG_Template3Dep)
00410
00411 {
00412
00413
00414
00415 theElasticMat = theElMat.getCopy();
00416
00417 if (theElasticMat == 0) {
00418
00419 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00420
00421 exit(-1);
00422
00423 }
00424
00425
00426
00427 if ( YS_ )
00428
00429 YS = YS_->newObj();
00430
00431 else
00432
00433 {
00434
00435 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00436
00437 exit(-1);
00438
00439 }
00440
00441
00442
00443 if ( PS_ )
00444
00445 PS = PS_->newObj();
00446
00447 else
00448
00449 {
00450
00451 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00452
00453 exit(-1);
00454
00455 }
00456
00457
00458
00459 if ( EPS_ )
00460
00461 EPS = EPS_->newObj();
00462
00463 else
00464
00465 {
00466
00467 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00468
00469 exit(-1);
00470
00471 }
00472
00473
00474
00475
00476
00477 if ( ELS1_ )
00478
00479 ELS1 = ELS1_->newObj();
00480
00481 else
00482
00483 ELS1 = 0;
00484
00485
00486
00487 ELS2 = 0;
00488
00489 ELS3 = 0;
00490
00491 ELS4 = 0;
00492
00493 ELT1 = 0;
00494
00495 ELT2 = 0;
00496
00497 ELT3 = 0;
00498
00499 ELT4 = 0;
00500
00501 }
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515 Template3Dep::Template3Dep( int tag ,
00516
00517 NDMaterial &theElMat,
00518
00519 YieldSurface *YS_ ,
00520
00521 PotentialSurface *PS_ ,
00522
00523 EPState *EPS_,
00524
00525 EvolutionLaw_T *ELT1_ )
00526
00527 :NDMaterial(tag, ND_TAG_Template3Dep)
00528
00529 {
00530
00531
00532
00533 theElasticMat = theElMat.getCopy();
00534
00535 if (theElasticMat == 0) {
00536
00537 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00538
00539 exit(-1);
00540
00541 }
00542
00543
00544
00545 if ( YS_ )
00546
00547 YS = YS_->newObj();
00548
00549 else
00550
00551 {
00552
00553 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00554
00555 exit(-1);
00556
00557 }
00558
00559
00560
00561 if ( PS_ )
00562
00563 PS = PS_->newObj();
00564
00565 else
00566
00567 {
00568
00569 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00570
00571 exit(-1);
00572
00573 }
00574
00575
00576
00577 if ( EPS_ )
00578
00579 EPS = EPS_->newObj();
00580
00581 else
00582
00583 {
00584
00585 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00586
00587 exit(-1);
00588
00589 }
00590
00591
00592
00593
00594
00595 ELS1 = 0;
00596
00597 ELS2 = 0;
00598
00599 ELS3 = 0;
00600
00601 ELS4 = 0;
00602
00603
00604
00605 if ( ELT1_ )
00606
00607 ELT1 = ELT1_->newObj();
00608
00609 else
00610
00611 ELT1 = 0;
00612
00613
00614
00615 ELT2 = 0;
00616
00617 ELT3 = 0;
00618
00619 ELT4 = 0;
00620
00621 }
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633 Template3Dep::Template3Dep( int tag,
00634
00635 NDMaterial &theElMat,
00636
00637 YieldSurface *YS_ ,
00638
00639 PotentialSurface *PS_ ,
00640
00641 EPState *EPS_,
00642
00643 EvolutionLaw_S *ELS1_,
00644
00645 EvolutionLaw_T *ELT1_ )
00646
00647 :NDMaterial(tag, ND_TAG_Template3Dep)
00648
00649 {
00650
00651
00652
00653 theElasticMat = theElMat.getCopy();
00654
00655 if (theElasticMat == 0) {
00656
00657 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00658
00659 exit(-1);
00660
00661 }
00662
00663
00664
00665 if ( YS_ )
00666
00667 YS = YS_->newObj();
00668
00669 else
00670
00671 {
00672
00673 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00674
00675 exit(-1);
00676
00677 }
00678
00679
00680
00681 if ( PS_ )
00682
00683 PS = PS_->newObj();
00684
00685 else
00686
00687 {
00688
00689 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00690
00691 exit(-1);
00692
00693 }
00694
00695
00696
00697 if ( EPS_ )
00698
00699 EPS = EPS_->newObj();
00700
00701 else
00702
00703 {
00704
00705 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00706
00707 exit(-1);
00708
00709 }
00710
00711
00712
00713
00714
00715 if ( ELS1_ )
00716
00717 ELS1 = ELS1_->newObj();
00718
00719 else
00720
00721 ELS1 = 0;
00722
00723 ELS2 = 0;
00724
00725 ELS3 = 0;
00726
00727 ELS4 = 0;
00728
00729
00730
00731 if ( ELT1_ )
00732
00733 ELT1 = ELT1_->newObj();
00734
00735 else
00736
00737 ELT1 = 0;
00738
00739 ELT2 = 0;
00740
00741 ELT3 = 0;
00742
00743 ELT4 = 0;
00744
00745 }
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759 Template3Dep::Template3Dep( int tag ,
00760
00761 NDMaterial &theElMat,
00762
00763 YieldSurface *YS_ ,
00764
00765 PotentialSurface *PS_ ,
00766
00767 EPState *EPS_,
00768
00769 EvolutionLaw_S *ELS1_,
00770
00771 EvolutionLaw_S *ELS2_,
00772
00773 EvolutionLaw_T *ELT1_ )
00774
00775 :NDMaterial(tag, ND_TAG_Template3Dep)
00776
00777 {
00778
00779
00780
00781 theElasticMat = theElMat.getCopy();
00782
00783 if (theElasticMat == 0) {
00784
00785 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00786
00787 exit(-1);
00788
00789 }
00790
00791
00792
00793 if ( YS_ )
00794
00795 YS = YS_->newObj();
00796
00797 else
00798
00799 {
00800
00801 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00802
00803 exit(-1);
00804
00805 }
00806
00807
00808
00809 if ( PS_ )
00810
00811 PS = PS_->newObj();
00812
00813 else
00814
00815 {
00816
00817 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00818
00819 exit(-1);
00820
00821 }
00822
00823
00824
00825 if ( EPS_ )
00826
00827 EPS = EPS_->newObj();
00828
00829 else
00830
00831 {
00832
00833 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00834
00835 exit(-1);
00836
00837 }
00838
00839
00840
00841 if ( ELS1_ )
00842
00843 ELS1 = ELS1_->newObj();
00844
00845 else
00846
00847 ELS1 = 0;
00848
00849
00850
00851 if ( ELS2_ )
00852
00853 ELS2 = ELS2_->newObj();
00854
00855 else
00856
00857 ELS2 = 0;
00858
00859
00860
00861 ELS3 = 0;
00862
00863 ELS4 = 0;
00864
00865
00866
00867 if ( ELT1_ )
00868
00869 ELT1 = ELT1_->newObj();
00870
00871 else
00872
00873 ELT1 = 0;
00874
00875
00876
00877 ELT2 = 0;
00878
00879 ELT3 = 0;
00880
00881 ELT4 = 0;
00882
00883 }
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897 Template3Dep::Template3Dep( int tag ,
00898
00899 NDMaterial &theElMat,
00900
00901 YieldSurface *YS_ ,
00902
00903 PotentialSurface *PS_ ,
00904
00905 EPState *EPS_,
00906
00907 EvolutionLaw_S *ELS1_,
00908
00909 EvolutionLaw_S *ELS2_,
00910
00911 EvolutionLaw_T *ELT1_,
00912
00913 EvolutionLaw_T *ELT2_)
00914
00915 :NDMaterial(tag, ND_TAG_Template3Dep)
00916
00917 {
00918
00919
00920
00921 theElasticMat = theElMat.getCopy();
00922
00923 if (theElasticMat == 0) {
00924
00925 opserr << "Template3Dep:: Template3Dep failed to get copy of material\n";
00926
00927 exit(-1);
00928
00929 }
00930
00931
00932
00933 if ( YS_ )
00934
00935 YS = YS_->newObj();
00936
00937 else
00938
00939 {
00940
00941 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00942
00943 exit(-1);
00944
00945 }
00946
00947
00948
00949 if ( PS_ )
00950
00951 PS = PS_->newObj();
00952
00953 else
00954
00955 {
00956
00957 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00958
00959 exit(-1);
00960
00961 }
00962
00963
00964
00965 if ( EPS_ )
00966
00967 EPS = EPS_->newObj();
00968
00969 else
00970
00971 {
00972
00973 opserr << "Template3Dep:: Template3Dep failed to construct the template3Dep\n";
00974
00975 exit(-1);
00976
00977 }
00978
00979
00980
00981 if ( ELS1_ )
00982
00983 ELS1 = ELS1_->newObj();
00984
00985 else
00986
00987 ELS1 = 0;
00988
00989
00990
00991 if ( ELS2_ )
00992
00993 ELS2 = ELS2_->newObj();
00994
00995 else
00996
00997 ELS2 = 0;
00998
00999 ELS3 = 0;
01000
01001 ELS4 = 0;
01002
01003
01004
01005 if ( ELT1_ )
01006
01007 ELT1 = ELT1_->newObj();
01008
01009 else
01010
01011 ELT1 = 0;
01012
01013
01014
01015 if ( ELT2_ )
01016
01017 ELT2 = ELT2_->newObj();
01018
01019 else
01020
01021 ELT2 = 0;
01022
01023 ELT3 = 0;
01024
01025 ELT4 = 0;
01026
01027 }
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041 Template3Dep::Template3Dep()
01042
01043 :NDMaterial(0, ND_TAG_Template3Dep),ELS1(0), ELS2(0),ELS3(0), ELS4(0),
01044
01045 ELT1(0), ELT2(0), ELT3(0), ELT4(0)
01046
01047 {
01048
01049
01050
01051
01052
01053
01054
01055 theElasticMat = 0;
01056
01057 YS = 0;
01058
01059 PS = 0;
01060
01061 EPS = 0;
01062
01063 }
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077 Template3Dep::~Template3Dep()
01078
01079 {
01080
01081 if (theElasticMat)
01082
01083 delete theElasticMat;
01084
01085
01086
01087 if (YS)
01088
01089 delete YS;
01090
01091
01092
01093 if (PS)
01094
01095 delete PS;
01096
01097
01098
01099 if (EPS)
01100
01101 delete EPS;
01102
01103
01104
01105 if (ELS1)
01106
01107 delete ELS1;
01108
01109
01110
01111 if (ELS2)
01112
01113 delete ELS2;
01114
01115
01116
01117 if (ELS3)
01118
01119 delete ELS3;
01120
01121
01122
01123 if (ELS4)
01124
01125 delete ELS4;
01126
01127
01128
01129 if (ELT1)
01130
01131 delete ELT1;
01132
01133
01134
01135 if (ELT2)
01136
01137 delete ELT2;
01138
01139
01140
01141 if (ELT3)
01142
01143 delete ELT3;
01144
01145
01146
01147 if (ELT4)
01148
01149 delete ELT4;
01150
01151
01152
01153
01154
01155 }
01156
01157
01158
01160
01162
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277 tensor Template3Dep::ElasticComplianceTensor(void) const
01278
01279 {
01280
01281 tensor ret( 4, def_dim_4, 0.0 );
01282
01283
01284
01285 ret = ElasticStiffnessTensor().inverse();
01286
01287
01288
01289 return ret;
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641 }
01642
01643
01644
01645
01646
01647
01648
01649
01650
01651
01652
01653 tensor Template3Dep::ElasticStiffnessTensor(void) const
01654
01655 {
01656
01657 tensor ret( 4, def_dim_4, 0.0 );
01658
01659
01660
01661 if (theElasticMat->setTrialStrain( this->EPS->getElasticStrain() ) < 0) {
01662
01663 opserr << "Template3Dep::theElasticMat setTrialStrain failed in material with strain ";
01664
01665 return -1;
01666
01667 }
01668
01669
01670
01671 ret = theElasticMat->getTangentTensor();
01672
01673 return ret;
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716
01717
01718
01719
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971
01972
01973 }
01974
01975
01976
01977
01978
01979 int Template3Dep::setTrialStrain(const Vector &v)
01980
01981 {
01982
01983
01984
01985 return 0;
01986
01987 }
01988
01989
01990
01991
01992
01993 int Template3Dep::setTrialStrain(const Vector &v, const Vector &r)
01994
01995 {
01996
01997
01998
01999 return 0;
02000
02001 }
02002
02003
02004
02005
02006
02007 int Template3Dep::setTrialStrainIncr(const Vector &v)
02008
02009 {
02010
02011
02012
02013 return 0;
02014
02015 }
02016
02017
02018
02019
02020
02021 int Template3Dep::setTrialStrainIncr(const Vector &v, const Vector &r)
02022
02023 {
02024
02025
02026
02027
02028
02029 return 0;
02030
02031 }
02032
02033
02034
02035
02036
02037 const Matrix& Template3Dep::getTangent(void)
02038
02039 {
02040
02041
02042
02043 Matrix *M = new Matrix();
02044
02045 return *M;
02046
02047 }
02048
02049
02050
02051 const Matrix& Template3Dep::getInitialTangent(void)
02052
02053 {
02054
02055 return this->getInitialTangent();
02056
02057 }
02058
02059
02060
02061
02062
02063 const Vector& Template3Dep::getStress(void)
02064
02065 {
02066
02067
02068
02069 Vector *V = new Vector();
02070
02071 return *V;
02072
02073 }
02074
02075
02076
02077
02078
02079 const Vector& Template3Dep::getStrain(void)
02080
02081 {
02082
02083
02084
02085 Vector *V = new Vector();
02086
02087 return *V;
02088
02089 }
02090
02091
02092
02093
02094
02095
02096
02097 int Template3Dep::setTrialStrain(const Tensor &v)
02098
02099 {
02100
02101
02102
02103 this->setTrialStrainIncr( v - EPS->getStrain() );
02104
02105 return 0;
02106
02107 }
02108
02109
02110
02111
02112
02113
02114
02115 int Template3Dep::setTrialStrain(const Tensor &v, const Tensor &r)
02116
02117 {
02118
02119
02120
02121 this->setTrialStrainIncr( v - EPS->getStrain() );
02122
02123 return 0;
02124
02125 }
02126
02127
02128
02129
02130
02131
02132
02133 int Template3Dep::setTrialStrainIncr(const Tensor &v)
02134
02135 {
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160
02161
02162
02163
02164
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180
02181
02182
02183
02184
02185
02186
02187
02188
02189
02190
02191
02192
02193
02194
02195
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224
02225
02226
02227
02228
02229
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02244
02245
02246
02247 EPState *thisEPState = this->getEPS();
02248
02249 EPState tmp_EPS;
02250
02251 if ( thisEPState->getIntegratorFlag() == 0 ) tmp_EPS = ForwardEulerEPState(v);
02252
02253 else if ( thisEPState->getIntegratorFlag() == 1 ) tmp_EPS = BackwardEulerEPState(v);
02254
02255 else {
02256
02257 opserr << "Template3Dep::setTrialStrainIncr, error when getting integrator flag from EPState! \n";
02258
02259 exit(1);
02260
02261 }
02262
02263
02264
02265
02266
02267 setEPS( tmp_EPS );
02268
02269
02270
02271 return 0;
02272
02273 }
02274
02275
02276
02277
02278
02279 int Template3Dep::setTrialStrainIncr(const Tensor &v, const Tensor &r)
02280
02281 {
02282
02283
02284
02285 this->setTrialStrainIncr(v);
02286
02287 return 0;
02288
02289 }
02290
02291
02292
02293
02294
02295 const tensor& Template3Dep::getTangentTensor(void)
02296
02297 {
02298
02299
02300
02301
02302
02303 return EPS->Eep;
02304
02305 }
02306
02307
02308
02309
02310
02311 const stresstensor& Template3Dep::getStressTensor(void)
02312
02313 {
02314
02315
02316
02317
02318
02319
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333 Stress = EPS->getStress();
02334
02335 return Stress;
02336
02337 }
02338
02339
02340
02341
02342
02343
02344
02345 const straintensor& Template3Dep::getStrainTensor(void)
02346
02347 {
02348
02349 Strain = EPS->getStrain();
02350
02351 return Strain;
02352
02353 }
02354
02355
02356
02357
02358
02359 const straintensor& Template3Dep::getPlasticStrainTensor(void)
02360
02361 {
02362
02363 Strain = EPS->getPlasticStrain();
02364
02365 return Strain;
02366
02367 }
02368
02369
02370
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389 int Template3Dep::commitState(void)
02390
02391 {
02392
02393 int err;
02394
02395 theElasticMat->commitState();
02396
02397 err = getEPS()->commitState();
02398
02399 return err;
02400
02401 }
02402
02403
02404
02405
02406
02407 int Template3Dep::revertToLastCommit(void)
02408
02409 {
02410
02411 int err;
02412
02413 theElasticMat->revertToLastCommit();
02414
02415 err = EPS->revertToLastCommit();
02416
02417 return err;
02418
02419 }
02420
02421
02422
02423 int Template3Dep::revertToStart(void)
02424
02425 {
02426
02427 int err;
02428
02429 theElasticMat->revertToStart();
02430
02431 err = EPS->revertToStart();
02432
02433 return err;
02434
02435 }
02436
02437
02438
02440
02442
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459 NDMaterial * Template3Dep::getCopy(void)
02460
02461 {
02462
02463 NDMaterial * tmp =
02464
02465 new Template3Dep( this->getTag() ,
02466
02467 *(this->getElMat()),
02468
02469 this->getYS() ,
02470
02471 this->getPS() ,
02472
02473 this->getEPS() ,
02474
02475 this->getELS1() ,
02476
02477 this->getELS2() ,
02478
02479 this->getELS3() ,
02480
02481 this->getELS4() ,
02482
02483 this->getELT1() ,
02484
02485 this->getELT2() ,
02486
02487 this->getELT3() ,
02488
02489 this->getELT4() );
02490
02491
02492
02493 return tmp;
02494
02495
02496
02497 }
02498
02499
02500
02501
02502
02503
02504
02505 NDMaterial * Template3Dep::getCopy(const char *code)
02506
02507 {
02508
02509 if (strcmp(code,"Template3Dep") == 0)
02510
02511 {
02512
02513 Template3Dep * tmp =
02514
02515 new Template3Dep( this->getTag() ,
02516
02517 *(this->getElMat()),
02518
02519 this->getYS() ,
02520
02521 this->getPS() ,
02522
02523 this->getEPS() ,
02524
02525 this->getELS1() ,
02526
02527 this->getELS2() ,
02528
02529 this->getELS3() ,
02530
02531 this->getELS4() ,
02532
02533 this->getELT1() ,
02534
02535 this->getELT2() ,
02536
02537 this->getELT3() ,
02538
02539 this->getELT4() );
02540
02541
02542
02543 tmp->getEPS()->setInit();
02544
02545 return tmp;
02546
02547 }
02548
02549 else
02550
02551 {
02552
02553 opserr << "Template3Dep::getCopy failed to get model: " << code << endln;
02554
02555 exit(-1);
02556
02557 }
02558
02559 return 0;
02560
02561 }
02562
02563
02564
02565
02566
02567 const char *Template3Dep::getType(void) const
02568
02569 {
02570
02571 return "Template3Dep";
02572
02573 }
02574
02575
02576
02577
02578
02579
02580
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592
02593
02594
02595 int Template3Dep::sendSelf(int commitTag, Channel &theChannel)
02596
02597 {
02598
02599
02600
02601 return 0;
02602
02603 }
02604
02605
02606
02607
02608
02609 int Template3Dep::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
02610
02611 {
02612
02613
02614
02615 return 0;
02616
02617 }
02618
02619
02620
02621
02622
02623 void
02624
02625 Template3Dep::Print(OPS_Stream &s, int flag)
02626
02627 {
02628
02629 s << (*this);
02630
02631 }
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650
02651 void Template3Dep::setEPS( EPState & rval)
02652
02653 {
02654
02655
02656
02657
02658
02659
02660
02661
02662
02663
02664
02665
02666
02667
02668
02669
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695
02696
02697
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725
02726
02727
02728
02729
02730
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740
02741
02742
02743
02744
02745
02746
02747
02748
02749
02750
02751
02752
02753 EPS->setStress(rval.getStress());
02754
02755 EPS->setStrain(rval.getStrain());
02756
02757 EPS->setElasticStrain(rval.getElasticStrain());
02758
02759 EPS->setPlasticStrain(rval.getPlasticStrain());
02760
02761 EPS->setdElasticStrain(rval.getdElasticStrain());
02762
02763 EPS->setdPlasticStrain(rval.getdPlasticStrain());
02764
02765 EPS->setNScalarVar( rval.getNScalarVar() );
02766
02767
02768
02769 int i;
02770
02771 for (i = 0; i <rval.getNScalarVar(); i++)
02772
02773 EPS->setScalarVar(i+1, rval.getScalarVar(i+1));
02774
02775
02776
02777
02778
02779 EPS->setNTensorVar( rval.getNTensorVar() );
02780
02781 EPS->setTensorVar(rval.getTensorVar());
02782
02783 EPS->setEep(rval.getEep());
02784
02785 EPS->setStress_commit(rval.getStress_commit());
02786
02787 EPS->setStrain_commit(rval.getStrain_commit());
02788
02789 EPS->setElasticStrain_commit(rval.getElasticStrain_commit());
02790
02791
02792
02793 for (i = 0; i <rval.getNScalarVar(); i++)
02794
02795 EPS->setScalarVar_commit(i+1, rval.getScalarVar_commit(i+1));
02796
02797
02798
02799 for (i = 0; i <rval.getNTensorVar(); i++)
02800
02801 EPS->setTensorVar_commit(i+1, rval.getTensorVar_commit(i+1));
02802
02803
02804
02805 EPS->Eep_commit = (rval.getEep_commit());
02806
02807 EPS->Stress_init = rval.getStress_init();
02808
02809 EPS->Strain_init = rval.getStrain_init();
02810
02811
02812
02813 for (i = 0; i <rval.getNScalarVar(); i++)
02814
02815 EPS->setScalarVar_init(i+1, rval.getScalarVar_init(i+1));
02816
02817
02818
02819 for (i = 0; i <rval.getNTensorVar(); i++)
02820
02821 EPS->setTensorVar_init(i+1, rval.getTensorVar_init(i+1));
02822
02823
02824
02825 EPS->Eep_init = rval.getEep_init();
02826
02827 EPS->setConverged(rval.getConverged());
02828
02829
02830
02831
02832
02833
02834
02835
02836
02837
02838
02839
02840
02841 EPS->sete(rval.gete());
02842
02843 EPS->setpsi(rval.getpsi());
02844
02845
02846
02847 }
02848
02849
02850
02851
02852
02853
02854
02855
02856
02857 NDMaterial* Template3Dep::getElMat() const
02858
02859 {
02860
02861 return theElasticMat;
02862
02863 }
02864
02865
02866
02867
02868
02869
02870
02871
02872
02873
02874
02875 YieldSurface * Template3Dep::getYS() const
02876
02877 {
02878
02879 return YS;
02880
02881 }
02882
02883
02884
02885
02886
02887
02888
02889
02890
02891
02892
02893 PotentialSurface * Template3Dep::getPS() const
02894
02895 {
02896
02897 return PS;
02898
02899 }
02900
02901
02902
02903
02904
02905
02906
02907
02908
02909 EPState * Template3Dep::getEPS() const
02910
02911 {
02912
02913 return EPS;
02914
02915 }
02916
02917
02918
02919
02920
02921
02922
02923
02924
02925
02926
02927
02928
02929 EvolutionLaw_S * Template3Dep::getELS1() const
02930
02931 {
02932
02933 return ELS1;
02934
02935 }
02936
02937
02938
02939
02940
02941
02942
02943
02944
02945 EvolutionLaw_S * Template3Dep::getELS2() const
02946
02947 {
02948
02949 return ELS2;
02950
02951 }
02952
02953
02954
02955
02956
02957
02958
02959
02960
02961 EvolutionLaw_S * Template3Dep::getELS3() const
02962
02963 {
02964
02965 return ELS3;
02966
02967 }
02968
02969
02970
02971
02972
02973
02974
02975 EvolutionLaw_S * Template3Dep::getELS4() const
02976
02977 {
02978
02979 return ELS4;
02980
02981 }
02982
02983
02984
02985
02986
02987
02988
02989
02990
02991
02992
02993
02994
02995 EvolutionLaw_T * Template3Dep::getELT1() const
02996
02997 {
02998
02999 return ELT1;
03000
03001 }
03002
03003
03004
03005
03006
03007
03008
03009
03010
03011
03012
03013 EvolutionLaw_T * Template3Dep::getELT2() const
03014
03015 {
03016
03017 return ELT2;
03018
03019 }
03020
03021
03022
03023
03024
03025
03026
03027
03028
03029 EvolutionLaw_T * Template3Dep::getELT3() const
03030
03031 {
03032
03033 return ELT3;
03034
03035 }
03036
03037
03038
03039
03040
03041
03042
03043
03044
03045 EvolutionLaw_T * Template3Dep::getELT4() const
03046
03047 {
03048
03049 return ELT4;
03050
03051 }
03052
03053
03054
03055
03056
03057
03058
03059
03060
03061
03062
03063
03064
03065 EPState Template3Dep::PredictorEPState(straintensor & strain_increment)
03066
03067 {
03068
03069
03070
03071 EPState Predictor = ForwardEulerEPState( strain_increment);
03072
03073
03074
03075 return Predictor;
03076
03077
03078
03079 }
03080
03081
03082
03083
03084
03085
03086
03087
03088
03089 EPState Template3Dep::ForwardEulerEPState( const straintensor &strain_increment)
03090
03091 {
03092
03093
03094
03095
03096
03097 double st_vol = strain_increment.Iinvariant1();
03098
03099
03100
03101
03102
03103
03104
03105 EPState forwardEPS( *(this->getEPS()) );
03106
03107
03108
03109
03110
03111
03112
03113
03114
03115 tensor E = ElasticStiffnessTensor();
03116
03117
03118
03119 tensor Eep = E;
03120
03121 tensor D = ElasticComplianceTensor();
03122
03123 E.null_indices();
03124
03125 D.null_indices();
03126
03127
03128
03129
03130
03131
03132
03133
03134
03135
03136
03137 straintensor strain_incr = strain_increment;
03138
03139 strain_incr.null_indices();
03140
03141 stresstensor stress_increment = E("ijpq") * strain_incr("pq");
03142
03143 stress_increment.null_indices();
03144
03145
03146
03147
03148
03149 EPState startEPS( *(getEPS()) );
03150
03151 stresstensor start_stress = startEPS.getStress();
03152
03153 start_stress.null_indices();
03154
03155
03156
03157
03158
03159 double f_start = 0.0;
03160
03161 double f_pred = 0.0;
03162
03163
03164
03165 EPState IntersectionEPS( startEPS );
03166
03167
03168
03169 EPState ElasticPredictorEPS( startEPS );
03170
03171 stresstensor elastic_predictor_stress = start_stress + stress_increment;
03172
03173 ElasticPredictorEPS.setStress( elastic_predictor_stress );
03174
03175
03176
03177
03178
03179 f_start = this->getYS()->f( &startEPS );
03180
03181
03182
03183
03184
03185
03186
03187 f_pred = this->getYS()->f( &ElasticPredictorEPS );
03188
03189
03190
03191
03192
03193
03194
03195 stresstensor intersection_stress = start_stress;
03196
03197 stresstensor elpl_start_stress = start_stress;
03198
03199 stresstensor true_stress_increment = stress_increment;
03200
03201 straintensor El_strain_increment;
03202
03203
03204
03205 if ( f_start <= 0 && f_pred <= 0 || f_start > f_pred )
03206
03207 {
03208
03209
03210
03211 straintensor estrain = ElasticPredictorEPS.getElasticStrain();
03212
03213 straintensor tstrain = ElasticPredictorEPS.getStrain();
03214
03215 estrain = estrain + strain_incr;
03216
03217 tstrain = tstrain + strain_incr;
03218
03219 ElasticPredictorEPS.setElasticStrain( estrain );
03220
03221 ElasticPredictorEPS.setStrain( tstrain );
03222
03223 ElasticPredictorEPS.setdElasticStrain( strain_incr );
03224
03225
03226
03227
03228
03229
03230
03231
03232
03233
03234
03235 if ( getELT1() ) {
03236
03237
03238
03239 getELT1()->updateEeDm(&ElasticPredictorEPS, -st_vol, 0.0);
03240
03241 }
03242
03243
03244
03245
03246
03247 ElasticPredictorEPS.setEep(E);
03248
03249 return ElasticPredictorEPS;
03250
03251 }
03252
03253
03254
03255 if ( f_start <= 0 && f_pred > 0 )
03256
03257 {
03258
03259 intersection_stress =
03260
03261 yield_surface_cross( start_stress, elastic_predictor_stress);
03262
03263
03264
03265
03266
03267
03268
03269 IntersectionEPS.setStress( intersection_stress );
03270
03271
03272
03273
03274
03275 elpl_start_stress = intersection_stress;
03276
03277
03278
03279
03280
03281 true_stress_increment = elastic_predictor_stress - elpl_start_stress;
03282
03283
03284
03285
03286
03287 stresstensor EstressIncr = intersection_stress- start_stress;
03288
03289
03290
03291
03292
03293
03294
03295 if ( getELT1() ) {
03296
03297 El_strain_increment = D("ijpq") * EstressIncr("pq");
03298
03299 double st_vol_El_incr = El_strain_increment.Iinvariant1();
03300
03301
03302
03303
03304
03305 getELT1()->updateEeDm(&IntersectionEPS, -st_vol_El_incr, 0.0);
03306
03307
03308
03309 getELT1()->updateEeDm(&forwardEPS, -st_vol_El_incr, 0.0);
03310
03311 }
03312
03313
03314
03315 }
03316
03317
03318
03319
03320
03321
03322
03323
03324
03325
03326
03327
03328
03329
03330
03331
03332
03333
03334
03335
03336
03337
03338
03339
03340
03341
03342
03343
03344
03345
03346
03347
03348
03349
03350
03351 stresstensor dFods;
03352
03353 stresstensor dQods;
03354
03355
03356
03357 tensor H( 2, def_dim_2, 0.0);
03358
03359 tensor temp1( 2, def_dim_2, 0.0);
03360
03361 tensor temp2( 2, def_dim_2, 0.0);
03362
03363 double lower = 0.0;
03364
03365 tensor temp3( 2, def_dim_2, 0.0);
03366
03367
03368
03369 double Delta_lambda = 0.0;
03370
03371 double h_s[4] = {0.0, 0.0, 0.0, 0.0};
03372
03373 double xi_s[4] = {0.0, 0.0, 0.0, 0.0};
03374
03375 stresstensor h_t[4];
03376
03377 stresstensor xi_t[4];
03378
03379 double hardMod_ = 0.0;
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391 stresstensor plastic_stress;
03392
03393 straintensor plastic_strain;
03394
03395 stresstensor elastic_plastic_stress;
03396
03397
03398
03399
03400
03401 if ( f_pred >= 0 ) {
03402
03403
03404
03405
03406
03407
03408
03409
03410
03411 dFods = getYS()->dFods( &IntersectionEPS );
03412
03413 dQods = getPS()->dQods( &IntersectionEPS );
03414
03415
03416
03417
03418
03419
03420
03421
03422
03423
03424
03425 H = E("ijkl")*dQods("kl");
03426
03427 H.null_indices();
03428
03429 temp1 = dFods("ij") * E("ijkl");
03430
03431 temp1.null_indices();
03432
03433 temp2 = temp1("ij")*dQods("ij");
03434
03435 temp2.null_indices();
03436
03437 lower = temp2.trace();
03438
03439
03440
03441
03442
03443
03444
03445 hardMod_ = 0.0;
03446
03447
03448
03449 if ( getELS1() ) {
03450
03451 h_s[0] = getELS1()->h_s(&IntersectionEPS, getPS());
03452
03453 xi_s[0] = getYS()->xi_s1( &IntersectionEPS );
03454
03455 hardMod_ = hardMod_ + h_s[0] * xi_s[0];
03456
03457 }
03458
03459
03460
03461
03462
03463 if ( getELS2() ) {
03464
03465 h_s[1] = getELS2()->h_s( &IntersectionEPS, getPS());
03466
03467 xi_s[1] = getYS()->xi_s2( &IntersectionEPS );
03468
03469 hardMod_ = hardMod_ + h_s[1] * xi_s[1];
03470
03471 }
03472
03473
03474
03475
03476
03477 if ( getELS3() ) {
03478
03479 h_s[2] = getELS3()->h_s( &IntersectionEPS, getPS());
03480
03481 xi_s[2] = getYS()->xi_s3( &IntersectionEPS );
03482
03483 hardMod_ = hardMod_ + h_s[2] * xi_s[2];
03484
03485 }
03486
03487
03488
03489
03490
03491 if ( getELS4() ) {
03492
03493 h_s[3] = getELS4()->h_s( &IntersectionEPS, getPS());
03494
03495 xi_s[3] = getYS()->xi_s4( &IntersectionEPS );
03496
03497 hardMod_ = hardMod_ + h_s[3] * xi_s[3];
03498
03499 }
03500
03501
03502
03503
03504
03505
03506
03507 if ( getELT1() ) {
03508
03509 h_t[0] = getELT1()->h_t(&IntersectionEPS, getPS());
03510
03511 xi_t[0] = getYS()->xi_t1( &IntersectionEPS );
03512
03513 tensor hm = (h_t[0])("ij") * (xi_t[0])("ij");
03514
03515 hardMod_ = hardMod_ + hm.trace();
03516
03517 }
03518
03519
03520
03521
03522
03523 if ( getELT2() ) {
03524
03525 h_t[1] = getELT2()->h_t( &IntersectionEPS, getPS());
03526
03527 xi_t[1] = getYS()->xi_t2( &IntersectionEPS );
03528
03529 tensor hm = (h_t[1])("ij") * (xi_t[1])("ij");
03530
03531 hardMod_ = hardMod_ + hm.trace();
03532
03533 }
03534
03535
03536
03537
03538
03539 if ( getELT3() ) {
03540
03541 h_t[2] = getELT3()->h_t( &IntersectionEPS, getPS());
03542
03543 xi_t[2] = getYS()->xi_t3( &IntersectionEPS );
03544
03545 tensor hm = (h_t[2])("ij") * (xi_t[2])("ij");
03546
03547 hardMod_ = hardMod_ + hm.trace();
03548
03549 }
03550
03551
03552
03553
03554
03555 if ( getELT4() ) {
03556
03557 h_t[3] = getELT4()->h_t(&IntersectionEPS, getPS());
03558
03559 xi_t[3] = getYS()->xi_t4( &IntersectionEPS );
03560
03561 tensor hm = (h_t[3])("ij") * (xi_t[3])("ij");
03562
03563 hardMod_ = hardMod_ + hm.trace();
03564
03565 }
03566
03567
03568
03569
03570
03571 lower = lower - hardMod_;
03572
03573
03574
03575
03576
03577
03578
03579
03580
03581
03582
03583
03584
03585
03586
03587
03588
03589
03590
03591
03592
03593
03594
03595 temp3 = dFods("ij") * true_stress_increment("ij");
03596
03597 temp3.null_indices();
03598
03599
03600
03601
03602
03603
03604
03605
03606
03607 Delta_lambda = (temp3.trace())/lower;
03608
03609
03610
03611 if (Delta_lambda<0.0) Delta_lambda=0.0;
03612
03613
03614
03615 plastic_stress = H("kl") * Delta_lambda;
03616
03617 plastic_strain = dQods("kl") * Delta_lambda;
03618
03619 plastic_stress.null_indices();
03620
03621 plastic_strain.null_indices();
03622
03623
03624
03625
03626
03627
03628
03629
03630
03631
03632
03633
03634
03635
03636
03637
03638
03639 elastic_plastic_stress = elastic_predictor_stress - plastic_stress;
03640
03641
03642
03643
03644
03645
03646
03647
03648
03649
03650
03651 straintensor elastic_strain = strain_incr - plastic_strain;
03652
03653
03654
03655
03656
03657
03658
03659
03660
03661
03662
03663 straintensor estrain = forwardEPS.getElasticStrain();
03664
03665 straintensor pstrain = forwardEPS.getPlasticStrain();
03666
03667
03668
03669
03670
03671 straintensor tstrain = forwardEPS.getStrain();
03672
03673 pstrain = pstrain + plastic_strain;
03674
03675 estrain = estrain + elastic_strain;
03676
03677 tstrain = tstrain + elastic_strain + plastic_strain;
03678
03679
03680
03681
03682
03683 forwardEPS.setdPlasticStrain( plastic_strain );
03684
03685 forwardEPS.setdElasticStrain( elastic_strain );
03686
03687 forwardEPS.setPlasticStrain( pstrain );
03688
03689 forwardEPS.setElasticStrain( estrain );
03690
03691 forwardEPS.setStrain( tstrain );
03692
03693
03694
03695
03696
03697
03698
03699 dFods = getYS()->dFods( &IntersectionEPS );
03700
03701 dQods = getPS()->dQods( &IntersectionEPS );
03702
03703
03704
03705 tensor upperE1 = E("pqkl")*dQods("kl");
03706
03707 upperE1.null_indices();
03708
03709 tensor upperE2 = dFods("ij")*E("ijmn");
03710
03711 upperE2.null_indices();
03712
03713
03714
03715
03716
03717 tensor upperE = upperE1("pq") * upperE2("mn");
03718
03719 upperE.null_indices();
03720
03721
03722
03723
03724
03725
03726
03727
03728
03729
03730
03731
03732
03733
03734
03735
03736
03737
03738
03739
03740
03741
03742
03743
03744
03745
03746
03747
03748
03749
03750
03751
03752
03753
03754
03755
03756
03757
03758
03759
03760
03761
03762
03763
03764
03765
03766
03767
03768
03769
03770
03771
03772
03773
03774
03775
03776
03777
03778
03779
03780
03781
03782
03783
03784
03785
03786
03787
03788
03789
03790
03791
03792
03793
03794
03795
03796
03797
03798
03799
03800
03801
03802
03803
03804
03805
03806
03807
03808
03809
03810
03811
03812
03813
03814
03815
03816
03817
03818
03819
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03830
03831
03832
03833
03834
03835
03836
03837
03838
03839
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865
03866
03867
03868
03869
03870
03871 tensor Ep = upperE*(1./lower);
03872
03873
03874
03875
03876
03877 double h_L = 0.0;
03878
03879 if ( Delta_lambda > 0 ) h_L = 1.0;
03880
03881
03882
03883
03884
03885 Eep = E - Ep*h_L;
03886
03887
03888
03889
03890
03891
03892
03893
03894
03895
03896
03897
03898
03899
03900
03901
03902
03903
03904
03905
03906
03907
03908
03909
03910
03911
03912
03913
03914
03915
03916
03917
03918
03919
03920
03921
03922
03923
03924
03925
03926
03927
03928
03929
03930
03931
03932
03933
03934
03935
03936
03937
03938
03939
03940
03941
03942
03943
03944
03945
03946
03947
03948
03949 forwardEPS.setStress(elastic_plastic_stress);
03950
03951
03952
03953
03954
03955 forwardEPS.setEep(Eep);
03956
03957
03958
03959
03960
03961
03962
03963 double f_forward = getYS()->f( &forwardEPS );
03964
03965
03966
03967
03968
03969
03970
03971 int NS = forwardEPS.getNScalarVar();
03972
03973 int NT = forwardEPS.getNTensorVar();
03974
03975
03976
03977 double dS= 0.0;
03978
03979 double S = 0.0;
03980
03981
03982
03983 int ii;
03984
03985 for (ii = 1; ii <= NS; ii++) {
03986
03987 dS = Delta_lambda * h_s[ii-1] ;
03988
03989 S = forwardEPS.getScalarVar(ii);
03990
03991 forwardEPS.setScalarVar(ii, S + dS );
03992
03993 }
03994
03995
03996
03997 stresstensor dT;
03998
03999 stresstensor T;
04000
04001 stresstensor new_T;
04002
04003
04004
04005 for (ii = 1; ii <= NT; ii++) {
04006
04007 dT = h_t[ii-1]*Delta_lambda ;
04008
04009 T = forwardEPS.getTensorVar(ii);
04010
04011 new_T = T + dT;
04012
04013 forwardEPS.setTensorVar(ii, new_T );
04014
04015 }
04016
04017
04018
04019
04020
04021
04022
04023 int err = 0;
04024
04025 if ( getELT1() ) {
04026
04027
04028
04029 double st_vol_pl = plastic_strain.Iinvariant1();
04030
04031
04032
04033
04034
04035
04036
04037
04038
04039 err = getELT1()->updateEeDm(&forwardEPS, st_vol_pl, Delta_lambda);
04040
04041 }
04042
04043
04044
04045
04046
04047
04048
04049
04050
04052
04053
04054
04055
04056
04057
04058
04059
04060
04061
04062
04063
04064
04065
04066
04067
04068
04069
04070
04071 f_forward = getYS()->f( &forwardEPS );
04072
04073
04074
04075
04076
04077
04078
04079 }
04080
04081
04082
04083
04084
04085
04086
04087
04088
04089
04090
04091
04092
04093
04094
04095
04096
04097
04098
04099
04100
04101 forwardEPS.Delta_lambda = Delta_lambda;
04102
04103
04104
04105 return forwardEPS;
04106
04107 }
04108
04109
04110
04111
04112
04113
04114
04115
04116
04117 EPState Template3Dep::SemiBackwardEulerEPState( const straintensor &strain_increment)
04118
04119 {
04120
04121 stresstensor start_stress;
04122
04123 EPState SemibackwardEPS( *(this->getEPS()) );
04124
04125 start_stress = SemibackwardEPS.getStress();
04126
04127
04128
04129
04130
04131
04132
04133 tensor E = ElasticStiffnessTensor();
04134
04135
04136
04137
04138
04139
04140
04141
04142
04143 tensor dFods(2, def_dim_2, 0.0);
04144
04145 tensor dQods(2, def_dim_2, 0.0);
04146
04147 tensor temp2(2, def_dim_2, 0.0);
04148
04149 double lower = 0.0;
04150
04151 double Delta_lambda = 0.0;
04152
04153
04154
04155 EPState E_Pred_EPS( *(this->getEPS()) );
04156
04157
04158
04159 straintensor strain_incr = strain_increment;
04160
04161 stresstensor stress_increment = E("ijkl")*strain_incr("kl");
04162
04163 stress_increment.null_indices();
04164
04165
04166
04167
04168
04169
04170
04171 stresstensor plastic_stress;
04172
04173 stresstensor elastic_predictor_stress;
04174
04175 stresstensor elastic_plastic_stress;
04176
04177
04178
04179
04180
04181 double h_s[4] = {0.0, 0.0, 0.0, 0.0};
04182
04183 double xi_s[4] = {0.0, 0.0, 0.0, 0.0};
04184
04185 stresstensor h_t[4];
04186
04187 stresstensor xi_t[4];
04188
04189 double hardMod_ = 0.0;
04190
04191
04192
04193 double S = 0.0;
04194
04195 double dS = 0.0;
04196
04197 stresstensor T;
04198
04199 stresstensor dT;
04200
04201
04202
04203
04204
04205
04206
04207
04208
04209 elastic_predictor_stress = start_stress + stress_increment;
04210
04211
04212
04213 E_Pred_EPS.setStress( elastic_predictor_stress );
04214
04215
04216
04217
04218
04219
04220
04221 double f_pred = getYS()->f( &E_Pred_EPS );
04222
04223
04224
04225
04226
04227
04228
04229 if ( f_pred >= 0.0 )
04230
04231 {
04232
04233
04234
04235
04236
04237
04238
04239
04240
04241 dFods = getYS()->dFods( &E_Pred_EPS );
04242
04243 dQods = getPS()->dQods( &E_Pred_EPS );
04244
04245
04246
04247
04248
04249
04250
04251 temp2 = (dFods("ij")*E("ijkl"))*dQods("kl");
04252
04253 temp2.null_indices();
04254
04255 lower = temp2.trace();
04256
04257
04258
04259
04260
04261
04262
04263
04264
04265 hardMod_ = 0.0;
04266
04267
04268
04269
04270
04271 if ( getELS1() ) {
04272
04273 h_s[0] = getELS1()->h_s( &E_Pred_EPS, getPS());
04274
04275 xi_s[0] = getYS()->xi_s1( &E_Pred_EPS );
04276
04277 hardMod_ = hardMod_ + h_s[0] * xi_s[0];
04278
04279 }
04280
04281
04282
04283
04284
04285 if ( getELS2() ) {
04286
04287 h_s[1] = getELS2()->h_s( &E_Pred_EPS, getPS());
04288
04289 xi_s[1] = getYS()->xi_s2( &E_Pred_EPS );
04290
04291 hardMod_ = hardMod_ + h_s[1] * xi_s[1];
04292
04293 }
04294
04295
04296
04297
04298
04299 if ( getELS3() ) {
04300
04301 h_s[2] = getELS3()->h_s(&E_Pred_EPS, getPS());
04302
04303 xi_s[2] = getYS()->xi_s3( &E_Pred_EPS );
04304
04305 hardMod_ = hardMod_ + h_s[2] * xi_s[2];
04306
04307 }
04308
04309
04310
04311
04312
04313 if ( getELS4() ) {
04314
04315 h_s[3] = getELS4()->h_s( &E_Pred_EPS, getPS());
04316
04317 xi_s[3] = getYS()->xi_s4( &E_Pred_EPS );
04318
04319 hardMod_ = hardMod_ + h_s[3] * xi_s[3];
04320
04321 }
04322
04323
04324
04325
04326
04327
04328
04329 if ( getELT1() ) {
04330
04331 h_t[0] = getELT1()->h_t(&E_Pred_EPS, getPS());
04332
04333 xi_t[0] = getYS()->xi_t1( &E_Pred_EPS );
04334
04335 tensor hm = (h_t[0])("ij") * (xi_t[0])("ij");
04336
04337 hardMod_ = hardMod_ + hm.trace();
04338
04339 }
04340
04341
04342
04343
04344
04345 if ( getELT2() ) {
04346
04347 h_t[1] = getELT2()->h_t(&E_Pred_EPS, getPS());
04348
04349 xi_t[1] = getYS()->xi_t2( &E_Pred_EPS );
04350
04351 tensor hm = (h_t[1])("ij") * (xi_t[1])("ij");
04352
04353 hardMod_ = hardMod_ + hm.trace();
04354
04355 }
04356
04357
04358
04359
04360
04361 if ( getELT3() ) {
04362
04363 h_t[2] = getELT3()->h_t(&E_Pred_EPS, getPS());
04364
04365 xi_t[2] = getYS()->xi_t3( &E_Pred_EPS );
04366
04367 tensor hm = (h_t[2])("ij") * (xi_t[2])("ij");
04368
04369 hardMod_ = hardMod_ + hm.trace();
04370
04371 }
04372
04373
04374
04375
04376
04377 if ( getELT4() ) {
04378
04379 h_t[3] = getELT4()->h_t(&E_Pred_EPS, getPS());
04380
04381 xi_t[3] = getYS()->xi_t4( &E_Pred_EPS );
04382
04383 tensor hm = (h_t[3])("ij") * (xi_t[3])("ij");
04384
04385 hardMod_ = hardMod_ + hm.trace();
04386
04387 }
04388
04389
04390
04391
04392
04393 lower = lower - hardMod_;
04394
04395
04396
04397
04398
04399
04400
04401
04402
04403
04404
04405
04406
04408
04409
04410
04411
04412
04413
04414
04415
04416
04417
04418
04419
04420
04421
04422
04423 Delta_lambda = f_pred/lower;
04424
04425 if ( Delta_lambda < 0.0 )
04426
04427 {
04428
04429
04430
04431 }
04432
04433 plastic_stress = (E("ijkl")*dQods("kl"))*(-Delta_lambda);
04434
04435 plastic_stress.null_indices();
04436
04437
04438
04439
04440
04441 elastic_plastic_stress = elastic_predictor_stress + plastic_stress;
04442
04443 elastic_plastic_stress.null_indices();
04444
04445
04446
04447 SemibackwardEPS.setStress( elastic_plastic_stress );
04448
04449
04450
04452
04453
04454
04455
04456
04457
04458
04459
04460
04461
04462
04463
04464
04465
04466
04467 int NS = SemibackwardEPS.getNScalarVar();
04468
04469 int NT = SemibackwardEPS.getNTensorVar();
04470
04471
04472
04473 int ii;
04474
04475 for (ii = 1; ii <= NS; ii++) {
04476
04477 dS = Delta_lambda * h_s[ii-1] ;
04478
04479 S = SemibackwardEPS.getScalarVar(ii);
04480
04481 SemibackwardEPS.setScalarVar(ii, S + dS );
04482
04483 }
04484
04485
04486
04487
04488
04490
04492
04494
04495
04496
04497
04498
04499
04500
04501
04502
04503
04504
04505 stresstensor new_T;
04506
04507
04508
04509 for (ii = 1; ii <= NT; ii++) {
04510
04511 dT = h_t[ii-1] * Delta_lambda;
04512
04513 T = SemibackwardEPS.getTensorVar(ii);
04514
04515 new_T = T + dT;
04516
04517 SemibackwardEPS.setTensorVar(ii, new_T );
04518
04519 }
04520
04521
04522
04523
04524
04525
04526
04527 return SemibackwardEPS;
04528
04529 }
04530
04531 return E_Pred_EPS;
04532
04533 }
04534
04535
04536
04537
04538
04539
04540
04541
04542
04543
04544
04545
04546
04547
04548
04549
04550
04551 EPState Template3Dep::BackwardEulerEPState( const straintensor &strain_increment)
04552
04553
04554
04555 {
04556
04558
04559
04560
04561
04562
04563
04564
04565 double st_vol = strain_increment.Iinvariant1();
04566
04567
04568
04569
04570
04571 EPState backwardEPS( * (this->getEPS()) );
04572
04573 EPState startEPS( *(this->getEPS()) );
04574
04575
04576
04577 stresstensor start_stress = startEPS.getStress();
04578
04579
04580
04581
04582
04583
04584
04585
04586
04587
04588
04589
04590
04591
04592
04593
04594
04595
04596
04597
04598
04599
04600
04601 tensor I2("I", 2, def_dim_2);
04602
04603 tensor I_ijkl("I", 4, def_dim_4);
04604
04605 I_ijkl = I2("ij")*I2("kl");
04606
04607 I_ijkl.null_indices();
04608
04609 tensor I_ikjl("I", 4, def_dim_4);
04610
04611 I_ikjl = I_ijkl.transpose0110();
04612
04613
04614
04615
04616
04617
04618
04619
04620
04621 tensor E = ElasticStiffnessTensor();
04622
04623
04624
04625
04626
04627
04628
04629 tensor dFods(2, def_dim_2, 0.0);
04630
04631 tensor dQods(2, def_dim_2, 0.0);
04632
04633
04634
04635
04636
04637 tensor temp2(2, def_dim_2, 0.0);
04638
04639 double lower = 0.0;
04640
04641 double Delta_lambda = 0.0;
04642
04643 double delta_lambda = 0.0;
04644
04645
04646
04647 double Felplpredictor = 0.0;
04648
04649
04650
04651
04652
04653
04654
04655
04656
04657
04658
04659
04660
04661 double Ftolerance = 1.0e-8;
04662
04663
04664
04665
04666
04667
04668
04669
04670
04671
04672
04673
04674
04675 tensor aC(2, def_dim_2, 0.0);
04676
04677 stresstensor BEstress;
04678
04679 stresstensor residual;
04680
04681 tensor d2Qoverds2( 4, def_dim_4, 0.0);
04682
04683 tensor T( 4, def_dim_4, 0.0);
04684
04685 tensor Tinv( 4, def_dim_4, 0.0);
04686
04687
04688
04689 double Fold = 0.0;
04690
04691 tensor temp3lower;
04692
04693 tensor temp5;
04694
04695 double temp6 = 0.0;
04696
04697 double upper = 0.0;
04698
04699
04700
04701 stresstensor dsigma;
04702
04703
04704
04705 stresstensor sigmaBack;
04706
04707 straintensor dPlasticStrain;
04708
04709 straintensor PlasticStrain;
04710
04711 straintensor incrPlasticStrain;
04712
04713
04714
04715
04716
04717
04718
04719
04720
04721
04722
04723
04724
04725 int step_counter = 0;
04726
04727
04728
04729
04730
04731
04732
04733
04734
04735 straintensor strain_incr = strain_increment;
04736
04737 strain_incr.null_indices();
04738
04739 stresstensor stress_increment = E("ijkl")*strain_incr("kl");
04740
04741 stress_increment.null_indices();
04742
04743
04744
04745
04746
04747
04748
04749
04750
04751 EPState ElasticPredictorEPS( startEPS );
04752
04753 stresstensor elastic_predictor_stress = start_stress + stress_increment;
04754
04755
04756
04757 ElasticPredictorEPS.setStress( elastic_predictor_stress );
04758
04759
04760
04761
04762
04763
04764
04765
04766
04767
04768
04769
04770
04771 stresstensor elastic_plastic_predictor_stress;
04772
04773 EPState EP_PredictorEPS( startEPS );
04774
04775
04776
04777
04778
04779
04780
04781
04782
04783
04784
04785
04786
04787
04788
04789
04790
04791
04792
04793 double f_pred = getYS()->f( &ElasticPredictorEPS );
04794
04795
04796
04797
04798
04799
04800
04801
04802
04803
04804
04805
04806
04807 double hardMod_ = 0.0;
04808
04809
04810
04811 double h_s[4] = {0.0, 0.0, 0.0, 0.0};
04812
04813 double xi_s[4] = {0.0, 0.0, 0.0, 0.0};
04814
04815 stresstensor h_t[4];
04816
04817 stresstensor xi_t[4];
04818
04819
04820
04821
04822
04823
04824
04825
04826
04827
04828
04829
04830
04831
04832
04833
04834
04835
04836
04837
04838
04839
04840
04841
04842
04843 if ( f_pred <= Ftolerance )
04844
04845 {
04846
04847
04848
04849
04850
04851 straintensor estrain = ElasticPredictorEPS.getElasticStrain();
04852
04853 straintensor tstrain = ElasticPredictorEPS.getStrain();
04854
04855 estrain = estrain + strain_increment;
04856
04857 tstrain = tstrain + strain_increment;
04858
04859 ElasticPredictorEPS.setElasticStrain( estrain );
04860
04861 ElasticPredictorEPS.setStrain( tstrain );
04862
04863 ElasticPredictorEPS.setdElasticStrain( strain_increment );
04864
04865
04866
04867
04868
04869 if ( getELT1() ) {
04870
04871 getELT1()->updateEeDm(&ElasticPredictorEPS, -st_vol, 0.0);
04872
04873 }
04874
04875
04876
04877
04878
04879 ElasticPredictorEPS.setEep(E);
04880
04881 ElasticPredictorEPS.setConverged(TRUE);
04882
04883
04884
04885
04886
04887 backwardEPS = ElasticPredictorEPS;
04888
04889
04890
04891
04892
04893
04894
04895
04896
04897
04898
04899
04900
04901
04902
04903
04904
04905 return backwardEPS;
04906
04907
04908
04909
04910
04911
04912
04913
04914
04915 }
04916
04917 if ( f_pred > Ftolerance )
04918
04919 {
04920
04921
04922
04923
04924
04925
04926
04927 EP_PredictorEPS = PredictorEPState( strain_incr);
04928
04929
04930
04931
04932
04933
04934
04935
04936
04937
04938
04939
04940
04941
04942
04943 Felplpredictor = getYS()->f(&EP_PredictorEPS);
04944
04945
04946
04947
04948
04949
04950
04951
04952
04953 if ( fabs(Felplpredictor) <= Ftolerance )
04954
04955 {
04956
04957
04958
04959 backwardEPS = EP_PredictorEPS;
04960
04961 return backwardEPS;
04962
04963
04964
04965
04966
04967 }
04968
04969
04970
04971
04972
04973
04974
04975
04976
04977
04978
04979
04980
04981
04982
04983
04984
04985
04986
04987
04988
04989
04990
04991
04992
04993
04994
04995
04996
04997
04998
04999
05000
05001
05002
05003
05004
05005
05006
05007
05008
05009
05010
05011
05012
05013
05014
05015
05016
05017
05018
05019
05020
05021
05022
05023
05024
05025
05026
05027
05028
05029
05030
05031
05032
05033
05034
05035
05036
05037
05038
05039
05040
05041
05042
05043
05044
05045
05046
05047
05048
05049
05050
05051
05052
05053
05054
05055
05056
05057
05058
05059
05060
05061
05062
05063
05064
05065
05066
05067
05068
05069
05070
05071
05072
05073
05074
05075
05076
05077
05078
05079
05080
05081
05082
05083
05084
05085
05086
05087
05088
05089
05090
05091
05092
05093
05094
05095
05096
05097
05098
05099
05100
05101
05102
05103
05104
05105
05106
05107
05108
05109
05110
05111
05112
05113
05114
05115
05116
05117
05118
05119
05120
05121
05122
05123
05124
05125
05126
05127
05128
05129
05130
05131
05132
05133
05134
05135
05136
05137
05138
05139
05140
05141
05142
05143
05144
05145
05146
05147
05148
05149
05150
05151
05152
05153
05154
05155
05156
05157
05158
05159
05160
05161
05162
05163
05164
05165
05166
05167
05168
05169
05170
05171
05172
05173
05174
05175
05176
05177
05178
05179
05180
05181
05182
05183
05184
05185
05186
05187
05188
05189
05190
05191
05192
05193
05194
05195
05196
05197
05198
05199
05200
05201
05202
05203
05204
05205
05206
05207
05208
05209
05210
05211
05212
05213
05214
05215
05216
05217
05218
05219
05220
05221
05222
05223
05224
05225
05226
05227
05228
05229
05230
05231
05232
05233
05234
05235
05236
05237
05238
05240
05242
05243
05244
05245
05246
05247
05248
05249
05250
05251
05252
05253
05254
05255
05256
05257
05258
05259
05260
05261
05262
05263
05264
05265
05266
05267
05268
05269
05270
05271
05272
05273
05274
05275
05276
05277
05278
05279
05280
05281
05282
05283
05284
05285
05286
05287
05288
05289
05290
05291
05292
05293
05294
05295
05296
05297 double Felplold = 0.0;
05298
05299 Delta_lambda = EP_PredictorEPS.Delta_lambda;
05300
05301 while (( fabs(fabs(Felplpredictor) - fabs(Felplold)) > 1.0e-6 )
05302
05303 && ( fabs(fabs(Felplpredictor) ) > 1.0e-5 )
05304
05305 && (step_counter < MAX_STEP_COUNT) )
05306
05307
05308
05309
05310
05311 {
05312
05313
05314
05315 aC = getPS()->dQods( &EP_PredictorEPS );
05316
05317 BEstress = elastic_predictor_stress - E("ijkl")*aC("kl")*Delta_lambda;
05318
05319
05320
05322
05323 BEstress.null_indices();
05324
05325
05326
05327
05328
05329
05330
05331
05332
05333 residual = EP_PredictorEPS.getStress() - BEstress;
05334
05335
05336
05337
05338
05339
05340
05341
05342
05343
05344
05346
05347
05348
05349
05350
05351
05352
05353 d2Qoverds2 = getPS()->d2Qods2( &EP_PredictorEPS );
05354
05355
05356
05357
05358
05359 T = I_ikjl + E("ijkl")*d2Qoverds2("klmn")*Delta_lambda;
05360
05361 T.null_indices();
05362
05363
05364
05365 Tinv = T.inverse();
05366
05367
05368
05369
05370
05371
05372
05373
05374
05375
05376
05377
05378
05379
05380
05381
05382
05383 dFods = getYS()->dFods( &EP_PredictorEPS );
05384
05385 dQods = getPS()->dQods( &EP_PredictorEPS );
05386
05387
05388
05389
05390
05391 tensor H( 2, def_dim_2, 0.0);
05392
05393 H = dQods;
05394
05395
05396
05397
05398
05399 Fold = getYS()->f( &EP_PredictorEPS );
05400
05401
05402
05403 lower = 0.0;
05404
05405
05406
05407
05408
05409
05410
05411
05412
05413
05414
05415
05416
05417
05418
05419
05420
05421
05422
05423 hardMod_ = 0.0;
05424
05425 tensor Hh(2, def_dim_2, 0.0);
05426
05427
05428
05429
05430
05431 if ( getELS1() ) {
05432
05433 h_s[0] = getELS1()->h_s( &EP_PredictorEPS, getPS());
05434
05435 xi_s[0] = getYS()->xi_s1( &EP_PredictorEPS );
05436
05437 hardMod_ = hardMod_ + h_s[0] * xi_s[0];
05438
05439 Hh = Hh + getPS()->d2Qodsds1( &EP_PredictorEPS ) *h_s[0] *Delta_lambda;
05440
05441 }
05442
05443
05444
05445
05446
05447 if ( getELS2() ) {
05448
05449 h_s[1] = getELS2()->h_s( &EP_PredictorEPS, getPS());
05450
05451 xi_s[1] = getYS()->xi_s2( &EP_PredictorEPS );
05452
05453 hardMod_ = hardMod_ + h_s[1] * xi_s[1];
05454
05455 Hh = Hh + getPS()->d2Qodsds2( &EP_PredictorEPS ) *h_s[1] *Delta_lambda;
05456
05457 }
05458
05459
05460
05461
05462
05463 if ( getELS3() ) {
05464
05465 h_s[2] = getELS3()->h_s( &EP_PredictorEPS, getPS());
05466
05467 xi_s[2] = getYS()->xi_s3( &EP_PredictorEPS );
05468
05469 hardMod_ = hardMod_ + h_s[2] * xi_s[2];
05470
05471 Hh = Hh + getPS()->d2Qodsds3( &EP_PredictorEPS ) *h_s[2] *Delta_lambda;
05472
05473 }
05474
05475
05476
05477
05478
05479 if ( getELS4() ) {
05480
05481 h_s[3] = getELS4()->h_s( &EP_PredictorEPS, getPS());
05482
05483 xi_s[3] = getYS()->xi_s4( &EP_PredictorEPS );
05484
05485 hardMod_ = hardMod_ + h_s[3] * xi_s[3];
05486
05487 Hh = Hh + getPS()->d2Qodsds4( &EP_PredictorEPS ) *h_s[3] *Delta_lambda;
05488
05489 }
05490
05491
05492
05493
05494
05495
05496
05497 if ( getELT1() ) {
05498
05499 h_t[0] = getELT1()->h_t( &EP_PredictorEPS, getPS());
05500
05501 xi_t[0] = getYS()->xi_t1( &EP_PredictorEPS );
05502
05503 tensor hm = (h_t[0])("ij") * (xi_t[0])("ij");
05504
05505 hardMod_ = hardMod_ + hm.trace();
05506
05507 Hh = Hh + (getPS()->d2Qodsdt1( &EP_PredictorEPS ))("ijmn") *(h_t[0])("mn") *Delta_lambda;
05508
05509 }
05510
05511
05512
05513
05514
05515 if ( getELT2() ) {
05516
05517 h_t[1] = getELT2()->h_t( &EP_PredictorEPS, getPS());
05518
05519 xi_t[1] = getYS()->xi_t2( &EP_PredictorEPS );
05520
05521 tensor hm = (h_t[1])("ij") * (xi_t[1])("ij");
05522
05523 hardMod_ = hardMod_ + hm.trace();
05524
05525 Hh = Hh + (getPS()->d2Qodsdt2( &EP_PredictorEPS ))("ijmn") *(h_t[1])("mn") *Delta_lambda;
05526
05527 }
05528
05529
05530
05531
05532
05533 if ( getELT3() ) {
05534
05535 h_t[2] = getELT3()->h_t( &EP_PredictorEPS, getPS());
05536
05537 xi_t[2] = getYS()->xi_t3( &EP_PredictorEPS );
05538
05539 tensor hm = (h_t[2])("ij") * (xi_t[2])("ij");
05540
05541 hardMod_ = hardMod_ + hm.trace();
05542
05543 Hh = Hh + (getPS()->d2Qodsdt3( &EP_PredictorEPS ))("ijmn") *(h_t[2])("mn") *Delta_lambda;
05544
05545 }
05546
05547
05548
05549
05550
05551 if ( getELT4() ) {
05552
05553 h_t[3] = getELT4()->h_t( &EP_PredictorEPS, getPS());
05554
05555 xi_t[3] = getYS()->xi_t4( &EP_PredictorEPS );
05556
05557 tensor hm = (h_t[3])("ij") * (xi_t[3])("ij");
05558
05559 hardMod_ = hardMod_ + hm.trace();
05560
05561 Hh = Hh + (getPS()->d2Qodsdt4( &EP_PredictorEPS ))("ijmn") *(h_t[3])("mn") *Delta_lambda;
05562
05563 }
05564
05565
05566
05567
05568
05569
05570
05571
05572
05573
05574
05575
05576
05577
05578
05579
05580
05581
05582
05583
05584
05585 Hh.null_indices();
05586
05587
05588
05589 H = H + Hh;
05590
05591
05592
05593 temp3lower = dFods("mn")*Tinv("ijmn")*E("ijkl")*H("kl");
05594
05595 temp3lower.null_indices();
05596
05597 lower = temp3lower.trace();
05598
05599 lower = lower - hardMod_;
05600
05601
05602
05603
05604
05605 temp5 = (residual("ij") * Tinv("ijmn")) * dFods("mn");
05606
05607 temp6 = temp5.trace();
05608
05609
05610
05611
05612
05613
05614
05615
05616
05617 upper = Fold - temp6;
05618
05619
05620
05621
05622
05623
05624
05625 delta_lambda = upper / lower;
05626
05627
05628
05629 Delta_lambda = Delta_lambda + delta_lambda;
05630
05631 if ( Delta_lambda < 0.0 ) Delta_lambda = 0.0;
05632
05633
05634
05635
05636
05637 dPlasticStrain = dQods("kl") * delta_lambda;
05638
05639 incrPlasticStrain = incrPlasticStrain + dPlasticStrain;
05640
05641
05642
05643 straintensor estrain = EP_PredictorEPS.getElasticStrain();
05644
05645 straintensor tstrain = EP_PredictorEPS.getStrain();
05646
05647 straintensor pstrain = tstrain - estrain;
05648
05649 pstrain = pstrain + incrPlasticStrain;
05650
05651 estrain = tstrain - pstrain;
05652
05653 EP_PredictorEPS.setElasticStrain( estrain );
05654
05655 EP_PredictorEPS.setPlasticStrain( pstrain );
05656
05657 EP_PredictorEPS.setdPlasticStrain( incrPlasticStrain );
05658
05659 straintensor incrElasticStrain = incrPlasticStrain * (-1.0);
05660
05661 EP_PredictorEPS.setdElasticStrain( incrElasticStrain );
05662
05663 EP_PredictorEPS.Delta_lambda = Delta_lambda;
05664
05665
05666
05667
05668
05669
05670
05671 int err;
05672
05673 if ( getELT1() ) {
05674
05675 double pl_st_vol = pstrain.Iinvariant1();
05676
05677
05678
05679 err = getELT1()->updateEeDm(&EP_PredictorEPS, pl_st_vol, Delta_lambda);
05680
05681 }
05682
05683
05684
05685
05686
05687
05688
05689
05690
05691
05692
05693
05694
05695
05696
05697
05698
05699
05700
05701 dsigma = ( (residual("ij")*Tinv("ijmn") )+
05702
05703 ( (E("ijkl")*H("kl"))*Tinv("ijmn")*delta_lambda) )*(-1.0);
05704
05705 dsigma.null_indices();
05706
05707
05708
05709 sigmaBack = EP_PredictorEPS.getStress() + dsigma;
05710
05711 EP_PredictorEPS.setStress(sigmaBack);
05712
05713
05714
05715
05716
05717
05718
05719
05720
05721
05722
05723
05724
05725
05726
05727
05728
05729
05730
05731
05732
05733
05734
05735
05736
05737
05738
05739
05740
05741 int NS = EP_PredictorEPS.getNScalarVar();
05742
05743 int NT = EP_PredictorEPS.getNTensorVar();
05744
05745
05746
05747 double dS = 0;
05748
05749 double S = 0;
05750
05751
05752
05753
05754
05755 stresstensor dT;
05756
05757 stresstensor T;
05758
05759 stresstensor new_T;
05760
05761
05762
05763
05764
05765 int ii;
05766
05767 for (ii = 1; ii <= NS; ii++) {
05768
05769 dS = delta_lambda * h_s[ii-1] ;
05770
05771 S = EP_PredictorEPS.getScalarVar(ii);
05772
05773 EP_PredictorEPS.setScalarVar(ii, S + dS );
05774
05775 }
05776
05777
05778
05779 for (ii = 1; ii <= NT; ii++) {
05780
05781 dT = h_t[ii-1] * delta_lambda;
05782
05783 T = EP_PredictorEPS.getTensorVar(ii);
05784
05785 new_T = T + dT;
05786
05787 EP_PredictorEPS.setTensorVar(ii, new_T );
05788
05789 }
05790
05791
05792
05793 Felplold = Felplpredictor;
05794
05795 Felplpredictor = getYS()->f( &EP_PredictorEPS );
05796
05797
05798
05799
05800
05801
05802
05803
05804
05805
05806
05807
05808
05809
05810
05811
05812
05813
05814
05815
05816
05817
05818
05819
05820
05821
05822
05823
05824
05825
05826
05827
05828
05829
05830
05831
05832
05833
05834
05835
05836
05837
05838
05839
05840
05841
05842
05843
05844
05845
05846
05847
05848
05849
05850
05851
05852
05853
05854
05855
05856
05857
05858
05859
05860
05861
05862
05863
05864
05865
05866
05867
05868
05869
05870
05871
05872
05873
05874
05875
05876
05877
05878
05879
05880
05881
05882
05883
05884
05885
05886
05887
05888
05889
05890
05891
05892
05893
05894
05895
05896
05897
05898
05899
05900
05901
05902
05903
05904
05905
05906
05907
05908
05909
05910
05911
05912
05913
05914
05915
05916
05917
05918
05919
05920
05921
05922
05923
05924
05925
05926
05927
05928
05929
05930
05931
05932
05933
05934
05935
05936
05937
05938
05939
05940
05941
05942
05943
05944
05945
05946
05947
05948
05949
05950
05951
05952
05953
05954
05955
05956
05957 step_counter++;
05958
05959
05960
05961
05962
05963
05964
05965
05966
05967
05968
05969
05970
05971
05972
05973
05974
05975 }
05976
05977
05978
05979
05980
05981
05982
05983
05984
05985
05986
05987
05988
05990
05991 if ( step_counter >= MAX_STEP_COUNT )
05992
05993 {
05994
05995
05996
05997
05998
05999 opserr << "Template3Dep::BackwardEuler(), failed to converge in " << step_counter << "steps!!!" << '\n';
06000
06001 EP_PredictorEPS.setConverged( false );
06002
06003 exit(1);
06004
06005
06006
06007 }
06008
06009
06010
06011
06012
06013
06014
06015
06016
06017
06018
06019
06020
06021
06022
06023
06024
06025
06026
06027
06028
06029
06030
06031
06032
06033
06034
06035
06036
06037
06038
06039
06040
06041
06042
06043
06044
06045
06046
06047
06048
06049
06050
06051
06052
06053
06054
06055
06056
06057
06058
06059
06060
06061 tensor I2("I", 2, def_dim_2);
06062
06063 tensor I_ijkl = I2("ij")*I2("kl");
06064
06065 I_ijkl.null_indices();
06066
06067 tensor I_ikjl = I_ijkl.transpose0110();
06068
06069
06070
06071
06072
06073 dQods = getPS()->dQods( &EP_PredictorEPS );
06074
06075 tensor temp2 = E("ijkl")*dQods("kl");
06076
06077 temp2.null_indices();
06078
06079 dFods = getYS()->dFods( &EP_PredictorEPS );
06080
06081 d2Qoverds2 = getPS()->d2Qods2( &EP_PredictorEPS );
06082
06083
06084
06085 tensor T = I_ikjl + E("ijkl")*d2Qoverds2("klmn")*Delta_lambda;
06086
06087
06088
06089
06090
06091
06092
06093 T.null_indices();
06094
06095 tensor Tinv = T.inverse();
06096
06097
06098
06099 tensor R = Tinv("ijmn")*E("ijkl");
06100
06101 R.null_indices();
06102
06103
06104
06105 tensor Hh(2, def_dim_2, 0.0);
06106
06107
06108
06109 tensor H(2, def_dim_2, 0.0);
06110
06111 H =dQods;
06112
06113
06114
06115
06116
06117 if ( getELS1() ) {
06118
06119 h_s[0] = getELS1()->h_s( &EP_PredictorEPS, getPS());
06120
06121 xi_s[0] = getYS()->xi_s1( &EP_PredictorEPS );
06122
06123 hardMod_ = hardMod_ + h_s[0] * xi_s[0];
06124
06125 Hh = Hh + getPS()->d2Qodsds1( &EP_PredictorEPS ) *h_s[0] *Delta_lambda;
06126
06127 }
06128
06129
06130
06131
06132
06133 if ( getELS2() ) {
06134
06135 h_s[1] = getELS2()->h_s( &EP_PredictorEPS, getPS());
06136
06137 xi_s[1] = getYS()->xi_s2( &EP_PredictorEPS );
06138
06139 hardMod_ = hardMod_ + h_s[1] * xi_s[1];
06140
06141 Hh = Hh + getPS()->d2Qodsds2( &EP_PredictorEPS ) *h_s[1] *Delta_lambda;
06142
06143 }
06144
06145
06146
06147
06148
06149 if ( getELS3() ) {
06150
06151 h_s[2] = getELS3()->h_s( &EP_PredictorEPS, getPS());
06152
06153 xi_s[2] = getYS()->xi_s3( &EP_PredictorEPS );
06154
06155 hardMod_ = hardMod_ + h_s[2] * xi_s[2];
06156
06157 Hh = Hh + getPS()->d2Qodsds3( &EP_PredictorEPS ) *h_s[2] *Delta_lambda;
06158
06159 }
06160
06161
06162
06163
06164
06165 if ( getELS4() ) {
06166
06167 h_s[3] = getELS4()->h_s( &EP_PredictorEPS, getPS());
06168
06169 xi_s[3] = getYS()->xi_s4( &EP_PredictorEPS );
06170
06171 hardMod_ = hardMod_ + h_s[3] * xi_s[3];
06172
06173 Hh = Hh + getPS()->d2Qodsds4( &EP_PredictorEPS ) *h_s[3] *Delta_lambda;
06174
06175 }
06176
06177
06178
06179
06180
06181
06182
06183 if ( getELT1() ) {
06184
06185 h_t[0] = getELT1()->h_t( &EP_PredictorEPS, getPS());
06186
06187 xi_t[0] = getYS()->xi_t1( &EP_PredictorEPS );
06188
06189 tensor hm = (h_t[0])("ij") * (xi_t[0])("ij");
06190
06191 hardMod_ = hardMod_ + hm.trace();
06192
06193 Hh = Hh + (getPS()->d2Qodsdt1( &EP_PredictorEPS ))("ijmn") *(h_t[0])("mn") *Delta_lambda;
06194
06195 }
06196
06197
06198
06199
06200
06201 if ( getELT2() ) {
06202
06203 h_t[1] = getELT2()->h_t( &EP_PredictorEPS, getPS());
06204
06205 xi_t[1] = getYS()->xi_t2( &EP_PredictorEPS );
06206
06207 tensor hm = (h_t[1])("ij") * (xi_t[1])("ij");
06208
06209 hardMod_ = hardMod_ + hm.trace();
06210
06211 Hh = Hh + (getPS()->d2Qodsdt2( &EP_PredictorEPS ))("ijmn") *(h_t[1])("mn") *Delta_lambda;
06212
06213 }
06214
06215
06216
06217
06218
06219 if ( getELT3() ) {
06220
06221 h_t[2] = getELT3()->h_t( &EP_PredictorEPS, getPS());
06222
06223 xi_t[2] = getYS()->xi_t3( &EP_PredictorEPS );
06224
06225 tensor hm = (h_t[2])("ij") * (xi_t[2])("ij");
06226
06227 hardMod_ = hardMod_ + hm.trace();
06228
06229 Hh = Hh + (getPS()->d2Qodsdt3( &EP_PredictorEPS ))("ijmn") *(h_t[2])("mn") *Delta_lambda;
06230
06231 }
06232
06233
06234
06235
06236
06237 if ( getELT4() ) {
06238
06239 h_t[3] = getELT4()->h_t( &EP_PredictorEPS, getPS());
06240
06241 xi_t[3] = getYS()->xi_t4( &EP_PredictorEPS );
06242
06243 tensor hm = (h_t[3])("ij") * (xi_t[3])("ij");
06244
06245 hardMod_ = hardMod_ + hm.trace();
06246
06247 Hh = Hh + (getPS()->d2Qodsdt4( &EP_PredictorEPS ))("ijmn") *(h_t[3])("mn") *Delta_lambda;
06248
06249 }
06250
06251
06252
06253 H = H + Hh;
06254
06255
06256
06257
06258
06259
06260
06261 tensor temp3lower = dFods("ot")*R("otpq")*H("pq");
06262
06263 temp3lower.null_indices();
06264
06265
06266
06267 double lower = temp3lower.trace();
06268
06269
06270
06271 lower = lower - hardMod_;
06272
06273
06274
06275
06276
06277
06278
06279
06280
06281
06282
06283 tensor upper11 = R("pqkl")*H("kl");
06284
06285 tensor upper22 = dFods("ij")*R("ijmn");
06286
06287 upper11.null_indices();
06288
06289 upper22.null_indices();
06290
06291 tensor upper = upper11("pq")*upper22("mn");
06292
06293
06294
06295 upper.null_indices();
06296
06297 tensor Ep = upper*(1./lower);
06298
06299 tensor Eep = R - Ep;
06300
06301
06302
06303
06304
06305
06306
06307
06308
06309 EP_PredictorEPS.setEep(Eep);
06310
06311 EP_PredictorEPS.setConverged(TRUE);
06312
06313
06314
06315
06316
06317
06318
06319
06320
06321
06322
06323
06324
06325
06326
06327
06328
06329
06330
06331
06332
06333
06334
06335
06336
06337
06338
06339
06340
06341
06342
06343
06344
06345
06346
06347
06348
06349
06350
06351
06352
06353
06354
06355
06356
06357
06358
06359
06360
06361
06362
06363
06364
06365
06366
06367
06368
06369 backwardEPS = EP_PredictorEPS;
06370
06371
06372
06373
06374
06375
06376
06377
06378
06379 }
06380
06381
06382
06383
06384
06385
06386
06387
06388
06389
06390
06391
06392
06393
06394
06395
06396
06397
06398
06399
06400
06401
06402
06403 return backwardEPS;
06404
06405 }
06406
06407
06408
06409
06410
06411
06412
06413
06414
06415
06416
06417
06418
06419
06420
06421 EPState Template3Dep::FESubIncrementation( const straintensor & strain_increment,
06422
06423 int number_of_subincrements)
06424
06425 {
06426
06427
06428
06429 EPState old_EPS( *(this->getEPS()) );
06430
06431 EPState FESI_EPS( *(this->getEPS()) );
06432
06433
06434
06435
06436
06437
06438
06439
06440
06441 stresstensor back_stress;
06442
06443 stresstensor begin_stress = this->getEPS()->getStress();
06444
06445
06446
06447
06448
06449
06450
06451 double sub = 1./( (double) number_of_subincrements );
06452
06453
06454
06455
06456
06457 straintensor tempp = strain_increment;
06458
06459 straintensor elastic_subincremental_strain = tempp * sub;
06460
06461 straintensor total_strain = elastic_subincremental_strain;
06462
06463
06464
06465
06466
06467
06468
06469
06470
06471 for( int steps=0 ; steps < number_of_subincrements ; steps++ ){
06472
06473
06474
06475
06476
06477 FESI_EPS = ForwardEulerEPState( elastic_subincremental_strain);
06478
06479
06480
06481
06482
06483 this->setEPS( FESI_EPS );
06484
06485
06486
06487 back_stress = FESI_EPS.getStress();
06488
06489
06490
06491
06492
06493
06494
06495
06496
06497
06498
06499
06500
06501
06502
06503
06504
06505
06506
06507
06508
06509
06510
06511
06512
06513
06514
06515
06516
06517
06518
06519
06520
06521
06522
06523
06524
06525
06526
06527
06528
06529
06530
06531
06532
06533
06534
06535
06536
06537
06538
06539 }
06540
06541
06542
06543
06544
06545 this->setEPS( old_EPS );
06546
06547 return FESI_EPS;
06548
06549
06550
06551 }
06552
06553
06554
06555
06556
06557
06558
06559
06560
06561
06562
06563
06564
06565 EPState Template3Dep::BESubIncrementation( const straintensor & strain_increment,
06566
06567 int number_of_subincrements)
06568
06569 {
06570
06571 EPState old_EPS( *(this->getEPS()) );
06572
06573 EPState BESI_EPS( *(this->getEPS()) );
06574
06575 straintensor strain_incr = strain_increment;
06576
06577
06578
06579
06580
06581
06582
06583
06584
06585 stresstensor back_stress;
06586
06587 stresstensor begin_stress = old_EPS.getStress();
06588
06589
06590
06591
06592
06593
06594
06595
06596
06597 double sub = 1./( (double) number_of_subincrements );
06598
06599
06600
06601
06602
06603 straintensor elastic_subincremental_strain = strain_incr * sub;
06604
06605 straintensor total_strain = elastic_subincremental_strain;
06606
06607
06608
06609
06610
06611 for( int steps=0 ; steps < number_of_subincrements ; steps++ ){
06612
06613
06614
06615
06616
06617 BESI_EPS = BackwardEulerEPState( elastic_subincremental_strain);
06618
06619 if ( BESI_EPS.getConverged() )
06620
06621 this->setEPS( BESI_EPS );
06622
06623 else {
06624
06625
06626
06627 opserr << "Template3Dep::BESubIncrementation failed to converge at " << steps << "th(of "
06628
06629 << number_of_subincrements << "step sub-BackwardEuler Algor.\n";
06630
06631
06632
06633
06634
06635
06636
06637
06638
06639
06640
06641
06642
06643
06644
06645
06646
06647
06648
06649
06650
06651
06652
06653
06654
06655
06656
06657
06658
06659
06660
06661
06662
06663
06664
06665
06666
06667
06668
06669
06670
06671
06672
06673
06674
06675
06676
06677
06678
06679
06680
06681 opserr.width(7);
06682
06683 opserr << "\n intraStep: begin-stress p " << begin_stress.p_hydrostatic() << " ";
06684
06685 opserr.width(7);
06686
06687 opserr << "q " << begin_stress.q_deviatoric() << " ";
06688
06689 opserr.width(7);
06690
06691 opserr << "alfa1 " << old_EPS.getScalarVar(1) << " ";
06692
06693
06694
06695
06696
06697
06698
06699 opserr << "strain increment " << strain_incr << endln;
06700
06701
06702
06703
06704
06705 break;
06706
06707
06708
06709
06710
06711
06712
06713 }
06714
06715
06716
06717 }
06718
06719
06720
06721
06722
06723
06724
06725 return BESI_EPS;
06726
06727
06728
06729 }
06730
06731
06732
06733
06734
06735
06736
06738
06740
06742
06743
06744
06745
06746
06747
06748
06749
06750
06751
06752
06753
06754
06755
06756
06757
06758
06759
06760
06761
06762
06763
06764
06765
06766
06767
06768
06769
06770
06771
06772
06773
06774
06775
06776
06777
06778
06780
06782
06784
06785
06786
06787
06788
06789
06790
06791
06792
06793
06794
06795
06796
06797
06798
06799
06800
06801
06802
06803
06804
06805
06806
06807
06808
06809
06810
06811
06812
06813
06814
06815
06816
06817
06818
06819
06820
06821
06822
06823
06824
06825
06826
06827
06828
06829
06830
06831
06832
06833
06834
06835
06836
06837
06838
06839
06840
06841
06842
06843
06844
06845
06846
06847 stresstensor Template3Dep::yield_surface_cross(const stresstensor & start_stress,
06848
06849 const stresstensor & end_stress)
06850
06851 {
06852
06853
06854
06855 double x1 = 0.0;
06856
06857 double x2 = 1.0;
06858
06859
06860
06861
06862
06863 double const TOL = 1.0e-9;
06864
06865
06866
06867
06868
06869
06870
06871
06872
06873 double a = zbrentstress( start_stress, end_stress, x1, x2, TOL );
06874
06875
06876
06877
06878
06879 stresstensor delta_stress = end_stress - start_stress;
06880
06881 stresstensor intersection_stress = start_stress + delta_stress * a;
06882
06883
06884
06885
06886
06887 return intersection_stress;
06888
06889
06890
06891 }
06892
06893
06894
06895
06896
06897
06898
06899
06900
06901
06902
06903
06904
06905
06906
06907 double Template3Dep::zbrentstress(const stresstensor & start_stress,
06908
06909 const stresstensor & end_stress,
06910
06911 double x1, double x2, double tol)
06912
06913 {
06914
06915 double EPS = d_macheps();
06916
06917
06918
06919 int iter;
06920
06921 double a=x1;
06922
06923 double b=x2;
06924
06925 double c=0.0;
06926
06927 double d=0.0;
06928
06929 double e=0.0;
06930
06931 double min1=0.0;
06932
06933 double min2=0.0;
06934
06935 double fa=func(start_stress, end_stress, a);
06936
06937 double fb=func(start_stress, end_stress, b);
06938
06939
06940
06941
06942
06943 double fc=0.0;
06944
06945 double p=0.0;
06946
06947 double q=0.0;
06948
06949 double r=0.0;
06950
06951 double s=0.0;
06952
06953 double tol1=0.0;
06954
06955 double xm=0.0;
06956
06957
06958
06959 if (fb*fa > 0.0)
06960
06961 {
06962
06963 ::printf("\a\nRoot must be bracketed in ZBRENTstress\n");
06964
06965 ::exit(1);
06966
06967 }
06968
06969 fc=fb;
06970
06971 for ( iter=1 ; iter<=ITMAX ; iter++ )
06972
06973 {
06974
06975
06976
06977 if (fb*fc > 0.0)
06978
06979 {
06980
06981 c=a;
06982
06983 fc=fa;
06984
06985 e=d=b-a;
06986
06987 }
06988
06989 if (fabs(fc) < fabs(fb))
06990
06991 {
06992
06993 a=b;
06994
06995 b=c;
06996
06997 c=a;
06998
06999 fa=fb;
07000
07001 fb=fc;
07002
07003 fc=fa;
07004
07005 }
07006
07007 tol1=2.0*EPS*fabs(b)+0.5*tol;
07008
07009 xm=0.5*(c-b);
07010
07011 if (fabs(xm) <= tol1 || fb == 0.0) return b;
07012
07013 if (fabs(e) >= tol1 && fabs(fa) > fabs(fb))
07014
07015 {
07016
07017 s=fb/fa;
07018
07019 if (a == c)
07020
07021 {
07022
07023 p=2.0*xm*s;
07024
07025 q=1.0-s;
07026
07027 }
07028
07029 else
07030
07031 {
07032
07033 q=fa/fc;
07034
07035 r=fb/fc;
07036
07037 p=s*(2.0*xm*q*(q-r)-(b-a)*(r-1.0));
07038
07039 q=(q-1.0)*(r-1.0)*(s-1.0);
07040
07041 }
07042
07043 if (p > 0.0) q = -q;
07044
07045 p=fabs(p);
07046
07047 min1=3.0*xm*q-fabs(tol1*q);
07048
07049 min2=fabs(e*q);
07050
07051 if (2.0*p < (min1 < min2 ? min1 : min2))
07052
07053 {
07054
07055 e=d;
07056
07057 d=p/q;
07058
07059 }
07060
07061 else
07062
07063 {
07064
07065 d=xm;
07066
07067 e=d;
07068
07069 }
07070
07071 }
07072
07073 else
07074
07075 {
07076
07077 d=xm;
07078
07079 e=d;
07080
07081 }
07082
07083 a=b;
07084
07085 fa=fb;
07086
07087 if (fabs(d) > tol1)
07088
07089 b += d;
07090
07091 else
07092
07093 b += (xm > 0.0 ? fabs(tol1) : -fabs(tol1));
07094
07095 fb=func(start_stress, end_stress, b);
07096
07097 }
07098
07099
07100
07101 return 0.0;
07102
07103 }
07104
07105
07106
07107
07108
07109
07110
07111
07112
07113
07114
07115
07116
07117 double Template3Dep::func(const stresstensor & start_stress,
07118
07119 const stresstensor & end_stress,
07120
07121 double alfa )
07122
07123 {
07124
07125
07126
07127
07128
07129 EPState tempEPS( (*this->getEPS()) );
07130
07131 stresstensor delta_stress = end_stress - start_stress;
07132
07133 stresstensor intersection_stress = start_stress + delta_stress*alfa;
07134
07135
07136
07137 tempEPS.setStress(intersection_stress);
07138
07139
07140
07141
07142
07143
07144
07145 double f = getYS()->f( &tempEPS );
07146
07147 return f;
07148
07149 }
07150
07151
07152
07153
07154
07155
07156
07157
07158
07159
07160
07161 OPS_Stream& operator<< (OPS_Stream& os, const Template3Dep & MP)
07162
07163 {
07164
07165 os << endln << "Template3Dep: " << endln;
07166
07167 os << "\ttag: " << MP.getTag() << endln;
07168
07169 os << "=================================================================" << endln;
07170
07171 MP.getYS()->print();
07172
07173 MP.getPS()->print();
07174
07175 MP.getEPS()->print();
07176
07177
07178
07179 os << endln << "Scalar Evolution Laws: " << endln;
07180
07181 if ( MP.ELS1 ){
07182
07183 os << "\nFor 1st scalar var:\n";
07184
07185 MP.ELS1->print();
07186
07187 }
07188
07189
07190
07191 if ( MP.ELS2 ){
07192
07193 os << "\nFor 2nd scalar var:\n";
07194
07195 MP.ELS2->print();
07196
07197 }
07198
07199
07200
07201 if ( MP.ELS3 ){
07202
07203 os << "\nFor 3rd scalar var:\n";
07204
07205 MP.ELS3->print();
07206
07207 }
07208
07209
07210
07211 if ( MP.ELS4 ){
07212
07213 os << "\nFor 4th scalar var:\n";
07214
07215 MP.ELS4->print();
07216
07217 }
07218
07219
07220
07221
07222
07223 os << endln << "Tensorial Evolution Laws: " << endln;
07224
07225 if ( MP.ELT1 ){
07226
07227 os << "\nFor 1st tensorial var:\n";
07228
07229 MP.ELT1->print();
07230
07231 }
07232
07233 if ( MP.ELT2 ){
07234
07235 os << "\nFor 2nd tensorial var:\n";
07236
07237 MP.ELT2->print();
07238
07239 }
07240
07241 if ( MP.ELT3 ){
07242
07243 os << "\nFor 3rd tensorial var:\n";
07244
07245 MP.ELT3->print();
07246
07247 }
07248
07249 if ( MP.ELT4 ){
07250
07251 os << "\nFor 4th tensorial var:\n";
07252
07253 MP.ELT4->print();
07254
07255 }
07256
07257
07258
07259 os << endln;
07260
07261 return os;
07262
07263 }
07264
07265
07266
07267
07268
07269
07270
07271
07272
07273
07274
07275
07276
07277
07278
07279
07280
07281
07282
07283
07284
07285
07286
07287
07288
07289
07290
07291
07292
07293
07294
07295
07296
07297
07298
07299
07300
07301
07302
07303
07304
07305
07306
07307
07308
07309
07310
07311
07312
07313
07314
07315
07316
07317
07318
07319
07320
07321
07322
07323
07324
07325
07326
07327
07328
07329
07330
07331
07332
07333
07334
07335
07336
07337
07338
07339
07340
07341
07342
07343
07344
07345
07346
07347
07348
07349
07350
07351
07352
07353
07354
07355
07356
07357
07358
07359
07360
07361
07362
07363
07364
07365
07366
07367
07368
07369
07370
07371
07372
07373
07374
07375
07376
07377
07378
07379
07380
07381
07382
07383
07384
07385
07386
07387
07388
07389
07390
07391
07392
07393
07394
07395
07396
07397
07398
07399
07400
07401
07402
07403
07404
07405
07406
07407
07408
07409
07410
07411
07412
07413
07414
07415
07416
07417
07418
07419
07420
07421
07422
07423
07424
07425
07426
07427
07428
07429
07430
07431
07432
07433
07434
07435
07436
07437
07438
07439
07440
07441
07442
07443
07444
07445
07446
07447
07448
07449
07450
07451
07452
07453
07454
07455
07456
07457
07458
07459
07460
07461
07462
07463
07464
07465
07466
07467
07468
07469
07470
07471
07472
07473
07474
07475
07476
07477
07478
07479
07480
07481
07482
07483
07484
07485
07486
07487
07488
07489
07490
07491
07492
07493
07494
07495
07496
07497
07498
07499
07500
07501
07502
07503
07504
07505
07506
07507
07508
07509
07510
07511
07512
07513
07514
07515
07516
07517
07518
07519
07520
07521
07522
07523
07524
07525
07526
07527
07528
07529
07530
07531
07532
07533
07534
07535
07536
07537
07538
07539
07540
07541
07542
07543
07544
07545
07546
07547
07548
07549
07550
07551
07552
07553
07554
07555
07556
07557
07558
07559
07560
07561
07562
07563
07564
07565
07566
07567
07568
07569
07570
07571
07572
07573
07574
07575
07576
07577 #endif
07578
07579
07580
07581
07582
07583
07584
07585
07586
07587
07588
07589
07590
07591
07592
07593
07594
07595
07596
07597
07598