mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
less copying
This commit is contained in:
parent
054386388e
commit
1afcb30102
@ -219,11 +219,13 @@ extern "C" {
|
||||
DLL_HEADER int Ng_GetNEdges();
|
||||
DLL_HEADER int Ng_GetNFaces();
|
||||
|
||||
|
||||
[[deprecated("orientation is not supported anymore")]]
|
||||
DLL_HEADER int Ng_GetElement_Edges (int elnr, int * edges, int * orient = 0);
|
||||
[[deprecated("orientation is not supported anymore")]]
|
||||
DLL_HEADER int Ng_GetElement_Faces (int elnr, int * faces, int * orient = 0);
|
||||
|
||||
[[deprecated("orientation is not supported anymore")]]
|
||||
DLL_HEADER int Ng_GetSurfaceElement_Edges (int selnr, int * edges, int * orient = 0);
|
||||
[[deprecated("orientation is not supported anymore")]]
|
||||
DLL_HEADER int Ng_GetSurfaceElement_Face (int selnr, int * orient = 0);
|
||||
|
||||
DLL_HEADER void Ng_GetSurfaceElementNeighbouringDomains(const int selnr, int & in, int & out);
|
||||
|
@ -1878,8 +1878,10 @@ void Ng_GetPeriodicEdges (int idnr, int * pairs)
|
||||
if (other1 && other2 && mesh->IsSegment (other1, other2))
|
||||
{
|
||||
SegmentIndex otherseg = mesh->SegmentNr (other1, other2);
|
||||
pairs[cnt++] = top.GetSegmentEdge (si+1);
|
||||
pairs[cnt++] = top.GetSegmentEdge (otherseg+1);
|
||||
// pairs[cnt++] = top.GetSegmentEdge (si+1);
|
||||
// pairs[cnt++] = top.GetSegmentEdge (otherseg+1);
|
||||
pairs[cnt++] = top.GetEdge (si)+1;
|
||||
pairs[cnt++] = top.GetEdge (otherseg)+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1458,6 +1458,7 @@ namespace netgen
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (info.order > 1)
|
||||
{
|
||||
const MeshTopology & top = mesh.GetTopology();
|
||||
@ -2453,18 +2454,11 @@ namespace netgen
|
||||
{
|
||||
const MeshTopology & top = mesh.GetTopology();
|
||||
|
||||
info.nedges = top.GetElementEdges (elnr+1, info.edgenrs, 0);
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.edgenrs[i]--;
|
||||
for (auto e : top.GetEdges(elnr))
|
||||
info.ndof += edgecoeffsindex[e+1] - edgecoeffsindex[e];
|
||||
|
||||
info.nfaces = top.GetElementFaces (elnr+1, info.facenrs, 0);
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.facenrs[i]--;
|
||||
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.ndof += edgecoeffsindex[info.edgenrs[i]+1] - edgecoeffsindex[info.edgenrs[i]];
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.ndof += facecoeffsindex[info.facenrs[i]+1] - facecoeffsindex[info.facenrs[i]];
|
||||
for (auto f : top.GetFaces(elnr))
|
||||
info.ndof += facecoeffsindex[f+1] - facecoeffsindex[f];
|
||||
}
|
||||
|
||||
return (info.ndof > info.nv);
|
||||
@ -2492,16 +2486,12 @@ namespace netgen
|
||||
{
|
||||
const MeshTopology & top = mesh.GetTopology();
|
||||
|
||||
info.nedges = top.GetElementEdges (elnr+1, info.edgenrs, 0);
|
||||
for (int i = 0; i < info.nedges; i++) info.edgenrs[i]--;
|
||||
for (auto e : top.GetEdges(elnr))
|
||||
if (edgecoeffsindex[e+1] > edgecoeffsindex[e]) return true;
|
||||
|
||||
info.nfaces = top.GetElementFaces (elnr+1, info.facenrs, 0);
|
||||
for (int i = 0; i < info.nfaces; i++) info.facenrs[i]--;
|
||||
for (auto f : top.GetFaces(elnr))
|
||||
if (facecoeffsindex[f+1] > facecoeffsindex[f]) return true;
|
||||
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
if (edgecoeffsindex[info.edgenrs[i]+1] > edgecoeffsindex[info.edgenrs[i]]) return true;
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
if (facecoeffsindex[info.facenrs[i]+1] > facecoeffsindex[info.facenrs[i]]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -2571,6 +2561,7 @@ namespace netgen
|
||||
{
|
||||
const MeshTopology & top = mesh.GetTopology();
|
||||
|
||||
/*
|
||||
info.nedges = top.GetElementEdges (elnr+1, info.edgenrs, 0);
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.edgenrs[i]--;
|
||||
@ -2578,11 +2569,22 @@ namespace netgen
|
||||
info.nfaces = top.GetElementFaces (elnr+1, info.facenrs, 0);
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.facenrs[i]--;
|
||||
*/
|
||||
info.SetEdges (top.GetEdges(elnr));
|
||||
info.SetFaces (top.GetFaces(elnr));
|
||||
|
||||
/*
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.ndof += edgecoeffsindex[info.edgenrs[i]+1] - edgecoeffsindex[info.edgenrs[i]];
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.ndof += facecoeffsindex[info.facenrs[i]+1] - facecoeffsindex[info.facenrs[i]];
|
||||
*/
|
||||
|
||||
for (auto e : info.GetEdges())
|
||||
info.ndof += edgecoeffsindex[e+1] - edgecoeffsindex[e];
|
||||
|
||||
for (auto f : info.GetFaces())
|
||||
info.ndof += facecoeffsindex[f+1] - facecoeffsindex[f];
|
||||
}
|
||||
}
|
||||
|
||||
@ -4604,19 +4606,14 @@ namespace netgen
|
||||
{
|
||||
const MeshTopology & top = mesh.GetTopology();
|
||||
|
||||
info.nedges = top.GetElementEdges (elnr+1, info.edgenrs, 0);
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.edgenrs[i]--;
|
||||
info.SetEdges (top.GetEdges(elnr));
|
||||
info.SetFaces (top.GetFaces(elnr));
|
||||
|
||||
info.nfaces = top.GetElementFaces (elnr+1, info.facenrs, 0);
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.facenrs[i]--;
|
||||
for (auto e : info.GetEdges())
|
||||
info.ndof += edgecoeffsindex[e+1] - edgecoeffsindex[e];
|
||||
|
||||
for (int i = 0; i < info.nedges; i++)
|
||||
info.ndof += edgecoeffsindex[info.edgenrs[i]+1] - edgecoeffsindex[info.edgenrs[i]];
|
||||
for (int i = 0; i < info.nfaces; i++)
|
||||
info.ndof += facecoeffsindex[info.facenrs[i]+1] - facecoeffsindex[info.facenrs[i]];
|
||||
// info.ndof += facecoeffsindex[info.facenr+1] - facecoeffsindex[info.facenr];
|
||||
for (auto f : info.GetFaces())
|
||||
info.ndof += facecoeffsindex[f+1] - facecoeffsindex[f];
|
||||
}
|
||||
|
||||
// NgProfiler::StopTimer (timer2);
|
||||
|
@ -206,6 +206,26 @@ private:
|
||||
int facenrs[6];
|
||||
Mat<3> hdxdxi;
|
||||
Vec<3> hcoefs[10]; // enough for second order tets
|
||||
|
||||
void SetEdges (FlatArray<int> edges)
|
||||
{
|
||||
nedges = edges.Size();
|
||||
for (int i = 0; i < edges.Size(); i++)
|
||||
edgenrs[i] = edges[i];
|
||||
}
|
||||
|
||||
auto GetEdges() const
|
||||
{ return FlatArray(nedges, edgenrs); }
|
||||
|
||||
void SetFaces (FlatArray<int> faces)
|
||||
{
|
||||
nfaces = faces.Size();
|
||||
for (int i = 0; i < faces.Size(); i++)
|
||||
facenrs[i] = faces[i];
|
||||
}
|
||||
|
||||
auto GetFaces() const
|
||||
{ return FlatArray(nfaces, facenrs); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
@ -34,7 +34,9 @@ namespace netgen
|
||||
void Reset ();
|
||||
void Print() const;
|
||||
|
||||
|
||||
void UpdateCoarseGrid();
|
||||
[[deprecated("should not need it anymore")]]
|
||||
void UpdateCoarseGridGlobal();
|
||||
void IdentifyVerticesAfterRefinement();
|
||||
void EnumeratePointsGlobally ();
|
||||
|
@ -149,7 +149,9 @@ public:
|
||||
|
||||
void GetSurfaceElementEdges (int elnr, NgArray<int> & edges) const;
|
||||
int GetSurfaceElementFace (int elnr) const;
|
||||
[[deprecated("orientation is outdated")]]
|
||||
void GetSurfaceElementEdgeOrientations (int elnr, NgArray<int> & eorient) const;
|
||||
[[deprecated("orientation is outdated")]]
|
||||
int GetSurfaceElementFaceOrientation (int elnr) const;
|
||||
|
||||
[[deprecated("use GetEdge -> FlatArray instead")]]
|
||||
|
Loading…
Reference in New Issue
Block a user