mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
TABLE -> Table
This commit is contained in:
parent
0cc25359c2
commit
99e001fc4c
@ -271,18 +271,18 @@ template <> NGX_INLINE DLL_HEADER const Ng_Node<0> Ngx_Mesh :: GetNode<0> (int v
|
||||
node.elements.ne = ia.Size();
|
||||
node.elements.ptr = (int*)&ia[0];
|
||||
|
||||
NgFlatArray<SegmentIndex> bia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
auto bia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
node.bnd_elements.ne = bia.Size();
|
||||
node.bnd_elements.ptr = (int*)&bia[0];
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
NgFlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
auto ia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
node.elements.ne = ia.Size();
|
||||
node.elements.ptr = (int*)&ia[0];
|
||||
|
||||
NgFlatArray<int> bia = mesh->GetTopology().GetVertexPointElements(vnr);
|
||||
auto bia = mesh->GetTopology().GetVertexPointElements(vnr);
|
||||
node.bnd_elements.ne = bia.Size();
|
||||
node.bnd_elements.ptr = (int*)&bia[0];
|
||||
break;
|
||||
|
@ -1653,7 +1653,7 @@ void Ng_GetVertexElements (int vnr, int * els)
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
NgFlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
auto ia = mesh->GetTopology().GetVertexSegments(vnr);
|
||||
for (int i = 0; i < ia.Size(); i++) els[i] = ia[i]+1;
|
||||
break;
|
||||
/*
|
||||
|
@ -408,36 +408,22 @@ namespace netgen
|
||||
vert2element = mesh->CreatePoint2ElementTable();
|
||||
vert2surfelement = mesh->CreatePoint2SurfaceElementTable(0);
|
||||
|
||||
cnt = 0;
|
||||
for (SegmentIndex si = 0; si < nseg; si++)
|
||||
{
|
||||
const Segment & seg = mesh->LineSegment(si);
|
||||
cnt[seg[0]]++;
|
||||
cnt[seg[1]]++;
|
||||
}
|
||||
|
||||
vert2segment = TABLE<SegmentIndex,PointIndex::BASE> (cnt);
|
||||
for (SegmentIndex si = 0; si < nseg; si++)
|
||||
{
|
||||
const Segment & seg = mesh->LineSegment(si);
|
||||
vert2segment.AddSave (seg[0], si);
|
||||
vert2segment.AddSave (seg[1], si);
|
||||
}
|
||||
vert2segment = ngcore::CreateSortedTable<SegmentIndex, PointIndex>( mesh->LineSegments().Range(),
|
||||
[&](auto & table, SegmentIndex segi)
|
||||
{
|
||||
const Segment & seg = (*mesh)[segi];
|
||||
table.Add (seg[0], segi);
|
||||
table.Add (seg[1], segi);
|
||||
}, np);
|
||||
|
||||
vert2pointelement = ngcore::CreateSortedTable<int, PointIndex>( mesh->pointelements.Range(),
|
||||
[&](auto & table, int pei)
|
||||
{
|
||||
const Element0d & pointel = mesh->pointelements[pei];
|
||||
table.Add(pointel.pnum, pei);
|
||||
}, np);
|
||||
|
||||
|
||||
cnt = 0;
|
||||
for (int pei = 0; pei < mesh->pointelements.Size(); pei++)
|
||||
{
|
||||
const Element0d & pointel = mesh->pointelements[pei];
|
||||
cnt[pointel.pnum]++;
|
||||
}
|
||||
|
||||
vert2pointelement = TABLE<int,PointIndex::BASE> (cnt);
|
||||
for (int pei = 0; pei < mesh->pointelements.Size(); pei++)
|
||||
{
|
||||
const Element0d & pointel = mesh->pointelements[pei];
|
||||
vert2pointelement.AddSave (pointel.pnum, pei);
|
||||
}
|
||||
(*tracer) ("Topology::Update setup tables", true);
|
||||
|
||||
|
||||
|
@ -67,8 +67,8 @@ class MeshTopology
|
||||
Array<SegmentIndex> edge2segment;
|
||||
Table<ElementIndex, PointIndex> vert2element;
|
||||
Table<SurfaceElementIndex, PointIndex> vert2surfelement;
|
||||
TABLE<SegmentIndex,PointIndex::BASE> vert2segment;
|
||||
TABLE<int,PointIndex::BASE> vert2pointelement;
|
||||
Table<SegmentIndex,PointIndex> vert2segment;
|
||||
Table<int,PointIndex> vert2pointelement;
|
||||
int timestamp;
|
||||
public:
|
||||
int GetNSurfedges() const {return surfedges.Size();}
|
||||
@ -183,10 +183,10 @@ public:
|
||||
FlatArray<SurfaceElementIndex> GetVertexSurfaceElements(PointIndex vnr) const
|
||||
{ return vert2surfelement[vnr]; }
|
||||
|
||||
NgFlatArray<SegmentIndex> GetVertexSegments (int vnr) const
|
||||
FlatArray<SegmentIndex> GetVertexSegments (int vnr) const
|
||||
{ return vert2segment[vnr]; }
|
||||
|
||||
NgFlatArray<int> GetVertexPointElements (int vnr) const
|
||||
FlatArray<int> GetVertexPointElements (int vnr) const
|
||||
{ return vert2pointelement[vnr]; }
|
||||
|
||||
int GetVerticesEdge ( int v1, int v2) const;
|
||||
|
Loading…
Reference in New Issue
Block a user