本文整理汇总了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";
//.........这里部分代码省略.........
示例2: DeleteIdentPoints
void DeleteIdentPoints(void) const
{ identpoints.DeleteAll();}