00001
00002
00004
00005 #include "YS_Evolution2D.h"
00006 #include <YieldSurface_BC.h>
00007 #include <math.h>
00008 #include <MaterialResponse.h>
00009
00010 #define evolDebug 0
00011 #define modifDebug 0
00012 #define transDebug 0
00013
00014 Vector YS_Evolution2D::v2(2);
00015
00017
00019
00020 YS_Evolution2D::YS_Evolution2D(int tag, int classtag,
00021 double min_iso_factor,
00022 double iso_ratio, double kin_ratio)
00023 :YS_Evolution(tag, classtag, iso_ratio, kin_ratio, 2),
00024 minIsoFactor(min_iso_factor), softening(false)
00025 {
00026
00027
00028
00029
00030 isotropicFactor(0) = 1;
00031 isotropicFactor(1) = 1;
00032
00033 isotropicFactor_hist(0) = 1;
00034 isotropicFactor_hist(1) = 1;
00035
00036 }
00037
00038 YS_Evolution2D::~YS_Evolution2D()
00039 {
00040
00041 }
00042
00043 int YS_Evolution2D::commitState()
00044 {
00045 this->YS_Evolution::commitState();
00046
00047
00048
00049 freezeEvolution = false;
00050 return 0;
00051 }
00052
00053 int YS_Evolution2D::update(int flag)
00054 {
00055 isotropicFactor = isotropicFactor_hist;
00056 translate = translate_hist;
00057
00058 return 0;
00059 }
00060
00061 int YS_Evolution2D::revertToLastCommit(void)
00062 {
00063 this->YS_Evolution::revertToLastCommit();
00064
00065
00066 return 0;
00067 }
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 int YS_Evolution2D::evolveSurface(YieldSurface_BC *ys, double lamda,
00133 Vector &G, Vector &F_Surface, int flag)
00134 {
00135
00136 tmpYSPtr = ys;
00137
00138
00139
00140
00141
00142
00143
00144 Vector f_sur(2);
00145 f_sur(0) = F_Surface(0);
00146 f_sur(1) = F_Surface(1);
00147 Vector gl(2);
00148 gl(0) = G(0);
00149 gl(1) = G(1);
00150
00151 setTrialPlasticStrains(lamda, f_sur, gl);
00152 if(freezeEvolution)
00153 return 0;
00154
00155
00156
00157 double kinX = gl(0)*getKinPlasticStiffness(0)/ys->getCap(0);
00158 double kinY = gl(1)*getKinPlasticStiffness(1)/ys->getCap(1);
00159 double isoX = gl(0)*getIsoPlasticStiffness(0)/ys->getCap(0);
00160 double isoY = gl(1)*getIsoPlasticStiffness(1)/ys->getCap(1);
00161
00162
00163
00164
00165 double lamda_kin = kinematicRatio*lamda;
00166 double dfx_kin = lamda_kin*kinX;
00167 double dfy_kin = lamda_kin*kinY;
00168
00169
00170 double lamda_iso = isotropicRatio*lamda;
00171 double dfx_iso = lamda_iso*isoX;
00172 double dfy_iso = lamda_iso*isoY;
00173
00174 double dfx_total = dfx_kin + dfx_iso;
00175 double dfy_total = dfy_kin + dfy_iso;
00176
00177 double fx_new = f_sur(0) + dfx_total;
00178 double fy_new = f_sur(1) + dfy_total;
00179
00180 double fx_iso_new = f_sur(0) + dfx_iso;
00181 double fy_iso_new = f_sur(1) + dfy_iso;
00182
00183
00184
00185
00186
00187 bool ys_harden = true;
00188 toOriginalCoord(fx_new, fy_new);
00189 if(ys->getDrift(fx_new, fy_new) < 0)
00190 ys_harden = false;
00191
00192 bool iso_harden = true;
00193 toOriginalCoord(fx_iso_new, fy_iso_new);
00194 if(ys->getDrift(fx_iso_new, fy_iso_new) < 0)
00195 iso_harden = false;
00196
00197
00198 if(!ys_harden && (sign(f_sur(0)) != sign(fx_new)))
00199 {
00200
00201 dfx_iso = 0.0;
00202 dfx_kin = 0.0;
00203 opserr << "Condition happened..\n";
00204 opserr << *ys;
00205 freezeEvolution = true;
00206
00207
00208
00209
00210
00211
00212 {
00213
00214 return 0;
00215
00216
00217 }
00218 }
00219
00220 if(!ys_harden && (kinematicRatio != kinematicRatio_shrink)
00221 && (isotropicRatio != isotropicRatio_shrink) )
00222 {
00223 double kinRatio = kinematicRatio_shrink;
00224 double isoRatio = isotropicRatio_shrink;
00225
00226
00227
00228
00229 lamda_iso = isoRatio*lamda;
00230 dfx_iso = lamda_iso*isoX;
00231 dfy_iso = lamda_iso*isoY;
00232 lamda_kin = kinRatio*lamda;
00233 dfx_kin = lamda_kin*kinX;
00234 dfy_kin = lamda_kin*kinY;
00235
00236 dfx_total = dfx_kin + dfx_iso;
00237 dfy_total = dfy_kin + dfy_iso;
00238 fx_new = f_sur(0) + dfx_total;
00239 fy_new = f_sur(1) + dfy_total;
00240
00241 toOriginalCoord(fx_new, fy_new);
00242 if(ys->getDrift(fx_new, fy_new) > 0)
00243 {
00244 opserr << "oops: YS_Evolution2D::evolveSurface() - softens->hardens\n";
00245 ys_harden = true;
00246 }
00247 }
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265 int x_grow = 1, y_grow = 1;
00266 if(getIsoPlasticStiffness(0) < 0)
00267 x_grow = -1;
00268 if(getIsoPlasticStiffness(1) < 0)
00269 y_grow = -1;
00270
00271 if(evolDebug)
00272 {
00273 opserr << "F_Surface Vector: " << f_sur;
00274 opserr << "Fx_new = " << fx_new << ", Fy_new = " << fy_new << endln;
00275 opserr << "Gradient: " << gl;
00276 opserr << "KpxIso = " << getIsoPlasticStiffness(0) << ", KpyIso = " << getIsoPlasticStiffness(1) << endln;
00277 opserr << "F_surf(1) = " << f_sur(1) << ", dfy_iso = " << dfy_iso << endln;
00278 opserr << "x_grow = " << x_grow << ", y_grow = " << y_grow << endln;
00279 opserr << "---------------------------------------------------------" << endln;
00280 }
00281
00282 Vector mgnf(2);
00283 mgnf = isotropicFactor_hist;
00284 if(flag==1)
00285 mgnf = isotropicFactor;
00286 Vector delMag(2);
00287
00288 if(deformable)
00289 {
00290
00291 delMag(0) = x_grow*fabs(dfx_iso);
00292 delMag(1) = y_grow*fabs(dfy_iso);
00293 }
00294 else
00295 {
00296 double dR = sqrt(dfx_iso*dfx_iso + dfy_iso*dfy_iso);
00297 if(!iso_harden)
00298 dR = -1*dR;
00299 delMag(0) = dR;
00300 delMag(1) = dR;
00301 }
00302
00303 Vector isoFact = mgnf + delMag;
00304
00305
00306 if( (isotropicFactor(0) + delMag(0)) <= minIsoFactor)
00307 {
00308 delMag(0) = 0.0;
00309 dfx_kin = 0.0;
00310 freezeEvolution = true;
00311 if(!deformable)
00312 return 0;
00313 }
00314 if( (isotropicFactor(1) + delMag(1)) <= minIsoFactor)
00315 {
00316 delMag(1) = 0.0;
00317 dfy_kin = 0.0;
00318 freezeEvolution = true;
00319
00320 if(!deformable)
00321 return 0;
00322 }
00323
00324
00325 double fx_aim = f_sur(0) + dfx_kin;
00326 double fy_aim = f_sur(1) + dfy_kin;
00327
00328
00329
00330 toOriginalCoord(fx_aim, fy_aim);
00331 Vector f_aim(2);
00332 f_aim(0) = fx_aim;
00333 f_aim(1) = fy_aim;
00334 v2 = getEvolDirection(f_aim);
00335
00336 Vector df_kin = ys->translationTo(f_aim, v2);
00337
00338 Vector trans(2);
00339 trans = translate_hist;
00340 if(flag==1)
00341 trans = translate;
00342
00343
00344 translate(0) = trans(0) + df_kin(0)*isotropicFactor(0);
00345 translate(1) = trans(1) + df_kin(1)*isotropicFactor(1);
00346 isotropicFactor = mgnf + delMag;
00347
00348 return 0;
00349 }
00350
00351 int YS_Evolution2D::displaySelf(Renderer &theViewer, int displayMode, float fact)
00352 {
00353 return -1;
00354 }
00355
00356 Response* YS_Evolution2D::setResponse(char **argv, int argc, Information &matInfo)
00357 {
00358 return 0;
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394 }
00395
00396 int YS_Evolution2D::getResponse(int responseID, Information &matInfo)
00397 {
00398 return 0;
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432 }
00433
00434