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


C++ Array::DeleteAll方法代码示例

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


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

示例1: WriteDiffPackFormat

void WriteDiffPackFormat (const Mesh & mesh,
			  const CSGeometry & geom,
			  const string & filename)
{
  //   double scale = globflags.GetNumFlag ("scale", 1);
  double scale = 1;

  ofstream outfile(filename.c_str());

  if (mesh.GetDimension() == 3)

    {
      // Output compatible to Diffpack grid format
      // Bartosz Sawicki <[email protected]>

      int np = mesh.GetNP();
      int ne = mesh.GetNE();
      int nse = mesh.GetNSE();
      Array <int> BIname;
      Array <int> BCsinpoint;
      int i, j, k, l;


      outfile.precision(6);
      outfile.setf (ios::fixed, ios::floatfield);
      outfile.setf (ios::showpoint);

      const Element & eldummy = mesh.VolumeElement((int)1);
      outfile << "\n\n"
	"Finite element mesh (GridFE):\n\n"
	"  Number of space dim. =   3\n"
	"  Number of elements   =  " << ne << "\n"
	"  Number of nodes      =  " << np << "\n\n"
	"  All elements are of the same type : dpTRUE\n"
	"  Max number of nodes in an element: "<< eldummy.GetNP() << "\n"
	"  Only one subdomain               : dpFALSE\n"
	"  Lattice data                     ? 0\n\n\n\n";
      
      for (i = 1; i <= nse; i++) 
	{
	  int BI=mesh.GetFaceDescriptor(mesh.SurfaceElement(i).GetIndex()).BCProperty();
	  int nbi=BIname.Size();
	  int found=0;
	  for (j = 1; j <= nbi; j++)
	    if(BI == BIname.Get(j)) found = 1;
	  if( ! found ) BIname.Append(BI);	    	     
	}
      
      outfile << "  " << BIname.Size() <<  " Boundary indicators:  ";
      for (i =1 ; i <= BIname.Size(); i++)
	outfile << BIname.Get(i) << " ";
      outfile << "\n\n\n";
      
      outfile << "  Nodal coordinates and nodal boundary indicators,\n"
	"  the columns contain:\n"
	"   - node number\n"
	"   - coordinates\n"
	"   - no of boundary indicators that are set (ON)\n"
	"   - the boundary indicators that are set (ON) if any.\n"
	"#\n";

      for (i = 1; i <= np; i++)
        {
          const Point3d & p = mesh.Point(i);

          outfile.width(4);
          outfile << i << "  (";
          outfile.width(10);
          outfile << p.X()/scale << ", ";
          outfile.width(9);
          outfile << p.Y()/scale << ", ";
          outfile.width(9);
          outfile << p.Z()/scale << ") ";
	 
	  if(mesh[PointIndex(i)].Type() != INNERPOINT) 
	    {
	      BCsinpoint.DeleteAll();
	      for (j = 1; j <= nse; j++) 
		{
		  for (k = 1; k <= mesh.SurfaceElement(j).GetNP(); k++) 
		    {
		      if(mesh.SurfaceElement(j).PNum(k)==i) 
			{
			  int BC=mesh.GetFaceDescriptor(mesh.SurfaceElement(j).GetIndex()).BCProperty();
			  int nbcsp=BCsinpoint.Size();
			  int found = 0;
			  for (l = 1; l <= nbcsp; l++)
			    if(BC == BCsinpoint.Get(l)) found = 1;
			  if( ! found ) BCsinpoint.Append(BC); 	    	     
			}
		    }
		}
	      int nbcsp = BCsinpoint.Size();
	      outfile << "[" << nbcsp << "] ";
	      for (j = 1; j <= nbcsp; j++)
		outfile << BCsinpoint.Get(j) << " ";
	      outfile << "\n";
            }
          else outfile << "[0]\n";

//.........这里部分代码省略.........
开发者ID:11235813,项目名称:netgen-csg2d,代码行数:101,代码来源:writediffpack.cpp

示例2: DeleteIdentPoints

 void DeleteIdentPoints(void) const
 { identpoints.DeleteAll();}
开发者ID:OpenCMISS-Dependencies,项目名称:netgen,代码行数:2,代码来源:csgeom.hpp


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