当前位置: 首页>>代码示例>>C++>>正文


C++ TPZFMatrix::Identity方法代码示例

本文整理汇总了C++中TPZFMatrix::Identity方法的典型用法代码示例。如果您正苦于以下问题:C++ TPZFMatrix::Identity方法的具体用法?C++ TPZFMatrix::Identity怎么用?C++ TPZFMatrix::Identity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPZFMatrix的用法示例。


在下文中一共展示了TPZFMatrix::Identity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProjectSigmaDep

void TPZYCCamClayPV::ProjectSigmaDep(const TPZVec<REAL> &sigma_trial_pv, const REAL aPrev, TPZVec<REAL> &sigma, REAL &aProj, TPZFMatrix<REAL> &GradSigma) const {
    TPZVec<REAL> yield(NYield);
    this->Phi(sigma_trial_pv, aPrev, yield);

    if (yield[0] <= 0.) {
        sigma = sigma_trial_pv;
        aProj = aPrev;
        GradSigma.Identity();
    } else {
        const REAL tol=1.e-5;
        bool threeEigEqual = (fabs(sigma_trial_pv[0] - sigma_trial_pv[1]) < tol && fabs(sigma_trial_pv[1] - sigma_trial_pv[2]) < tol);
//        if (threeEigEqual){
//            ProjectToSurfaceConstantBeta(sigma_trial_pv, aPrev, sigma, aProj, 1.e-5);
//            // we can compute the tangent matrix
//            STATE theta, beta;
//            SurfaceParam(sigma, aProj, theta, beta);
//            TPZFNMatrix<9, STATE> ddist_dsigmatrial(3, 3), jac(3, 3), DFunccart(3, 3);
//            GradSigmaTrial(sigma_trial_pv, theta, beta, aProj, ddist_dsigmatrial);
//            D2DistanceToSurface(sigma_trial_pv, theta, beta, aProj, jac);
//            jac.Solve_LU(&ddist_dsigmatrial);
//            DFuncCart(theta, beta, aProj, DFunccart);
//            DFunccart.Multiply(ddist_dsigmatrial, GradSigma);
//            GradSigma *= -1.;
//        } else {
            ProjectToSurface(sigma_trial_pv, aPrev, sigma, aProj, 1.e-5);
            // we can compute the tangent matrix
            STATE theta, beta;
            SurfaceParam(sigma, aProj, theta, beta);
            TPZFNMatrix<9, STATE> ddist_dsigmatrial(3, 3), jac(3, 3), DFunccart(3, 3);
            GradSigmaTrial(sigma_trial_pv, theta, beta, aProj, ddist_dsigmatrial);
            D2DistanceToSurface(sigma_trial_pv, theta, beta, aProj, jac);
            jac.Solve_LU(&ddist_dsigmatrial);
            DFuncCart(theta, beta, aProj, DFunccart);
            DFunccart.Multiply(ddist_dsigmatrial, GradSigma);
            GradSigma *= -1.;
//        }
    }
}
开发者ID:labmec,项目名称:neopz,代码行数:38,代码来源:TPZYCCamClayPV.cpp

示例2: MapToSide


//.........这里部分代码省略.........
				}
				else
				{
                    SidePar[0] = 1. - 2.*qsi/(qsi + eta);
                    JacToSide(0,0) = -2.*eta/((qsi+eta)*(qsi+eta)); JacToSide(0,1) = 2.*qsi/((qsi+eta)*(qsi+eta)); JacToSide(0,2) = 0.;
				}
				break;
				
			case 14://1D
				SidePar.Resize(1); JacToSide.Resize(1,3);
				if(fabs((T)(qsi-1.)) < zero)
				{
                    SidePar[0] = 0.;
                    JacToSide(0,0) = 1.; JacToSide(0,1) = 1.; JacToSide(0,2) = 0.;
					regularmap = false;
				}
				else
				{
                    SidePar[0] = 1. - 2.*eta/(1.-qsi);
                    JacToSide(0,0) = -2.*eta/((1.-qsi)*(1.-qsi)); JacToSide(0,1) = -2./(1.-qsi); JacToSide(0,2) = 0.;
				}
				break;
				
			case 15://2D - triangle
				SidePar.Resize(2); JacToSide.Resize(2,3);
				SidePar[0] = qsi; SidePar[1] = eta;
				JacToSide(0,0) = 1.; JacToSide(0,1) = 0.; JacToSide(0,2) = 0.;
				JacToSide(1,0) = 0.; JacToSide(1,1) = 1.; JacToSide(1,2) = 0.;
				break;
				
			case 16://2D - quadrilateral
				SidePar.Resize(2); JacToSide.Resize(2,3);
				if(fabs((T)(eta-1.)) < zero)
				{
                    SidePar[0] = 0.; SidePar[1] = zeta;
                    JacToSide(0,0) = 1.; JacToSide(0,1) = 1.; JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(1,2) = 1.;
					regularmap = false;
				}
				else
				{
                    SidePar[0] = 2.*qsi/(1.-eta) - 1.; SidePar[1] = zeta;
                    JacToSide(0,0) = 2./(1.-eta); JacToSide(0,1) = 2.*qsi/((1.-eta)*(1.-eta)); JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(0,2) = 1.;
				}
				break;
				
			case 17://2D - quadrilateral
				SidePar.Resize(2); JacToSide.Resize(2,3);
				if(fabs((T)(qsi+eta)) < zero)
				{
                    SidePar[0] = 0.; SidePar[1] = zeta;
                    JacToSide(0,0) = 1.; JacToSide(0,1) = 1.; JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(1,2) = 1.;
					regularmap = false;
				}
				else
				{
                    SidePar[0] = 1. - 2.*qsi/(qsi + eta); SidePar[1] = zeta;
                    JacToSide(0,0) = -2.*eta/((qsi+eta)*(qsi+eta)); JacToSide(0,1) = 2.*qsi/((qsi+eta)*(qsi+eta)); JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(0,2) = 1.;
				}
				break;
				
			case 18://2D - quadrilateral
				SidePar.Resize(2); JacToSide.Resize(2,3);
				if(fabs((T)(qsi-1.)) < zero)
				{
                    SidePar[0] = 0.; SidePar[1] = zeta;
                    JacToSide(0,0) = 1.; JacToSide(0,1) = 1.; JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(1,2) = 1.;
					regularmap = false;
				}
				else
				{
                    SidePar[0] = 1. - 2.*eta/(1.-qsi); SidePar[1] = zeta;
                    JacToSide(0,0) = -2.*eta/((1.-qsi)*(1.-qsi)); JacToSide(0,1) = -2./(1.-qsi); JacToSide(0,2) = 0.;
                    JacToSide(1,0) = 0.; JacToSide(1,1) = 0.; JacToSide(0,2) = 1.;
				}
				break;
				
			case 19://2D - triangle
				SidePar.Resize(2); JacToSide.Resize(2,3);
				SidePar[0] = qsi; SidePar[1] = eta;
				JacToSide(0,0) = 1.; JacToSide(0,1) = 0.; JacToSide(0,2) = 0.;
				JacToSide(1,0) = 0.; JacToSide(1,1) = 1.; JacToSide(1,2) = 0.;
				break;
            case 20:
                SidePar = InternalPar;
                JacToSide.Resize(3, 3);
                JacToSide.Identity();
                break;
		}
		if(side > 20)
		{
			cout << "Cant compute MapToSide method in TPZGeoPrism class!\nParameter (SIDE) must be between 6 and 19!\nMethod Aborted!\n";
			DebugStop();
		}
		return regularmap;
	}
开发者ID:labmec,项目名称:neopz,代码行数:101,代码来源:tpzprism.cpp


注:本文中的TPZFMatrix::Identity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。