mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
modernize ComputeNVertices
This commit is contained in:
parent
784fad9806
commit
f6a290e44f
@ -5817,34 +5817,17 @@ namespace netgen
|
||||
|
||||
void Mesh :: ComputeNVertices ()
|
||||
{
|
||||
int i, j, nv;
|
||||
int ne = GetNE();
|
||||
// int nse = GetNSE();
|
||||
|
||||
numvertices = 0;
|
||||
for (i = 1; i <= ne; i++)
|
||||
{
|
||||
const Element & el = VolumeElement(i);
|
||||
nv = el.GetNV();
|
||||
for (j = 0; j < nv; j++)
|
||||
if (el[j] > numvertices)
|
||||
numvertices = el[j];
|
||||
}
|
||||
/*
|
||||
for (i = 1; i <= nse; i++)
|
||||
{
|
||||
const Element2d & el = SurfaceElement(i);
|
||||
nv = el.GetNV();
|
||||
for (j = 1; j <= nv; j++)
|
||||
if (el.PNum(j) > numvertices)
|
||||
numvertices = el.PNum(j);
|
||||
}
|
||||
*/
|
||||
for (auto & el : SurfaceElements())
|
||||
|
||||
for (const Element & el : VolumeElements())
|
||||
for (PointIndex v : el.Vertices())
|
||||
if (v > numvertices) numvertices = v;
|
||||
|
||||
for (const Element2d & el : SurfaceElements())
|
||||
for (PointIndex v : el.Vertices())
|
||||
if (v > numvertices) numvertices = v;
|
||||
|
||||
numvertices += 1- PointIndex::BASE;
|
||||
numvertices += 1-PointIndex::BASE;
|
||||
}
|
||||
|
||||
int Mesh :: GetNV () const
|
||||
|
@ -751,6 +751,8 @@ namespace netgen
|
||||
FlatArray<const PointIndex> PNums () const
|
||||
{ return FlatArray<const PointIndex> (np, &pnum[0]); }
|
||||
|
||||
FlatArray<const PointIndex> Vertices() const { return { GetNV(), &pnum[0] }; }
|
||||
|
||||
///
|
||||
PointIndex & PNum (int i) { return pnum[i-1]; }
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user