YS_Section2D02.cpp

Go to the documentation of this file.
00001 // @ rkaul@stanford.edu
00002 //   ggd@stanford.edu
00003 
00004 #include <math.h>
00005 #include <YS_Section2D02.h>
00006 
00007 
00008 YS_Section2D02::YS_Section2D02(void)
00009 :YieldSurfaceSection2d(0, SEC_TAG_YieldSurface2D02, 0, true),
00010  E(0), A(0), I(0), maxPlstkRot(0.0), peakPlstkRot(0.0), iFactor(1.0)
00011 {
00012 }
00013 
00014 YS_Section2D02::YS_Section2D02
00015 (int tag, double E_in, double A_in, double I_in, double theta_p_max, YieldSurface_BC *ptrys, bool use_kr)
00016 :YieldSurfaceSection2d(tag, SEC_TAG_YieldSurface2D02, ptrys, use_kr),
00017  E(E_in), A(A_in), I(I_in), maxPlstkRot(theta_p_max),
00018  peakPlstkRot(0.0), iFactor(1.0)
00019 {
00020     if (E <= 0.0)
00021     {
00022       opserr << "YS_Section2D02::YS_Section2D02s -- Input E <= 0.0 ... setting E to 1.0\n";
00023       E = 1.0;
00024     }
00025 
00026     if (A <= 0.0)
00027     {
00028       opserr << "YS_Section2D02::YS_Section2D02s -- Input A <= 0.0 ... setting A to 1.0\n";
00029       A = 1.0;
00030     }
00031 
00032     if (I <= 0.0)
00033     {
00034       opserr << "YS_Section2D02::YS_Section2D02s -- Input I <= 0.0 ... setting I to 1.0\n";
00035       I = 1.0;
00036     }
00037 
00038     if(maxPlstkRot <= 0.0)
00039     {
00040       opserr << "YS_Section2D02::YS_Section2D02s -- Input maxPlstkRot <= 0.0 ... setting to 0.0\n";
00041       maxPlstkRot = 0.0;
00042     }
00043 
00044 }
00045 
00046 
00047 YS_Section2D02::~YS_Section2D02(void)
00048 {
00049 
00050 }
00051 
00052 int YS_Section2D02::commitState(void)
00053 {
00054         double pRot = fabs(ys->hModel->getTrialPlasticStrains(0));
00055         if(pRot > peakPlstkRot)
00056                 peakPlstkRot = pRot;
00057 
00058         if(fabs(maxPlstkRot) <= 1e-10)
00059                 iFactor = 1.0;
00060         else
00061                 iFactor =  1 - (peakPlstkRot/maxPlstkRot);
00062 
00063         if(iFactor < 0.02)
00064                 iFactor = 0.02;
00065 
00066         opserr << peakPlstkRot << "\t" << iFactor << endln;
00067         return this->YieldSurfaceSection2d::commitState();
00068 }
00069 
00070 void YS_Section2D02::getSectionStiffness(Matrix &Ks)
00071 {
00072 //      cout << "iFactor: " << iFactor << "\tpeak rotP: " <<  peakPlstkRot
00073 //           << "\tmaxP: " << maxPlstkRot << endln;
00074 
00075         Ks(0,0) = E*A; Ks(0,1) = 0.0;
00076         Ks(1,0) = 0.0; Ks(1,1) = E*I*iFactor;
00077 }
00078 
00079 const Matrix &
00080 YS_Section2D02::getInitialTangent(void)
00081 {
00082         ks(0,0) = E*A; ks(0,1) = 0.0;
00083         ks(1,0) = 0.0; ks(1,1) = E*I;
00084         
00085         return ks;
00086 }
00087 
00088 
00089 SectionForceDeformation* YS_Section2D02::getCopy ()
00090 {
00091     // Make a copy of the hinge
00092     YS_Section2D02 *theCopy =
00093     new YS_Section2D02 (this->getTag(), E, A, I, maxPlstkRot, ys, use_Kr_orig);
00094     theCopy->eCommit = eCommit;
00095     theCopy->sCommit = sCommit;
00096     theCopy->peakPlstkRot =  peakPlstkRot;
00097 
00098     return theCopy;
00099 }
00100 
00101 void YS_Section2D02::Print (OPS_Stream &s, int flag)
00102 {
00103     s << "YS_Section2D02, tag: " << this->getTag() << endln;
00104         s << "\tE: " << E << endln;
00105         s << "\tA: " << A << endln;
00106         s << "\tI: " << I << endln;
00107         s << "\tDegradation Factor      :" << iFactor << endln;
00108         s << "\tPeak plastic-rotation   :" << peakPlstkRot << endln;
00109         s << "\tMaximum plastic-rotation:" << maxPlstkRot << endln;
00110         this->YieldSurfaceSection2d::Print(s, flag);
00111 }

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