mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-13 17:48:34 +05:00
getvertexsurfaceelement for 2D/3D
This commit is contained in:
parent
b06e66cece
commit
e0293b1bda
@ -1931,6 +1931,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;
|
||||
@ -1941,6 +1945,17 @@ int Ng_GetVertex_SurfaceElements( int vnr, int* elems )
|
||||
|
||||
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 ....
|
||||
int Ng_GetVertex_NElements( int vnr )
|
||||
@ -1954,13 +1969,26 @@ 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