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


C++ GaussPoint::Init方法代码示例

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


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

示例1: ComputeStiff

FloatMatrix  Quadr::ComputeStiff()
{
	FloatArray GaussCoor(2);
	GaussPoint B;
	FloatMatrix G(2, 2);
	FloatMatrix BT(3, 2);
	FloatMatrix DT(3, 3);
	double W1,W2;
	DMatrix = ComputeConstitutiveMatrix();
	for (int inode = 0; inode < 4; inode++)
	{
		for (int jnode = 0; jnode < 4; jnode++)
		{
			for (int iksi = 0; iksi < 3; iksi++)
			{
				GaussCoor .at(0) = Gauss3[iksi];
				W1 = Weight3[iksi];
				for (int ieta = 0; ieta < 3; ieta++)
				{
					GaussCoor.at(1) = Gauss3[ieta];
					W2 = Weight3[ieta];
					B.Init(0, GaussCoor);
					ComputeJacobi(B);
					BMatrix = ComputeBMarix(inode);
					BT=BMatrix.Trans();
					//BT.Print(); 
					DT = BT.Mult(DMatrix);
					//DT.Print();
					BMatrix = ComputeBMarix(jnode);
					G = DT.Mult(BMatrix);
					W2 = W1*W2*Det;
					G = G.Mult(W2);
					//G.Print();
					Stiff.at(2 * inode, 2 * jnode) += G.at(0, 0);
					Stiff.at(2 * inode + 1, 2 * jnode) += G.at(1, 0);
					Stiff.at(2 * inode, 2 * jnode + 1) += G.at(0, 1);
					Stiff.at(2 * inode + 1, 2 * jnode + 1) += G.at(1, 1);
					
				}
			}
		}
	}
	//cout << "**********************************************" << endl;
	//Stiff.Print();
	return Stiff;
}
开发者ID:hjunqq,项目名称:FemMain,代码行数:46,代码来源:Model.cpp

示例2: ComputeStress

FloatArray Quadr::ComputeStress()
{
	const double a = 1 + sqrt(3) / 2, b = -1.0 / 2, c = 1 - sqrt(3) / 2;
	FloatMatrix TransMatrix(4, 4);
	TransMatrix.at(0, 0) = a;
	TransMatrix.at(0, 1) = b;
	TransMatrix.at(0, 2) = c;
	TransMatrix.at(0, 3) = b;
	TransMatrix.at(1, 0) = b;
	TransMatrix.at(1, 1) = a;
	TransMatrix.at(1, 2) = b;
	TransMatrix.at(1, 3) = c;
	TransMatrix.at(2, 0) = c;
	TransMatrix.at(2, 1) = b;
	TransMatrix.at(2, 2) = a;
	TransMatrix.at(2, 3) = b;
	TransMatrix.at(3, 0) = b;
	TransMatrix.at(3, 1) = c;
	TransMatrix.at(3, 2) = b;
	TransMatrix.at(3, 3) = a;
	Strain.Clear();
	
	GaussPoint B;
	FloatArray Coor;
	FloatArray TransTemp(4);
	Coor.SetSize(2);

	Coor.at(0) = 0;
	Coor.at(1) = 0;
	B.Init(0, Coor);
	ComputeJacobi(B);
	BMatrixBig = ComputeBMatrix();
	//BMatrixBig.Print();
	//Displacement.Print();
	Strain = BMatrixBig.Mult(Displacement);
	Stress = DMatrix.Mult(Strain);

	for (int inode = 0; inode < 4; inode++)
	{
		Coor.at(0) = P4ksicor[inode];
		Coor.at(1) = P4etacor[inode];
		B.Init(0, Coor);
		ComputeJacobi(B);
		BMatrixBig = ComputeBMatrix();
		GaussStrain[inode] = BMatrixBig.Mult(Displacement);
		GaussStress[inode] = DMatrix.Mult(Strain);
		//GaussStrain[inode].Print();
	}
	for (int i = 0; i < 3; i++)
	{
		for (int j = 0; j < 4; j++)
		{
			TransTemp.at(j) = GaussStrain[j].at(i);
		}
		TransTemp = TransMatrix.Mult(TransTemp);
		for (int j = 0; j < 4; j++)
		{
			NodeStrain[j].at(i) = TransTemp.at(j);
		}
		for (int j = 0; j < 4; j++)
		{
			TransTemp.at(j) = GaussStress[j].at(i);
		}
		TransTemp = TransMatrix.Mult(TransTemp);
		for (int j = 0; j < 4; j++)
		{
			NodeStress[j].at(i) = TransTemp.at(j);
		}
	}
	return NULL;
}
开发者ID:hjunqq,项目名称:FemMain,代码行数:71,代码来源:Model.cpp


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