PlasticHardening2D.cpp

Go to the documentation of this file.
00001 //
00002 //
00004 
00005 #include "PlasticHardening2D.h"
00006 #include <YieldSurface_BC.h>
00007 #include <math.h>
00008 
00009 #define strnDebug 0
00010 #define stifDebug 0
00012 // Construction/Destruction
00014 
00015 PlasticHardening2D::PlasticHardening2D(int tag, int classTag, double min_iso_factor,
00016                                 double iso_ratio, double kin_ratio,
00017                                  PlasticHardeningMaterial &kpx_pos,
00018                                  PlasticHardeningMaterial &kpx_neg,
00019                                  PlasticHardeningMaterial &kpy_pos,
00020                                  PlasticHardeningMaterial &kpy_neg, double dir)
00021 :YS_Evolution2D(tag, classTag, min_iso_factor, iso_ratio, kin_ratio),
00022 direction(dir), defPosX(true), defPosY(true)
00023 {
00024         if (dir < -1.0 || dir > 1.0)
00025         {
00026                 opserr << "WARNING: PlasticHardening2D() - Dir should be between -1 and +1\n";
00027                 opserr << "Set to 0 \n";
00028                 direction = 0.0;
00029         }
00030 
00031         kpMatXPos = kpx_pos.getCopy();
00032         kpMatXNeg = kpx_neg.getCopy();
00033         
00034         kpMatYPos = kpy_pos.getCopy();
00035         kpMatYNeg = kpy_neg.getCopy();
00036 }
00037 
00038 PlasticHardening2D::~PlasticHardening2D()
00039 {
00040   if (kpMatXPos != 0)
00041     delete kpMatXPos;
00042 
00043   if (kpMatXNeg != 0)
00044     delete kpMatXNeg;
00045 
00046   if (kpMatYPos != 0)
00047     delete kpMatYPos;
00048 
00049   if (kpMatYNeg != 0)
00050     delete kpMatYNeg;
00051 }
00052 
00053 int PlasticHardening2D::commitState()
00054 {
00055         this->YS_Evolution2D::commitState();
00056         
00057     int res  = kpMatXPos->commitState();
00058                 res += kpMatXNeg->commitState();
00059                 res += kpMatYPos->commitState();
00060                 res += kpMatYNeg->commitState();
00061 
00062         /*if(getTag() ==1)
00063         {
00064         if(stifDebug)
00065         {
00066                 double v0 = getIsoPlasticStiffness(0);
00067                 double v1 = getIsoPlasticStiffness(1);
00068                 opserr << v0 << "\t " << v1 << endln;
00069         }
00070     }*/
00071     
00072         return res;
00073 }
00074 
00075 int PlasticHardening2D::revertToLastCommit(void)
00076 {
00077         this->YS_Evolution2D::revertToLastCommit();
00078         
00079         kpMatXPos->revertToLastCommit();
00080         kpMatXNeg->revertToLastCommit();
00081         kpMatYPos->revertToLastCommit();
00082         kpMatYNeg->revertToLastCommit();
00083 
00084         return 0;
00085 }
00086 
00087 
00088 // In a plastic hardening material, Kp_iso == Kp_kin == Kp_equivalent
00089 void PlasticHardening2D::setTrialPlasticStrains(double lamda, const Vector &f, const Vector &g)
00090 {
00091 
00092 //      opserr << *tmpYSPtr;
00093         
00094         double epx = lamda*g(0);
00095         double epy = lamda*g(1);
00096 //      double val = f(0);
00097 //      double chk = 0.8;
00098 //      val = translate_hist(0);
00099 
00100         defPosX = true;
00101         if(epx < 0)
00102                 defPosX = false;
00103 
00104 //      kpMatXPos->setTrialIncrValue(epx);
00105 //      kpMatXNeg->setTrialIncrValue(-1*epx);
00106 // no need of if.. else - just for remembering the condition
00107 
00108 //      pinchX = false;
00109         if(defPosX)
00110         {
00111 //              if(val < -1*chk)
00112 //              {
00113 //                      opserr << "+Pinch [";
00114 //                      opserr << tmpYSPtr->ele_Location << "]\n";
00115 //                      pinchX = true;
00116 //              }
00117 //              else
00118                         kpMatXPos->setTrialIncrValue(epx);
00119 
00120                 kpMatXNeg->setTrialIncrValue(-1*epx);
00121         }
00122         else
00123         {
00124 //              if(val >  chk)
00125 //              {
00126 //                      opserr << "-Pinch [";
00127 //                      opserr << tmpYSPtr->ele_Location << "]\n";
00128 //                      pinchX = true;
00129 //              }
00130 //              else
00131                         kpMatXNeg->setTrialIncrValue(-1*epx);
00132 
00133                 kpMatXPos->setTrialIncrValue(epx);
00134         }
00135 
00136         defPosY = true;
00137         if(epy < 0)
00138                 defPosY = false;
00139 
00140     if(defPosY)
00141     {
00142         //       if(translate_hist(1) >= 0)
00143                         kpMatYPos->setTrialIncrValue(epy);
00144 
00145                 kpMatYNeg->setTrialIncrValue(-1*epy);
00146         }
00147         else
00148         {
00149         //       if(translate_hist(1) <= 0)
00150                         kpMatYNeg->setTrialIncrValue(-1*epy);
00151 
00152                 kpMatYPos->setTrialIncrValue(epy);
00153         }
00154 
00155         if(strnDebug)
00156         {
00157                 opserr << "epx = " << epx << ", epy = " << epy << endln;
00158                 opserr << "bool defPosX = " << defPosX << ", bool defPosY = " << defPosY << endln;
00159         }
00160 
00161 }
00162 
00163 const Vector &PlasticHardening2D::getEquiPlasticStiffness()
00164 {
00165         if(freezeEvolution)
00166         {
00167                 v2(0) = 0.0;
00168                 v2(1) = 0.0;
00169                 return v2;
00170         }
00171 
00172         if(defPosX == true)
00173           v2(0) =  kpMatXPos->getTrialPlasticStiffness();
00174          else
00175           v2(0) =  kpMatXNeg->getTrialPlasticStiffness();
00176 
00177 //      if(pinchX)
00178 //              v2(0) = 0.123*v2(0);
00179 
00180         if(defPosY == true)
00181           v2(1) =  kpMatYPos->getTrialPlasticStiffness();
00182         else
00183           v2(1) =  kpMatYNeg->getTrialPlasticStiffness();
00184 
00185 
00186         if(strnDebug)
00187                 opserr << "Kp " << v2;
00188 
00189         return v2;
00190 }
00191 
00192 double PlasticHardening2D::getTrialPlasticStrains(int dir)
00193 {
00194         if(dir == 0 && defPosX)
00195                 return kpMatXPos->getTrialValue();
00196         else if(dir == 0 && !defPosX)
00197                 return kpMatXNeg->getTrialValue();
00198         else if (dir == 1 && defPosY)
00199                 return kpMatYPos->getTrialValue();
00200         else if (dir == 1 && !defPosY)
00201                 return kpMatYNeg->getTrialValue();
00202         else
00203                 opserr << "PlasticHardening2D::getTrialPlasticStrains(double dir) - incorrect dir||condition \n";
00204         return 0;
00205 }
00206 
00207 double PlasticHardening2D::getCommitPlasticStrains(int dir)
00208 {
00209         opserr << "PlasticHardening2D::getCommitPlasticStrains(double dir) - not yet implemented \n";
00210         this->getTrialPlasticStrains(dir);
00211         return 0;
00212 }
00213 
00214 double PlasticHardening2D::getIsoPlasticStiffness(int dir)
00215 {
00216 double kp =0;
00217 
00218         if(dir == 0)
00219         {
00220                 if(defPosX)
00221                   kp = kpMatXPos->getTrialPlasticStiffness();
00222                 else
00223                   kp = kpMatXNeg->getTrialPlasticStiffness();
00224 
00225 //              if(pinchX)
00226 //                      kp = 0.123*kp;
00227         }
00228         else if (dir == 1)
00229         {
00230                 if(defPosY)
00231                   kp =  kpMatYPos->getTrialPlasticStiffness();
00232                  else
00233                   kp = kpMatYNeg->getTrialPlasticStiffness();
00234         }
00235         else
00236                 opserr << "WARNING: PlasticHardening2D::getPlasticStiffness(int dir) - incorrect dir\n";
00237         return kp;
00238 }
00239 
00240 double PlasticHardening2D::getKinPlasticStiffness(int dir)
00241 {
00242         return this->getIsoPlasticStiffness(dir);
00243 }
00244 
00245 Vector& PlasticHardening2D::getEvolDirection(Vector &f_new)
00246 {
00247         // -1 => Radial Evolution
00248         //  0 => From geometric center (~ normal)
00249         //  1 => Constant-P
00250 
00251         v2(0) = 0.0;
00252         if(direction >= 0)                 
00253                 v2(1) = direction*f_new(1);
00254         else
00255                 v2(1) = direction*translate_init(1);
00256         
00257         return v2;
00258 }
00259 
00260 void PlasticHardening2D::Print(OPS_Stream &s, int flag)
00261 {
00262         s << "PlasticHardening2D \n";
00263         s << "iso_Ratio = " << isotropicRatio << "\n";
00264         s << "isotropicFactor_hist = " << isotropicFactor_hist;
00265         s << "translateX       = " << translate(0) << ",\ttranslateY = " << translate(1) << "\n";
00266         s << "\n";
00267 }
00268 

Generated on Mon Oct 23 15:05:23 2006 for OpenSees by doxygen 1.5.0