Inelastic2DYS02.cpp

Go to the documentation of this file.
00001 // Inelastic2DYS02.cpp
00003  
00004 #include "Inelastic2DYS02.h"
00005 #include <CyclicModel.h>
00006 /*#include <QuadraticCyclic.h>
00007 #include <BilinearCyclic.h>
00008 #include <LinearCyclic.h>
00009  */
00011 // Construction/Destruction
00013 
00014 Inelastic2DYS02::Inelastic2DYS02(int tag, double a, double e, double iz,
00015                                  int Nd1, int Nd2,
00016                                  YieldSurface_BC *ysEnd1,
00017                                  YieldSurface_BC *ysEnd2,
00018                                  // int cyc_type, double wt,
00019                                  CyclicModel *cycModel,
00020                                  double delpmax,
00021                                  double Alfa, double Beta,
00022                                  int rf_algo, bool islinear, double rho
00023                                  )
00024   :InelasticYS2DGNL (tag, Nd1, Nd2, ysEnd1, ysEnd2,
00025                      rf_algo, islinear, rho),
00026   A(a), E(e), Iz(iz), resFactor(1.0),
00027   //cycType(cyc_type), wT(wt),
00028   alfa(Alfa), beta(Beta),
00029   delPmax(delpmax), delPMaxPos(0.0), delPMaxNeg(0.0)
00030 {
00031   massDof = A*L*rho;
00032   massDof = massDof/2;
00033 // cModel = new BilinearCyclic(1, 1.0);
00034 //  cModel = new LinearCyclic(1);
00035 //   cModel = new QuadraticCyclic(1, 1.0);
00036 /*
00037         if(wT < 0 || wT > 1)
00038         {
00039                 opserr << "wt out of range, set to 0.8\n";
00040                 wT = 0.8;
00041         }
00042 
00043         if(cyc_type == 2)
00044                 cModel = new QuadraticCyclic(tag, wT);
00045         else
00046                 cModel = new BilinearCyclic(tag, wT);
00047 */
00048 
00049         cModel = cycModel->getCopy();
00050 }
00051 
00052 Inelastic2DYS02::~Inelastic2DYS02()
00053 {
00054         delete cModel;
00055 }
00056 
00057 
00058 int Inelastic2DYS02::commitState()
00059 {       
00060         this->InelasticYS2DGNL::commitState();
00061 
00062 double dp = fabs(ys1->hModel->getTrialPlasticStrains(0));
00063            dp+= fabs(ys2->hModel->getTrialPlasticStrains(0));
00064 
00065 double  x=0;
00066         this->getTrialNaturalDisp(disp);
00067 double displ = -1*disp(2);
00068         if(fabs(disp(5)) > fabs(displ))
00069                 displ = -1*disp(5);
00070 
00071            if(displ < 0)
00072            {
00073                    if(dp > delPMaxNeg)
00074                            delPMaxNeg = dp;
00075                         x = fabs(delPMaxNeg/delPmax);
00076            }
00077            else
00078            {
00079                    if(dp > delPMaxPos)
00080                            delPMaxPos = dp;
00081                         x = fabs(delPMaxPos/delPmax);
00082        }
00083 // set the current peak plastk defo
00084 
00085         resFactor = 1*exp(-alfa*x) + beta;
00086         if(resFactor > 1.0)
00087                 resFactor = 1.0;
00088 
00089         cModel->commitState(resFactor);
00090         ys1->hModel->setResidual(cModel->getFactor());
00091         ys2->hModel->setResidual(cModel->getFactor());
00092 
00093 //      opserr << this->ys1->hModel->getTrialPlasticStrains(0) << endln;
00094         // double d = this->ys1->hModel->getTrialPlasticStrains(1);
00095 
00096         return 0;
00097 }
00098 
00099 int Inelastic2DYS02::update(void)
00100 {
00101 int res = this->InelasticYS2DGNL::update();
00102 
00103         // get x-axis for the cModel
00104         // using max natural deformation
00105         this->getTrialNaturalDisp(disp);
00106 double displ = -1*disp(2);
00107         if(fabs(disp(5)) > fabs(displ))
00108                 displ = -1*disp(5);
00109         // displ(2, 5) will have the same sign
00110         // for double curvature
00111 double fcurr = eleForce(4);
00112         
00113 bool yield = false;
00114         if(end1Plastify || end2Plastify)
00115                 yield = true;
00116 
00117         cModel->update(fcurr, displ, yield);
00118 
00119         return res;
00120 
00121 }
00122 
00123 void Inelastic2DYS02::getLocalStiff(Matrix &K)
00124 {
00125 
00126         double iz = Iz*cModel->getFactor();
00127 
00128     double      EIbyL = E*iz/L;
00129 
00130     K(0, 1) = K(0, 2) = K(0, 4) = K(0, 5)=0;
00131     K(1, 0) = K(1, 3) =0;
00132     K(2, 0) = K(2, 3) =0;
00133     K(3, 1) = K(3, 2) = K(3, 4) = K(3, 5)=0;
00134     K(4, 0) = K(4, 3) =0;
00135     K(5, 0) = K(5, 3) =0;
00136 
00137         K(0,0) = K(3,3) = (A/iz)*(EIbyL);
00138         K(0,3) = K(3,0) = (-A/iz)*(EIbyL);
00139         K(1,1) = K(4,4) = (12/(L*L))*(EIbyL);
00140         K(1,4) = K(4,1) = (-12/(L*L))*(EIbyL);
00141         K(1,2) = K(2,1) = K(1,5) = K(5,1) = (6/L)*(EIbyL);
00142         K(2,4) = K(4,2) = K(4,5) = K(5,4) = (-6/L)*(EIbyL);
00143         K(2,2) = K(5,5) = 4*(EIbyL);
00144         K(2,5) = K(5,2) = 2*(EIbyL);
00145 }//getLocalStiff
00146 

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