mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
getvertexsurfaceelement for 2D/3D
This commit is contained in:
parent
b06e66cece
commit
e0293b1bda
@ -1932,6 +1932,10 @@ int Ng_GetVertex_Elements( int vnr, int* elems )
|
||||
///// Added by Roman Stainko ....
|
||||
int Ng_GetVertex_SurfaceElements( int vnr, int* elems )
|
||||
{
|
||||
switch (mesh->GetDimension())
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
const MeshTopology& topology = mesh->GetTopology();
|
||||
ArrayMem<int,4> indexArray;
|
||||
topology.GetVertexSurfaceElements( vnr, indexArray );
|
||||
@ -1940,6 +1944,17 @@ int Ng_GetVertex_SurfaceElements( int vnr, int* elems )
|
||||
elems[i] = indexArray[i];
|
||||
|
||||
return indexArray.Size();
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
int cnt = 0;
|
||||
for (SegmentIndex i = 0; i < mesh->GetNSeg(); i++)
|
||||
if ( ((*mesh)[i][0] == vnr) || ((*mesh)[i][1] == vnr) )
|
||||
elems[cnt++] = i+1;
|
||||
return cnt;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
///// Added by Roman Stainko ....
|
||||
@ -1955,11 +1970,24 @@ int Ng_GetVertex_NElements( int vnr )
|
||||
///// Added by Roman Stainko ....
|
||||
int Ng_GetVertex_NSurfaceElements( int vnr )
|
||||
{
|
||||
switch (mesh->GetDimension())
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
const MeshTopology& topology = mesh->GetTopology();
|
||||
ArrayMem<int,4> indexArray;
|
||||
topology.GetVertexSurfaceElements( vnr, indexArray );
|
||||
|
||||
return indexArray.Size();
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
int cnt = 0;
|
||||
for (SegmentIndex i = 0; i < mesh->GetNSeg(); i++)
|
||||
if ( ((*mesh)[i][0] == vnr) || ((*mesh)[i][1] == vnr) ) cnt++;
|
||||
return cnt;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user