const Vector& BeamFiberMaterial::getStress() { const Vector &threeDstress = theMaterial->getStress(); stress(0) = threeDstress(0); stress(1) = threeDstress(3); stress(2) = threeDstress(5); return stress; }
const Vector& BeamFiberMaterial::getStressSensitivity(int gradIndex, bool conditional) { const Vector &threeDstress = theMaterial->getStressSensitivity(gradIndex, conditional); stress(0) = threeDstress(0); stress(1) = threeDstress(3); stress(2) = threeDstress(5); const Matrix &threeDtangent = theMaterial->getTangent(); static Matrix dd12(3,3); dd12(0,0) = threeDtangent(0,1); dd12(1,0) = threeDtangent(3,1); dd12(2,0) = threeDtangent(5,1); dd12(0,1) = threeDtangent(0,2); dd12(1,1) = threeDtangent(3,2); dd12(2,1) = threeDtangent(5,2); dd12(0,2) = threeDtangent(0,4); dd12(1,2) = threeDtangent(3,4); dd12(2,2) = threeDtangent(5,4); static Matrix dd22(3,3); dd22(0,0) = threeDtangent(1,1); dd22(1,0) = threeDtangent(2,1); dd22(2,0) = threeDtangent(4,1); dd22(0,1) = threeDtangent(1,2); dd22(1,1) = threeDtangent(2,2); dd22(2,1) = threeDtangent(4,2); dd22(0,2) = threeDtangent(1,4); dd22(1,2) = threeDtangent(2,4); dd22(2,2) = threeDtangent(4,4); static Vector sigma2(3); sigma2(0) = threeDstress(1); sigma2(1) = threeDstress(2); sigma2(2) = threeDstress(4); static Vector dd22sigma2(3); dd22.Solve(sigma2,dd22sigma2); stress.addMatrixVector(1.0, dd12, dd22sigma2, -1.0); return stress; }
const Vector& BeamFiberMaterial2d::getStress() { const Vector &threeDstress = theMaterial->getStress(); static Vector threeDstressCopy(6); int i, ii; //swap matrix indices to sort out-of-plane components for (i=0; i<6; i++) { ii = this->indexMap(i); threeDstressCopy(ii) = threeDstress(i); } for (i=0; i<2; i++) this->stress(i) = threeDstressCopy(i); return this->stress; }
//send back the stress const XC::Vector &XC::PlateFiberMaterial::getStress(void) const { const XC::Vector &threeDstress = theMaterial->getStress(); static XC::Vector threeDstressCopy(6); //swap matrix indices to sort out-of-plane components int i, ii; for(i=0; i<6; i++) { ii = this->indexMap(i); threeDstressCopy(ii) = threeDstress(i); }//end for i for(i=0; i<5; i++) this->stress(i) = threeDstressCopy(i); return this->stress; }
//receive the strain int BeamFiberMaterial::setTrialStrain(const Vector &strainFromElement) { static const double tolerance = 1.0e-08; strain(0) = strainFromElement(0); strain(1) = strainFromElement(1); strain(2) = strainFromElement(2); //newton loop to solve for out-of-plane strains double norm; static Vector condensedStress(3); static Vector strainIncrement(3); static Vector threeDstrain(6); static Matrix dd22(3,3); int count = 0; const int maxCount = 20; double norm0; do { //set three dimensional strain threeDstrain(0) = this->strain(0); threeDstrain(1) = this->Tstrain22; threeDstrain(2) = this->Tstrain33; threeDstrain(3) = this->strain(1); threeDstrain(4) = this->Tgamma23; threeDstrain(5) = this->strain(2); if (theMaterial->setTrialStrain(threeDstrain) < 0) { opserr << "BeamFiberMaterial::setTrialStrain - setStrain failed in material with strain " << threeDstrain; return -1; } //three dimensional stress const Vector &threeDstress = theMaterial->getStress(); //three dimensional tangent const Matrix &threeDtangent = theMaterial->getTangent(); //NDmaterial strain order = 11, 22, 33, 12, 23, 31 //BeamFiberMaterial strain order = 11, 12, 31, 22, 33, 23 condensedStress(0) = threeDstress(1); condensedStress(1) = threeDstress(2); condensedStress(2) = threeDstress(4); dd22(0,0) = threeDtangent(1,1); dd22(1,0) = threeDtangent(2,1); dd22(2,0) = threeDtangent(4,1); dd22(0,1) = threeDtangent(1,2); dd22(1,1) = threeDtangent(2,2); dd22(2,1) = threeDtangent(4,2); dd22(0,2) = threeDtangent(1,4); dd22(1,2) = threeDtangent(2,4); dd22(2,2) = threeDtangent(4,4); //set norm norm = condensedStress.Norm(); if (count == 0) norm0 = norm; //condensation dd22.Solve(condensedStress, strainIncrement); //update out of plane strains this->Tstrain22 -= strainIncrement(0); this->Tstrain33 -= strainIncrement(1); this->Tgamma23 -= strainIncrement(2); } while (count++ < maxCount && norm > tolerance); return 0; }