mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 14:40:35 +05:00
parallel refinement
This commit is contained in:
parent
bcbc4294bc
commit
ee6fbe65e7
@ -715,7 +715,8 @@ namespace netgen
|
|||||||
template <class T, class S>
|
template <class T, class S>
|
||||||
void QuickSort (FlatArray<T> & data, FlatArray<S> & slave)
|
void QuickSort (FlatArray<T> & data, FlatArray<S> & slave)
|
||||||
{
|
{
|
||||||
QuickSortRec (data, slave, 0, data.Size()-1);
|
if (data.Size() > 1)
|
||||||
|
QuickSortRec (data, slave, 0, data.Size()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ namespace netgen
|
|||||||
|
|
||||||
void ParallelMeshTopology :: Reset ()
|
void ParallelMeshTopology :: Reset ()
|
||||||
{
|
{
|
||||||
|
cout << "ParallelMeshTopology::Reset called" << endl;
|
||||||
*testout << "ParallelMeshTopology::Reset" << endl;
|
*testout << "ParallelMeshTopology::Reset" << endl;
|
||||||
|
|
||||||
if ( ntasks == 1 ) return;
|
if ( ntasks == 1 ) return;
|
||||||
@ -46,6 +47,7 @@ namespace netgen
|
|||||||
SetNV(mesh.GetNV());
|
SetNV(mesh.GetNV());
|
||||||
SetNE(mesh.GetNE());
|
SetNE(mesh.GetNE());
|
||||||
}
|
}
|
||||||
|
cout << "ParallelMeshTopology::Reset complete" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -112,6 +114,7 @@ namespace netgen
|
|||||||
|
|
||||||
void ParallelMeshTopology :: UpdateCoarseGridGlobal ()
|
void ParallelMeshTopology :: UpdateCoarseGridGlobal ()
|
||||||
{
|
{
|
||||||
|
cout << "updatecoarsegridglobal called" << endl;
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
PrintMessage ( 3, "UPDATE GLOBAL COARSEGRID STARTS" );
|
PrintMessage ( 3, "UPDATE GLOBAL COARSEGRID STARTS" );
|
||||||
|
|
||||||
@ -202,6 +205,7 @@ namespace netgen
|
|||||||
|
|
||||||
void ParallelMeshTopology :: UpdateCoarseGrid ()
|
void ParallelMeshTopology :: UpdateCoarseGrid ()
|
||||||
{
|
{
|
||||||
|
cout << "updatecoarsegrid called, is_updated = " << is_updated << endl;
|
||||||
if (is_updated) return;
|
if (is_updated) return;
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
@ -235,15 +239,15 @@ namespace netgen
|
|||||||
|
|
||||||
cout << "update refined vertices" << endl;
|
cout << "update refined vertices" << endl;
|
||||||
// update new vertices after mesh-refinement
|
// update new vertices after mesh-refinement
|
||||||
if (loc2distvert.Size() < mesh.mlbetweennodes)
|
if (loc2distvert.Size() < mesh.mlbetweennodes.Size())
|
||||||
{
|
{
|
||||||
int oldnv = loc2distvert.Size();
|
int oldnv = loc2distvert.Size();
|
||||||
int newnv = mesh.mlbetweennodes.Size();
|
int newnv = mesh.mlbetweennodes.Size();
|
||||||
loc2distvert.ChangeSize(mesh.mlbetweennodes.Size());
|
loc2distvert.ChangeSize(mesh.mlbetweennodes.Size());
|
||||||
for (PointIndex pi = oldnv+PointIndex::BASE; nr < newnv+PointIndex::Base; nr++)
|
for (PointIndex pi = oldnv+PointIndex::BASE; pi < newnv+PointIndex::BASE; pi++)
|
||||||
{
|
{
|
||||||
PointIndex v1 = mesh.mlbetweennodex[pi][0];
|
PointIndex v1 = mesh.mlbetweennodes[pi][0];
|
||||||
PointIndex v2 = mesh.mlbetweennodex[pi][1];
|
PointIndex v2 = mesh.mlbetweennodes[pi][1];
|
||||||
for (int dest = 1; dest < ntasks; dest++)
|
for (int dest = 1; dest < ntasks; dest++)
|
||||||
if (IsExchangeVert (dest, v1) && IsExchangeVert (dest, v2))
|
if (IsExchangeVert (dest, v1) && IsExchangeVert (dest, v2))
|
||||||
SetDistantPNum(dest, pi);
|
SetDistantPNum(dest, pi);
|
||||||
|
@ -333,17 +333,12 @@ DLL_HEADER void ExportNetgenMeshing()
|
|||||||
|
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
{
|
{
|
||||||
cout << "I am proc " << id << " load the mesh" << endl;
|
|
||||||
self.Load(*infile);
|
self.Load(*infile);
|
||||||
cout << "i distribute" << endl;
|
|
||||||
self.Distribute();
|
self.Distribute();
|
||||||
cout << "dist done" << endl;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << "I am proc " << id << endl << " sendrec" << endl;
|
|
||||||
self.SendRecvMesh();
|
self.SendRecvMesh();
|
||||||
cout << "sendrec done" << endl;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
self.Load(*infile);
|
self.Load(*infile);
|
||||||
|
@ -30,7 +30,6 @@ namespace netgen
|
|||||||
// new version with consistent ordering across sub-domains
|
// new version with consistent ordering across sub-domains
|
||||||
|
|
||||||
Array<INDEX_2> parents;
|
Array<INDEX_2> parents;
|
||||||
cout << "find edges" << endl;
|
|
||||||
for (SegmentIndex si = 0; si < mesh.GetNSeg(); si++)
|
for (SegmentIndex si = 0; si < mesh.GetNSeg(); si++)
|
||||||
{
|
{
|
||||||
const Segment & el = mesh[si];
|
const Segment & el = mesh[si];
|
||||||
@ -74,7 +73,7 @@ namespace netgen
|
|||||||
for (int i = 0; i < par_nr.Size(); i++)
|
for (int i = 0; i < par_nr.Size(); i++)
|
||||||
par_nr[i] = i;
|
par_nr[i] = i;
|
||||||
QuickSort (parents, par_nr);
|
QuickSort (parents, par_nr);
|
||||||
|
mesh.mlbetweennodes.SetSize(mesh.GetNV()+parents.Size());
|
||||||
for (int i = 0; i < parents.Size(); i++)
|
for (int i = 0; i < parents.Size(); i++)
|
||||||
{
|
{
|
||||||
between.Set (parents[i], mesh.GetNV()+i+PointIndex::BASE);
|
between.Set (parents[i], mesh.GetNV()+i+PointIndex::BASE);
|
||||||
@ -131,7 +130,6 @@ namespace netgen
|
|||||||
mesh.LineSegment(si) = ns1;
|
mesh.LineSegment(si) = ns1;
|
||||||
mesh.AddSegment (ns2);
|
mesh.AddSegment (ns2);
|
||||||
}
|
}
|
||||||
cout << "have segments" << endl;
|
|
||||||
|
|
||||||
|
|
||||||
// refine surface elements
|
// refine surface elements
|
||||||
|
Loading…
Reference in New Issue
Block a user