parallel refinement

This commit is contained in:
Joachim Schoeberl 2016-02-28 12:21:36 +01:00
parent fbb7071939
commit 2e6f7850d7
2 changed files with 20 additions and 10 deletions

View File

@ -292,21 +292,20 @@ namespace netgen
for (int edge = 1; edge <= ned; edge++)
{
topology.GetEdgeVertices (edge, v1, v2);
// INDEX_2 es(GetGlobalPNum(v1), GetGlobalPNum(v2));
// es.Sort();
INDEX_2 es(GetGlobalPNum(v1), GetGlobalPNum(v2));
es.Sort();
// gv2e.Set (es, edge);
gv2e.Set (es, edge);
for (int dest = 1; dest < ntasks; dest++)
if (IsExchangeVert (dest, v1) && IsExchangeVert (dest, v2))
{
SetDistantEdgeNum(dest, edge);
// send_edges.Add (dest-1, es[0]);
// send_edges.Add (dest-1, es[1]);
// SetDistantEdgeNum(dest, edge);
send_edges.Add (dest-1, es[0]);
send_edges.Add (dest-1, es[1]);
}
}
/*
TABLE<int> recv_edges(ntasks-1);
MyMPI_ExchangeTable (send_edges, recv_edges, MPI_TAG_MESH+9, MPI_LocalComm);
@ -321,7 +320,6 @@ namespace netgen
SetDistantEdgeNum (sender, gv2e.Get(gv12));
}
}
*/
NgProfiler::StopTimer (timere);
@ -331,10 +329,10 @@ namespace netgen
if (mesh.GetDimension() == 3)
{
NgProfiler::StartTimer (timerf);
Array<int> verts;
// exchange faces
cnt_send = 0;
Array<int> verts;
for (int face = 1; face <= nfa; face++)
{
topology.GetFaceVertices (face, verts);
@ -344,13 +342,14 @@ namespace netgen
IsExchangeVert (dest, verts[2]))
cnt_send[dest-1]+=3;
}
TABLE<int> send_faces(cnt_send);
INDEX_3_HASHTABLE<int> gv2f(2*nfa);
for (int face = 1; face <= nfa; face++)
{
topology.GetFaceVertices (face, verts);
INDEX_3 fs (GetGlobalPNum(verts[0]),
GetGlobalPNum(verts[1]),
GetGlobalPNum(verts[2]));
@ -363,6 +362,7 @@ namespace netgen
IsExchangeVert (dest, verts[1]) &&
IsExchangeVert (dest, verts[2]))
{
// SetDistantFaceNum (dest, face);
send_faces.Add (dest-1, fs[0]);
send_faces.Add (dest-1, fs[1]);
send_faces.Add (dest-1, fs[2]);

View File

@ -375,6 +375,7 @@ namespace netgen
i2.I2() = pnums.Get(betw[j][1]);
i2.Sort();
/*
if (between.Used(i2))
pnums.Elem(5+j) = between.Get(i2);
else
@ -384,6 +385,15 @@ namespace netgen
mesh.Point(i2.I2())));
between.Set (i2, pnums.Elem(5+j));
}
*/
PointIndex pinew = between.Get(i2);
pnums.Elem(j+5) = pinew;
if (!pointset[pinew])
{
pointset[pinew] = true;
mesh.Point(pinew) = Center(mesh.Point(i2.I1()),
mesh.Point(i2.I2()));
}
}
static int reftab[8][4] =