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


C++ Nodes::node方法代码示例

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


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

示例1: buildElements

Elements Region::buildElements(Nodes& Base)
{
	Elements Result;
	if(typ==1)
	{
		if(numofrows<=numofcols)
		{
			for(int i=0;i<numofcols;i++)
				for(int j=0;j<numofrows;j++)
				{
					Result.push_back(Triangle(Base,i*(numofrows+1)+j,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j),Element(i*(numofrows+1)+j,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j));
					Result.push_back(Triangle(Base,i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j),Element(i*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j));
					if(i==0&&CONDLEFT) Result.addcondition(Border(true,j,j+1,Base.node(j),Base.node(j+1),ENV_TEMPLEFT));
					if(i==numofcols-1&&CONDRIGHT) Result.addcondition(Border(true,(numofcols)*(numofrows+1)+j,(numofcols)*(numofrows+1)+j+1,Base.node((numofcols)*(numofrows+1)+j),Base.node((numofcols)*(numofrows+1)+j+1),ENV_TEMPRIGHT));
					if(j==0&&CONDDOWN) Result.addcondition(Border(true,(i)*(numofrows+1)+j,(i+1)*(numofrows+1)+j,Base.node((i)*(numofrows+1)+j),Base.node((i+1)*(numofrows+1)+j),ENV_TEMPDOWN));
					if(j==numofrows-1&&CONDUP) Result.addcondition(Border(true,(i)*(numofrows+1)+j+1,(i+1)*(numofrows+1)+j+1,Base.node((i)*(numofrows+1)+j+1),Base.node((i+1)*(numofrows+1)+j+1),ENV_TEMPUP));
				}
		}
		else
		{
			for(int j=0;j<numofrows;j++)
				for(int i=0;i<numofcols;i++)
				{
					Result.push_back(Triangle(Base,j*(numofcols+1)+i,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i),Element(j*(numofcols+1)+i,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i));
					Result.push_back(Triangle(Base,j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i),Element(j*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i));
					if(j==0&&CONDDOWN) Result.addcondition(Border(true,i,i+1,Base.node(i),Base.node(i+1),ENV_TEMPDOWN));
					if(j==numofrows-1&&CONDUP) Result.addcondition(Border(true,(numofrows)*(numofcols+1)+i,(numofrows)*(numofcols+1)+i+1,Base.node((numofrows)*(numofcols+1)+i),Base.node((numofrows)*(numofcols+1)+i+1),ENV_TEMPUP));
					if(i==0&&CONDLEFT) Result.addcondition(Border(true,(j)*(numofcols+1)+i,(j+1)*(numofcols+1)+i,Base.node((j)*(numofcols+1)+i),Base.node((j+1)*(numofcols+1)+i),ENV_TEMPLEFT));
					if(i==numofcols-1&&CONDRIGHT) Result.addcondition(Border(true,(j)*(numofcols+1)+i+1,(j+1)*(numofcols+1)+i+1,Base.node((j)*(numofcols+1)+i+1),Base.node((j+1)*(numofcols+1)+i+1),ENV_TEMPRIGHT));
				}
		}
	}
	return Result;
}
开发者ID:vitaliygor,项目名称:HeatDistribution,代码行数:34,代码来源:elem.cpp

示例2:

Triangle::Triangle(Nodes& Base, int _X, int _Y, int _Z):X(Base.node(_X)),Xt(Base.temperature(_X)),Y(Base.node(_Y)),Yt(Base.temperature(_Y)),Z(Base.node(_Z)),Zt(Base.temperature(_Z))
{
	countcoef();
}
开发者ID:vitaliygor,项目名称:HeatDistribution,代码行数:4,代码来源:elem.cpp


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