00001
00002
00004
00005 #include "Hajjar2D.h"
00006 #include <math.h>
00007
00008 #define coefDebug 1
00009 #define HAJJAR_CLASS_TAG -1
00011 // Construction/Destruction
00013 Hajjar2D::Hajjar2D(int tag, double xmax, double ymax,
00014 YS_Evolution &model,
00015 double centroid_y, double c1_, double c2_, double c3_)
00016 :YieldSurface_BC2D(tag, HAJJAR_CLASS_TAG, xmax, ymax, model),
00017 centroidY(centroid_y),c1(c1_), c2(c2_), c3(c3_)
00018 {
00020 }
00021
00022
00023 Hajjar2D::Hajjar2D( int tag,
00024 YS_Evolution &model,
00025 double D, double b, double t,
00026 double fc_, double fy_)
00027 :YieldSurface_BC2D(tag, HAJJAR_CLASS_TAG, 0, 0, model),
00028 depth(D), width(b), thick(t), fc(fc_), fy(fy_)
00029 {
00030 double fr = 0.623*sqrt(fc);
00031 double Ast = D*b - (D - 2*t)*(b - 2*t);
00032 double Ac = (D - 2*t)*(b - 2*t);
00033
00034 double x = D/t;
00035 double y = fc/fy;
00036
00037 c1 = 1.08 - 0.00265*x + 0.000023*x*x - 1.13*1e-7*x*x*x +
00038 0.374*y - 1.3*y*y - 0.0419*y*y*y - 0.0691*x*y +
00039 0.000234*x*x*y + 0.0754*x*y*y;
00040
00041 c2 = 0.628 + 0.0259*x - 0.000367*x*x + 1.99*1e-6*x*x*x +
00042 4.5*y - 14.9*y*y + 22.4*y*y*y + 0.164*x*y +
00043 -0.000756*x*x*y - 0.126*x*y*y;
00044
00045 c3 = 0.42 + 0.0892*x - 0.00122*x*x + 5.13*1e-6*x*x*x +
00046 4.9*y - 16.5*y*y + 16.2*y*y*y - 0.165*x*y +
00047 0.000713*x*x*y + 0.12*x*y*y;
00048
00049 capY = Ast*fy + Ac*fc;
00050
00051 double num = fc*(b*t - 2*t*t) + 0.5*fr*(D - t)*(b - 2*t) + fy*(2*D*t);
00052 double denom = fc*(b - 2*t) + 0.5*fr*(b - 2*t) + fy*(4*t);
00053
00054 double xn = num/denom;
00055 capX = fc*(0.5*(b - 2*t)*(xn - t)*(xn - t))
00056 + 0.5*fr*(0.5*(b - 2*t)*(D - xn - t)*(D - xn - t))
00057 + fy*((2*t)*(D*D/2 + xn*xn + t*t - D*t - D*xn) + (b*t)*(D - t));
00058
00059 centroidY = (Ac*fc - Ac*fr)/2;
00060 centroidY = centroidY/capY;
00061
00063 Vector tt(2);
00064 tt(0) = 0;
00065 tt(1) = centroidY;
00066 hModel->setInitTranslation(tt);
00067
00068 if (coefDebug)
00069 {
00070 opserr << " c1 = " << c1 << ", c2 = " << c2 << ", c3 = " << c3 << "\n";
00071 opserr << " centroidY = " << centroidY << "\n";
00072 opserr << " capX = " << capX << ", capY = " << capY << "\n";
00073 }
00074
00075 capX_orig = capX;
00076 capY_orig = capY;
00077 capXdim = capX;
00078 capYdim = capY;
00079
00080 }
00081
00082 Hajjar2D::~Hajjar2D()
00083 {
00084
00085 }
00086
00088
00090
00091 void Hajjar2D::setExtent()
00092 {
00093
00094 xPos = sqrt(1/fabs(c1));
00095 xNeg = -xPos;
00096 yPos = sqrt(1/fabs(c2));
00097 yNeg = -yPos;
00098
00099 }
00100
00101 void Hajjar2D::getGradient(double &gx, double &gy, double xi, double yi)
00102 {
00103
00104 double drift = getDrift(xi, yi);
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 if(forceLocation(drift)!=0)
00122 {
00123 opserr << "ERROR - Hajjar2D::getGradient(double &gx, double &gy, double x, double y)\n";
00124 opserr << "Force point not on the yield surface\n";
00125 opserr << " fx = " << xi << ", fy = " << yi << " drift = " << drift << "\n";
00126 opserr << "\a";
00127 }
00128 else
00129 {
00130 double x = xi;
00131 double y = yi ;
00132
00133 gx = 2*c1*x + 2*c3*pow(y, 2)*(x);
00134 gy = 2*c2*y + 2*c3*pow(x, 2)*(y);
00135 }
00136
00137 }
00138
00139 double Hajjar2D::getSurfaceDrift(double xi, double yi)
00140 {
00141 double x = xi;
00142 double y = yi;
00143
00144 double phi = c1*x*x + c2*y*y + c3*y*y*x*x;
00145 double drift = phi - 1;
00146 return drift;
00147 }
00148
00149 YieldSurface_BC *Hajjar2D::getCopy(void)
00150 {
00151 Hajjar2D *theCopy = new Hajjar2D(this->getTag(), *hModel,
00152 depth, width, thick, fc, fy);
00153
00154 return theCopy;
00155 }
00156
00157 int Hajjar2D::displaySelf(Renderer &theViewer, int displayMode, float fact)
00158 {
00159 this->YieldSurface_BC2D::displaySelf(theViewer, displayMode, fact);
00160
00161
00162 Vector pOld(3), pCurr(3);
00163 Vector rgb(3);
00164 rgb(0) = 0; rgb(1) = 0; rgb(2) = 0;
00165 double incr = 0.1;
00166 double x1, y1, xOld, yOld, x2, y2;
00167 double phi = 1;
00168 xOld = 0;
00169 yOld = sqrt( (phi - c1*xOld*xOld)/(c2 + c3*xOld*xOld) );
00170
00171
00172 double xmax = sqrt(1/c1);
00173
00174 opserr << " xmax = " << xmax << ", ymax = " << yOld << "( " << sqrt(1/c2) << ")\n";
00175 if(fact < 1) incr = fact;
00176
00177 double err = 0.5*incr;
00178
00179
00180 for(double x = 0; x <= xmax+err; x = x+incr)
00181 {
00182 if(x > xmax) x = xmax;
00183 double y = (phi - c1*x*x)/(c2 + c3*x*x);
00184 if(y > 0) y = sqrt(y);
00185
00186
00187
00188
00189
00190 {
00191 if(displayMode==100)
00192 opserr << " x = " << x << ", y = " << y << "\n";
00193
00195 x1 = x;
00196 y1 = y;
00197 hModel->toDeformedCoord(x1, y1);
00198 pCurr(0) = x1;
00199 pCurr(1) = y1;
00200
00201 x2 = xOld;
00202 y2 = yOld;
00203 hModel->toDeformedCoord(x2, y2);
00204 pOld(0) = x2;
00205 pOld(1) = y2;
00206 theViewer.drawLine(pOld, pCurr, rgb, rgb);
00207
00209 x1 = -1*x;
00210 y1 = y;
00211 hModel->toDeformedCoord(x1, y1);
00212 pCurr(0) = x1;
00213 pCurr(1) = y1;
00214
00215 x2 = -1*xOld;
00216 y2 = yOld;
00217 hModel->toDeformedCoord(x2, y2);
00218 pOld(0) = x2;
00219 pOld(1) = y2;
00220
00221 theViewer.drawLine(pOld, pCurr, rgb, rgb);
00222
00224 x1 = x;
00225 y1 = -1*y ;
00226 hModel->toDeformedCoord(x1, y1);
00227 pCurr(0) = x1;
00228 pCurr(1) = y1;
00229
00230 x2 = xOld;
00231 y2 = -1*yOld;
00232 hModel->toDeformedCoord(x2, y2);
00233 pOld(0) = x2;
00234 pOld(1) = y2;
00235
00236 theViewer.drawLine(pOld, pCurr, rgb, rgb);
00237
00239 x1 = -1*x;
00240 y1 = -1*y;
00241 hModel->toDeformedCoord(x1, y1);
00242 pCurr(0) = x1;
00243 pCurr(1) = y1;
00244
00245 x2 = -1*xOld;
00246 y2 = -1*yOld;
00247 hModel->toDeformedCoord(x2, y2);
00248 pOld(0) = x2;
00249 pOld(1) = y2;
00250
00251 theViewer.drawLine(pOld, pCurr, rgb, rgb);
00252
00253
00254 xOld = x;
00255 yOld = y;
00256
00257 }
00258 }
00259
00260
00261
00262 return 0;
00263 }
00264
00265
00266 void Hajjar2D::Print(OPS_Stream &s, int flag)
00267 {
00268 s << "\nYield Surface No: " << this->getTag() << " type: Attalla2D\n";
00269 }