Пример #1
0
// Return the search history up to the root node
SearchHistoryVector SearchHistoryNode::getHistoryVector()
{
    SearchHistoryVector out;
    SearchHistoryLink pCurr(this);
    bool done = false;
    while(!done)
    {
        if(pCurr->m_variant.base == ROOT_CHAR)
        {
            // root found, terminate the search
            done = true;
        }
        else
        {
            out.add(pCurr->m_variant);
            pCurr = pCurr->m_parentLink;
        }
    }
    return out;
}
Пример #2
0
int ElTawil2D::displaySelf(Renderer &theViewer, int displayMode, float fact)
{
 	this->YieldSurface_BC2D::displaySelf(theViewer, displayMode, fact);
Vector pOld(3), pCurr(3);
Vector rgb(3);
rgb(0) = 0.1; rgb(1) = 0.5; rgb(2) = 0.5;
	if(displayMode == this->SurfOnly)
	{
		rgb(0) = 0.7; rgb(1) = 0.7; rgb(2) = 1.0;
	}


	// double incr = ((yPosCap/capY) - (yNegCap/capY)) / 10;
	double incr =  fabs(0.33333333*yNegCap/capY);
	if(fact < 1) incr = fact;
 	
 	double xOld = 0;
 	double yOld = yNegCap/capY;
 	// hModel->toDeformedCoord(xOld, yOld);
 	
 	double err = 1e-4;
    for(double yc = yNegCap/capY; yc <= yPosCap/capY + err; yc = yc+incr)
	{
		double y    = yc;	
		double yVal = y*capY;
		double xVal;

		if(y < 0)
		{
			xVal = xBal*(1 - pow( fabs(yVal/yNegCap) , ty));
		}
		else
		{
			xVal = xBal*(1 - pow( (yVal/yPosCap) , cz));
		}

		double x = xVal/capX;

		if(displayMode==100)
			opserr << "(undeformed) x = " << x << ", y = " << y;
 		
 		double x1 = x;
		double y1 = y;
		double x2 = -x;
		double y2 = y;
		
		double x1Old = xOld;
		double y1Old = yOld;
		double x2Old = -xOld;
		double y2Old = yOld;
			

        hModel->toDeformedCoord(x1, y1);
        hModel->toDeformedCoord(x1Old, y1Old);
        hModel->toDeformedCoord(x2, y2);
        hModel->toDeformedCoord(x2Old, y2Old);

//		if(displayMode==100)
//			opserr << " (deformed) x = " << x << ", y = " << y << endln;
 		
		pCurr(0) = x1;
		pCurr(1) = y1;
		pOld(0)  = x1Old;
		pOld(1)  = y1Old;
		
		theViewer.drawLine(pOld, pCurr, rgb, rgb);
		
		pCurr(0) = x2;
		pCurr(1) = y2;
		pOld(0)  = x2Old;
		pOld(1)  = y2Old;
		theViewer.drawLine(pOld, pCurr, rgb, rgb);
		
		xOld = x;
		yOld = y;
	}


	// displayForcePoint(theViewer, displayMode, fact);
	return 0;
}
Пример #3
0
int Hajjar2D::displaySelf(Renderer &theViewer, int displayMode, float fact)
{
 	this->YieldSurface_BC2D::displaySelf(theViewer, displayMode, fact);
// 	return 0;

Vector pOld(3), pCurr(3);
Vector rgb(3);
rgb(0) = 0; rgb(1) = 0; rgb(2) = 0;
double incr = 0.1;
double x1, y1, xOld, yOld, x2, y2;
 double phi = 1;
    xOld = 0; //y = 0
	yOld = sqrt( (phi - c1*xOld*xOld)/(c2 + c3*xOld*xOld) ); //x = 1
	/*yOld += centroidY;*/

	double xmax = sqrt(1/c1);

	opserr << " xmax = " << xmax << ", ymax = " << yOld << "( " << sqrt(1/c2) << ")\n";
	if(fact < 1) incr = fact;

	double err = 0.5*incr;

    //for(double y = 0; y <= 1+err; y = y+incr)
	for(double x = 0; x <= xmax+err; x = x+incr)
    {
		if(x > xmax) x = xmax;
        double y =  (phi - c1*x*x)/(c2 + c3*x*x);
		if(y > 0) y  = sqrt(y);
		/*y += centroidY;*/

		//if( x < 0.2) incr = 0.02;

		//if(x < 0.2 || x > 0.85)
		{
			if(displayMode==100)
				opserr << " x = " << x << ", y = " << y << "\n";

            //////////////////////// x>0, y>0
            x1 = x;
            y1 = y;
            hModel->toDeformedCoord(x1, y1);
            pCurr(0) = x1;
            pCurr(1) = y1;

            x2 = xOld;
            y2 = yOld;
            hModel->toDeformedCoord(x2, y2);
            pOld(0) = x2;
            pOld(1) = y2;
            theViewer.drawLine(pOld, pCurr, rgb, rgb);

            ///////////////////////// x<0, y>0
            x1 = -1*x;
            y1 = y;
            hModel->toDeformedCoord(x1, y1);
            pCurr(0) = x1;
            pCurr(1) = y1;

            x2 = -1*xOld;
            y2 = yOld;
            hModel->toDeformedCoord(x2, y2);
            pOld(0) = x2;
            pOld(1) = y2;

            theViewer.drawLine(pOld, pCurr, rgb, rgb);

            //////////////////////// x>0, y<0
            x1 = x;
            y1 = -1*y /*+ 2*centroidY*/;
            hModel->toDeformedCoord(x1, y1);
            pCurr(0) = x1;
            pCurr(1) = y1;

            x2 = xOld;
            y2 = -1*yOld/* + 2*centroidY*/;
            hModel->toDeformedCoord(x2, y2);
            pOld(0) = x2;
            pOld(1) = y2;

            theViewer.drawLine(pOld, pCurr, rgb, rgb);

            //////////////////////// x<0, y<0
            x1 = -1*x;
            y1 = -1*y/* + 2*centroidY*/;
            hModel->toDeformedCoord(x1, y1);
            pCurr(0) = x1;
            pCurr(1) = y1;

            x2 = -1*xOld;
            y2 = -1*yOld/* + 2*centroidY*/;
            hModel->toDeformedCoord(x2, y2);
            pOld(0) = x2;
            pOld(1) = y2;

            theViewer.drawLine(pOld, pCurr, rgb, rgb);


            xOld = x;
            yOld = y;

        }//x > 0
    }

	// displayForcePoint(theViewer, displayMode, fact);

	return 0;
}