Skip to content
Snippets Groups Projects
Commit fd8d74e8 authored by Ujwal Kishore Jinaga's avatar Ujwal Kishore Jinaga :clown:
Browse files

[MINOR PATCH] Added explicit calculation of ZXZ rotation matrix in StochDMN.

parent 5b96d2ed
Branches
No related tags found
No related merge requests found
......@@ -251,7 +251,7 @@ void dG3DMaterialLawWithTangentByPerturbation::stress(IPVariable* ipv, const IPV
 
_stressLaw->stress(ipvcur,ipvprev,false,checkfrac,dTangent);
 
#if 0
#if 1
_stressLaw->stress(ipvcur,ipvprev,true,checkfrac,dTangent);
ipvcur->getConstRefToDeformationGradient().print("F Analytique"); // FLE
ipvcur->getConstRefToFirstPiolaKirchhoffStress().print("P Analytique"); // FLE
......@@ -626,7 +626,7 @@ void dG3DMaterialLawWithTangentByPerturbation::stress(IPVariable* ipv, const IPV
}
 
}
#if 0
#if 1
ipvcur->getConstRefToDeformationGradient().print("F Numerique"); // FLE
ipvcur->getConstRefToFirstPiolaKirchhoffStress().print("P Numerique"); // FLE
ipvcur->getConstRefToTangentModuli().print("dPdE Numerique");
......@@ -5110,24 +5110,28 @@ void StochDMNDG3DMaterialLaw::setTime(const double t,const double dtime){
}
 
void StochDMNDG3DMaterialLaw::eulerZXZToRotationMatrix(const double alpha, const double beta, const double gamma, STensor3& rotationMatrix) {
double cosAlpha = cos(alpha);
double sinAlpha = sin(alpha);
double cosBeta = cos(beta);
double sinBeta = sin(beta);
double cosGamma = cos(gamma);
double sinGamma = sin(gamma);
rotationMatrix(0,0) = cosGamma * cosAlpha - cosBeta * sinAlpha * sinGamma;
rotationMatrix(0,1) = cosGamma * sinAlpha + cosBeta * cosAlpha * sinGamma;
rotationMatrix(0,2) = sinGamma * sinBeta;
rotationMatrix(1,0) = -sinGamma * cosAlpha - cosBeta * sinAlpha * cosGamma;
rotationMatrix(1,1) = -sinGamma * sinAlpha + cosBeta * cosAlpha * cosGamma;
rotationMatrix(1,2) = cosGamma * sinBeta;
rotationMatrix(2,0) = sinBeta * sinAlpha;
rotationMatrix(2,1) = -sinBeta * cosAlpha;
rotationMatrix(2,2) = cosBeta;
static STensor3 R1, R2, R3; // zxz intrinsic
STensorOperation::zero(R1); STensorOperation::zero(R2); STensorOperation::zero(R3);
R1(0,0) = cos(alpha); R1(0,1) = -sin(alpha);
R1(1,0) = sin(alpha); R1(1,1) = cos(alpha);
R1(2,2) = 1.;
R2(0,0) = 1.;
R2(1,1) = cos(beta); R2(1,2) = -sin(beta);
R2(2,1) = sin(beta); R2(2,2) = cos(beta);
R3(0,0) = cos(gamma); R3(0,1) = -sin(gamma);
R3(1,0) = sin(gamma); R3(1,1) = cos(gamma);
R3(2,2) = 1.;
for(int m=0; m<3; m++)
for(int n=0; n<3; n++){
rotationMatrix(m,n) = 0.;
for(int k=0; k<3; k++)
for(int l=0; l<3; l++)
rotationMatrix(m,n) += R3(m,k)*R2(k,l)*R1(l,n);
}
}
 
void StochDMNDG3DMaterialLaw::setZXZRotationMatrix_in_IP(StochDMNDG3DIPVariable* ipv){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment