mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-25 05:20:34 +05:00
Topology: use non-copying access functions, take care of 0/1 - based indexing
This commit is contained in:
parent
6fd99a5a29
commit
0605097bdc
@ -1483,6 +1483,7 @@ namespace netgen
|
|||||||
(ne,
|
(ne,
|
||||||
[&] (IntRange r)
|
[&] (IntRange r)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
NgArray<int> hfaces;
|
NgArray<int> hfaces;
|
||||||
for (ElementIndex ei : r)
|
for (ElementIndex ei : r)
|
||||||
{
|
{
|
||||||
@ -1490,6 +1491,11 @@ namespace netgen
|
|||||||
for (auto f : hfaces)
|
for (auto f : hfaces)
|
||||||
AsAtomic(face_els[f-1])++;
|
AsAtomic(face_els[f-1])++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
for (ElementIndex ei : r)
|
||||||
|
for (auto f : GetFaces(ei))
|
||||||
|
AsAtomic(face_els[f])++;
|
||||||
|
|
||||||
}, TasksPerThread(4));
|
}, TasksPerThread(4));
|
||||||
for (int i = 1; i <= nse; i++)
|
for (int i = 1; i <= nse; i++)
|
||||||
face_surfels[GetSurfaceElementFace (i)-1]++;
|
face_surfels[GetSurfaceElementFace (i)-1]++;
|
||||||
@ -2166,6 +2172,17 @@ namespace netgen
|
|||||||
return FlatArray<T_EDGE>(GetNEdges ( (*mesh)[elnr].GetType()), &surfedges[elnr][0]);
|
return FlatArray<T_EDGE>(GetNEdges ( (*mesh)[elnr].GetType()), &surfedges[elnr][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FlatArray<T_EDGE> MeshTopology :: GetEdges (ElementIndex elnr) const
|
||||||
|
{
|
||||||
|
return FlatArray<T_EDGE>(GetNEdges ( (*mesh)[elnr].GetType()), &edges[elnr][0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
FlatArray<T_FACE> MeshTopology :: GetFaces (ElementIndex elnr) const
|
||||||
|
{
|
||||||
|
return FlatArray<T_FACE>(GetNFaces ( (*mesh)[elnr].GetType()), &faces[elnr][0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int MeshTopology :: GetSurfaceElementFace (int elnr) const
|
int MeshTopology :: GetSurfaceElementFace (int elnr) const
|
||||||
{
|
{
|
||||||
|
@ -103,15 +103,24 @@ public:
|
|||||||
orient = GetSegmentEdgeOrientation(segnr);
|
orient = GetSegmentEdgeOrientation(segnr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[deprecated("use GetEdges (ElementIndex) -> FlatArray")]]
|
||||||
void GetElementEdges (int elnr, NgArray<int> & edges) const;
|
void GetElementEdges (int elnr, NgArray<int> & edges) const;
|
||||||
|
[[deprecated("use GetFaces (ElementIndex) -> FlatArray")]]
|
||||||
void GetElementFaces (int elnr, NgArray<int> & faces, bool withorientation = false) const;
|
void GetElementFaces (int elnr, NgArray<int> & faces, bool withorientation = false) const;
|
||||||
|
|
||||||
|
FlatArray<T_EDGE> GetEdges (ElementIndex elnr) const;
|
||||||
|
FlatArray<T_FACE> GetFaces (ElementIndex elnr) const;
|
||||||
|
|
||||||
|
|
||||||
[[deprecated("use GetElementEdge instead")]]
|
[[deprecated("use GetElementEdge instead")]]
|
||||||
void GetElementEdgeOrientations (int elnr, NgArray<int> & eorient) const;
|
void GetElementEdgeOrientations (int elnr, NgArray<int> & eorient) const;
|
||||||
[[deprecated("use GetElementEdge instead")]]
|
[[deprecated("use GetElementEdge instead")]]
|
||||||
void GetElementFaceOrientations (int elnr, NgArray<int> & forient) const;
|
void GetElementFaceOrientations (int elnr, NgArray<int> & forient) const;
|
||||||
|
|
||||||
|
[[deprecated("use GetEdges (ElementIndex) -> FlatArray")]]
|
||||||
int GetElementEdges (int elnr, int * edges, int * orient) const;
|
int GetElementEdges (int elnr, int * edges, int * orient) const;
|
||||||
|
|
||||||
|
[[deprecated("use GetFaces (ElementIndex) -> FlatArray")]]
|
||||||
int GetElementFaces (int elnr, int * faces, int * orient) const;
|
int GetElementFaces (int elnr, int * faces, int * orient) const;
|
||||||
|
|
||||||
[[deprecated("use GetElementEdge instead")]]
|
[[deprecated("use GetElementEdge instead")]]
|
||||||
|
Loading…
Reference in New Issue
Block a user