J2BeamFiber2d

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
mohammmad
Posts: 45
Joined: Tue Aug 21, 2018 4:10 am
Contact:

J2BeamFiber2d

Post by mohammmad »

hello,
Does anyone know what happens in J2BeamFiber2d getStress meyhod?
I think J.Solve(R, dx); give strain but why at the next line Subtraction x and dx? x is stress but dx is strain.
x = x-dx;



const Vector&
J2BeamFiber2d::getStress (void)
{
double G = 0.5*E/(1.0+nu);

sigma(0) = E*(Tepsilon(0)-epsPn[0]);
sigma(1) = G*(Tepsilon(1)-epsPn[1]);

static const double one3 = 1.0/3;
static const double two3 = 2.0*one3;
static const double root23 = sqrt(two3);

double xsi[2];
//xsi[0] = sigma(0) - two3*Hkin*1.5*epsPn[0];
//xsi[1] = sigma(1) - two3*Hkin*0.5*epsPn[1];
xsi[0] = sigma(0) - Hkin*epsPn[0];
xsi[1] = sigma(1) - one3*Hkin*epsPn[1];

double q = sqrt(two3*xsi[0]*xsi[0] + 2.0*xsi[1]*xsi[1]);
double F = q - root23*(sigmaY + Hiso*alphan);

if (F < -100*DBL_EPSILON) {
epsPn1[0] = epsPn[0];
epsPn1[1] = epsPn[1];
}
else {

// Solve for dg
double dg = 0.0;

static Vector R(3);
R(0) = 0.0; R(1) = 0.0; R(2) = F;
static Vector x(3);
x(0) = xsi[0]; x(1) = xsi[1]; x(2) = dg;

static Matrix J(3,3);
static Vector dx(3);

int iter = 0; int maxIter = 25;
while (iter < maxIter && R.Norm() > sigmaY*1.0e-14) {
iter++;

J(0,0) = 1.0 + dg*two3*(E+Hkin); J(0,1) = 0.0;
J(1,0) = 0.0; J(1,1) = 1.0 + dg*(2.0*G+two3*Hkin);

J(0,2) = two3*(E+Hkin)*x(0);
J(1,2) = (2.0*G+two3*Hkin)*x(1);

//J(2,0) = x(0)*two3/q; J(2,1) = x(1)*2.0/q;
J(2,0) = (1.0-two3*Hiso*dg)*x(0)*two3/q;
J(2,1) = (1.0-two3*Hiso*dg)*x(1)*2.0/q;

//J(2,2) = -root23*Hiso;
J(2,2) = -two3*Hiso*q;

J.Solve(R, dx);
x = x-dx;

dg = x(2);
dg_n1 = dg;

q = sqrt(two3*x(0)*x(0) + 2.0*x(1)*x(1));

R(0) = x(0) - xsi[0] + dg*two3*(E+Hkin)*x(0);
R(1) = x(1) - xsi[1] + dg*(2.0*G+two3*Hkin)*x(1);
R(2) = q - root23*(sigmaY + Hiso*(alphan+dg*root23*q));
}

if (iter == maxIter) {
//opserr << "J2BeamFiber2d::getStress -- maxIter reached " << R.Norm() << endln;
}

alphan1 = alphan + dg*root23*q;

epsPn1[0] = epsPn[0] + dg*two3*x(0);
epsPn1[1] = epsPn[1] + dg*2.0*x(1);

//sigma(0) = x(0) + two3*Hkin*1.5*epsPn1[0];
//sigma(1) = x(1) + two3*Hkin*0.5*epsPn1[1];
sigma(0) = x(0) + Hkin*epsPn1[0];
sigma(1) = x(1) + one3*Hkin*epsPn1[1];
}

return sigma;
}
Post Reply