don't store partition in element (most times waste of mem)

This commit is contained in:
Joachim Schöberl 2019-02-15 14:34:27 +01:00
parent 0a1976ba47
commit 179c3bb02f
9 changed files with 132 additions and 70 deletions

View File

@ -389,11 +389,11 @@ extern "C" {
DLL_HEADER void Ng_InitPointCurve(double red, double green, double blue); DLL_HEADER void Ng_InitPointCurve(double red, double green, double blue);
DLL_HEADER void Ng_AddPointCurvePoint(const double * point); DLL_HEADER void Ng_AddPointCurvePoint(const double * point);
#ifdef PARALLEL // #ifdef PARALLEL
void Ng_SetElementPartition ( int elnr, int part ); // void Ng_SetElementPartition ( int elnr, int part );
int Ng_GetElementPartition ( int elnr ); // int Ng_GetElementPartition ( int elnr );
#endif // #endif
DLL_HEADER void Ng_SaveMesh ( const char * meshfile ); DLL_HEADER void Ng_SaveMesh ( const char * meshfile );
DLL_HEADER void Ng_Bisect ( const char * refinementfile ); DLL_HEADER void Ng_Bisect ( const char * refinementfile );

View File

@ -2069,7 +2069,7 @@ void Ng_SocketClientGetServerClientID ( const int number, int * id )
/*
#ifdef PARALLEL #ifdef PARALLEL
void Ng_SetElementPartition ( const int elnr, const int part ) void Ng_SetElementPartition ( const int elnr, const int part )
{ {
@ -2081,6 +2081,7 @@ int Ng_GetElementPartition ( const int elnr )
return mesh->VolumeElement(elnr+1).GetPartition(); return mesh->VolumeElement(elnr+1).GetPartition();
} }
#endif #endif
*/
void Ng_InitPointCurve(double red, double green, double blue) void Ng_InitPointCurve(double red, double green, double blue)

View File

@ -860,6 +860,11 @@ namespace netgen
void SendMesh ( ) const; // Mesh * mastermesh, Array<int> & neloc) const; void SendMesh ( ) const; // Mesh * mastermesh, Array<int> & neloc) const;
/// loads a mesh sent from master processor /// loads a mesh sent from master processor
void ReceiveParallelMesh (); void ReceiveParallelMesh ();
Array<int> vol_partition;
Array<int> surf_partition;
Array<int> seg_partition;
#else #else
void Distribute () {} void Distribute () {}
void SendRecvMesh () {} void SendRecvMesh () {}

View File

@ -1073,9 +1073,9 @@ namespace netgen
flags.fixed = 0; flags.fixed = 0;
orderx = ordery = orderz = 1; orderx = ordery = orderz = 1;
is_curved = typ != TET; // false; is_curved = typ != TET; // false;
#ifdef PARALLEL // #ifdef PARALLEL
partitionNumber = -1; // partitionNumber = -1;
#endif // #endif
} }

View File

@ -377,9 +377,9 @@ namespace netgen
unsigned int orderx:6; unsigned int orderx:6;
unsigned int ordery:6; unsigned int ordery:6;
#ifdef PARALLEL // #ifdef PARALLEL
int partitionNumber; // int partitionNumber;
#endif // #endif
/// a linked list for all segments in the same face /// a linked list for all segments in the same face
SurfaceElementIndex next; SurfaceElementIndex next;
@ -608,10 +608,12 @@ namespace netgen
/// ///
int hp_elnr; int hp_elnr;
/*
#ifdef PARALLEL #ifdef PARALLEL
int GetPartition () const { return partitionNumber; } int GetPartition () const { return partitionNumber; }
void SetPartition (int nr) { partitionNumber = nr; }; void SetPartition (int nr) { partitionNumber = nr; };
#endif #endif
*/
}; };
ostream & operator<<(ostream & s, const Element2d & el); ostream & operator<<(ostream & s, const Element2d & el);
@ -676,11 +678,11 @@ namespace netgen
float badness; float badness;
bool is_curved:1; // element is (high order) curved bool is_curved:1; // element is (high order) curved
#ifdef PARALLEL // #ifdef PARALLEL
/// number of partition for parallel computation /// number of partition for parallel computation
int partitionNumber; // int partitionNumber;
#endif // #endif
public: public:
flagstruct flags; flagstruct flags;
@ -902,14 +904,15 @@ namespace netgen
bool IsCurved () const { return is_curved; } bool IsCurved () const { return is_curved; }
void SetCurved (bool acurved) { is_curved = acurved; } void SetCurved (bool acurved) { is_curved = acurved; }
/*
#ifdef PARALLEL #ifdef PARALLEL
int GetPartition () const { return partitionNumber; } int GetPartition () const { return partitionNumber; }
void SetPartition (int nr) { partitionNumber = nr; }; void SetPartition (int nr) { partitionNumber = nr; };
#else #else
int GetPartition () const { return 0; } int GetPartition () const { return 0; }
#endif #endif
*/
int hp_elnr; int hp_elnr;
}; };
@ -967,10 +970,10 @@ namespace netgen
/// ///
int meshdocval; int meshdocval;
#ifdef PARALLEL // #ifdef PARALLEL
/// number of partition for parallel computation /// number of partition for parallel computation
int partitionNumber; // int partitionNumber;
#endif // #endif
private: private:
string* bcname; string* bcname;
@ -1025,12 +1028,15 @@ namespace netgen
bool IsCurved () const { return is_curved; } bool IsCurved () const { return is_curved; }
void SetCurved (bool acurved) { is_curved = acurved; } void SetCurved (bool acurved) { is_curved = acurved; }
/*
#ifdef PARALLEL #ifdef PARALLEL
int GetPartition () const { return partitionNumber; } int GetPartition () const { return partitionNumber; }
void SetPartition (int nr) { partitionNumber = nr; }; void SetPartition (int nr) { partitionNumber = nr; };
#else #else
int GetPartition () const { return 0; } int GetPartition () const { return 0; }
#endif #endif
*/
void DoArchive (Archive & ar); void DoArchive (Archive & ar);
}; };

View File

@ -87,34 +87,39 @@ namespace netgen
Array<int> num_els_on_proc(ntasks); Array<int> num_els_on_proc(ntasks);
num_els_on_proc = 0; num_els_on_proc = 0;
for (ElementIndex ei = 0; ei < GetNE(); ei++) for (ElementIndex ei = 0; ei < GetNE(); ei++)
num_els_on_proc[(*this)[ei].GetPartition()]++; // num_els_on_proc[(*this)[ei].GetPartition()]++;
num_els_on_proc[vol_partition[ei]]++;
MPI_Scatter (&num_els_on_proc[0], 1, MPI_INT, MPI_Scatter (&num_els_on_proc[0], 1, MPI_INT,
MPI_IN_PLACE, -1, MPI_INT, 0, comm); MPI_IN_PLACE, -1, MPI_INT, 0, comm);
TABLE<ElementIndex> els_of_proc (num_els_on_proc); TABLE<ElementIndex> els_of_proc (num_els_on_proc);
for (ElementIndex ei = 0; ei < GetNE(); ei++) for (ElementIndex ei = 0; ei < GetNE(); ei++)
els_of_proc.Add ( (*this)[ei].GetPartition(), ei); // els_of_proc.Add ( (*this)[ei].GetPartition(), ei);
els_of_proc.Add (vol_partition[ei], ei);
PrintMessage ( 3, "Building vertex/proc mapping"); PrintMessage ( 3, "Building vertex/proc mapping");
Array<int> num_sels_on_proc(ntasks); Array<int> num_sels_on_proc(ntasks);
num_sels_on_proc = 0; num_sels_on_proc = 0;
for (SurfaceElementIndex ei = 0; ei < GetNSE(); ei++) for (SurfaceElementIndex ei = 0; ei < GetNSE(); ei++)
num_sels_on_proc[(*this)[ei].GetPartition()]++; // num_sels_on_proc[(*this)[ei].GetPartition()]++;
num_sels_on_proc[surf_partition[ei]]++;
TABLE<SurfaceElementIndex> sels_of_proc (num_sels_on_proc); TABLE<SurfaceElementIndex> sels_of_proc (num_sels_on_proc);
for (SurfaceElementIndex ei = 0; ei < GetNSE(); ei++) for (SurfaceElementIndex ei = 0; ei < GetNSE(); ei++)
sels_of_proc.Add ( (*this)[ei].GetPartition(), ei); // sels_of_proc.Add ( (*this)[ei].GetPartition(), ei);
sels_of_proc.Add (surf_partition[ei], ei);
Array<int> num_segs_on_proc(ntasks); Array<int> num_segs_on_proc(ntasks);
num_segs_on_proc = 0; num_segs_on_proc = 0;
for (SegmentIndex ei = 0; ei < GetNSeg(); ei++) for (SegmentIndex ei = 0; ei < GetNSeg(); ei++)
num_segs_on_proc[(*this)[ei].GetPartition()]++; // num_segs_on_proc[(*this)[ei].GetPartition()]++;
num_segs_on_proc[seg_partition[ei]]++;
TABLE<SegmentIndex> segs_of_proc (num_segs_on_proc); TABLE<SegmentIndex> segs_of_proc (num_segs_on_proc);
for (SegmentIndex ei = 0; ei < GetNSeg(); ei++) for (SegmentIndex ei = 0; ei < GetNSeg(); ei++)
segs_of_proc.Add ( (*this)[ei].GetPartition(), ei); segs_of_proc.Add (seg_partition[ei], ei);
/** /**
@ -407,7 +412,8 @@ namespace netgen
for ( int ei = 1; ei <= GetNE(); ei++) for ( int ei = 1; ei <= GetNE(); ei++)
{ {
const Element & el = VolumeElement (ei); const Element & el = VolumeElement (ei);
int dest = el.GetPartition(); // int dest = el.GetPartition();
int dest = vol_partition[ei-1];
elarraysize[dest] += 3 + el.GetNP(); elarraysize[dest] += 3 + el.GetNP();
} }
@ -416,8 +422,9 @@ namespace netgen
for (int ei = 1; ei <= GetNE(); ei++) for (int ei = 1; ei <= GetNE(); ei++)
{ {
const Element & el = VolumeElement (ei); const Element & el = VolumeElement (ei);
int dest = el.GetPartition(); // int dest = el.GetPartition();
int dest = vol_partition[ei-1];
elementarrays.Add (dest, ei); elementarrays.Add (dest, ei);
elementarrays.Add (dest, el.GetIndex()); elementarrays.Add (dest, el.GetIndex());
elementarrays.Add (dest, el.GetNP()); elementarrays.Add (dest, el.GetNP());
@ -495,11 +502,13 @@ namespace netgen
for (SurfaceElementIndex sei = 0; sei < GetNSE(); sei++ ) for (SurfaceElementIndex sei = 0; sei < GetNSE(); sei++ )
{ {
const Element2d & sel = (*this)[sei]; const Element2d & sel = (*this)[sei];
int dest = (*this)[sei].GetPartition(); // int dest = (*this)[sei].GetPartition();
int dest = surf_partition[sei];
f(sei, sel, dest); f(sei, sel, dest);
if(ided_sel[sei]!=-1) if(ided_sel[sei]!=-1)
{ {
int dest2 = (*this)[ided_sel[sei]].GetPartition(); // int dest2 = (*this)[ided_sel[sei]].GetPartition();
int dest2 = surf_partition[ided_sel[sei]];
f(sei, sel, dest2); f(sei, sel, dest2);
} }
} }
@ -637,10 +646,12 @@ namespace netgen
{ {
const Segment & seg = (*this)[segi]; const Segment & seg = (*this)[segi];
dests.SetSize(0); dests.SetSize(0);
dests.Append(seg.GetPartition()); // dests.Append(seg.GetPartition());
dests.Append(seg_partition[segi]);
for (int l = 0; l < per_seg_trans[segi].Size(); l++) for (int l = 0; l < per_seg_trans[segi].Size(); l++)
{ {
int dest2 = (*this)[per_seg_trans[segi][l]].GetPartition(); // int dest2 = (*this)[per_seg_trans[segi][l]].GetPartition();
int dest2 = seg_partition[per_seg_trans[segi][l]];
if(!dests.Contains(dest2)) if(!dests.Contains(dest2))
dests.Append(dest2); dests.Append(dest2);
} }
@ -1075,14 +1086,20 @@ namespace netgen
idxtype nparts = GetCommunicator().Size()-1; idxtype nparts = GetCommunicator().Size()-1;
vol_partition.SetSize(GetNE());
surf_partition.SetSize(GetNSE());
seg_partition.SetSize(GetNSeg());
if (nparts == 1) if (nparts == 1)
{ {
for (int i = 0; i < GetNE(); i++) for (int i = 0; i < GetNE(); i++)
VolumeElement(i+1).SetPartition(1); // VolumeElement(i+1).SetPartition(1);
vol_partition[i]= 1;
for (int i = 0; i < GetNSE(); i++) for (int i = 0; i < GetNSE(); i++)
SurfaceElement(i+1).SetPartition(1); // SurfaceElement(i+1).SetPartition(1);
surf_partition[i] = 1;
for (int i = 0; i < GetNSeg(); i++) for (int i = 0; i < GetNSeg(); i++)
LineSegment(i+1).SetPartition(1); // LineSegment(i+1).SetPartition(1);
seg_partition[i] = 1;
} }
else else
@ -1105,11 +1122,14 @@ namespace netgen
// cout << "done" << endl; // cout << "done" << endl;
for (int i = 0; i < GetNE(); i++) for (int i = 0; i < GetNE(); i++)
VolumeElement(i+1).SetPartition(epart[i] + 1); // VolumeElement(i+1).SetPartition(epart[i] + 1);
vol_partition[i]= epart[i] + 1;
for (int i = 0; i < GetNSE(); i++) for (int i = 0; i < GetNSE(); i++)
SurfaceElement(i+1).SetPartition(epart[i+GetNE()] + 1); // SurfaceElement(i+1).SetPartition(epart[i+GetNE()] + 1);
surf_partition[i] = epart[i+GetNE()] + 1;
for (int i = 0; i < GetNSeg(); i++) for (int i = 0; i < GetNSeg(); i++)
LineSegment(i+1).SetPartition(epart[i+GetNE()+GetNSE()] + 1); // LineSegment(i+1).SetPartition(epart[i+GetNE()+GetNSE()] + 1);
seg_partition[i] = epart[i+GetNE()+GetNSE()] + 1;
} }
@ -1185,7 +1205,8 @@ namespace netgen
// FlatArray<ElementIndex> els = pnt2el[pi1]; // FlatArray<ElementIndex> els = pnt2el[pi1];
FlatArray<int> els = pnt2el[pi1]; FlatArray<int> els = pnt2el[pi1];
sel.SetPartition (-1); // sel.SetPartition (-1);
surf_partition[sei] = -1;
for (int j = 0; j < els.Size(); j++) for (int j = 0; j < els.Size(); j++)
{ {
@ -1205,11 +1226,13 @@ namespace netgen
if (hasall) if (hasall)
{ {
sel.SetPartition (el.GetPartition()); // sel.SetPartition (el.GetPartition());
surf_partition[sei] = vol_partition[ElementIndex(els[j])];
break; break;
} }
} }
if (sel.GetPartition() == -1) // if (sel.GetPartition() == -1)
if (surf_partition[sei] == -1)
cerr << "no volume element found" << endl; cerr << "no volume element found" << endl;
} }
@ -1220,7 +1243,8 @@ namespace netgen
PointIndex pi1 = sel[0]; PointIndex pi1 = sel[0];
FlatArray<int> els = pnt2el[pi1]; FlatArray<int> els = pnt2el[pi1];
sel.SetPartition (-1); // sel.SetPartition (-1);
seg_partition[si] = -1;
for (int j = 0; j < els.Size(); j++) for (int j = 0; j < els.Size(); j++)
{ {
@ -1239,11 +1263,13 @@ namespace netgen
if (hasall) if (hasall)
{ {
sel.SetPartition (el.GetPartition()); // sel.SetPartition (el.GetPartition());
seg_partition[si] = vol_partition[ElementIndex(els[j])];
break; break;
} }
} }
if (sel.GetPartition() == -1) // if (sel.GetPartition() == -1)
if (seg_partition[si] == -1)
cerr << "no volume element found" << endl; cerr << "no volume element found" << endl;
} }
} }
@ -1252,7 +1278,8 @@ namespace netgen
for (SegmentIndex segi = 0; segi < GetNSeg(); segi++) for (SegmentIndex segi = 0; segi < GetNSeg(); segi++)
{ {
Segment & seg = (*this)[segi]; Segment & seg = (*this)[segi];
seg.SetPartition(-1); // seg.SetPartition(-1);
seg_partition[segi] = -1;
PointIndex pi1 = seg[0]; PointIndex pi1 = seg[0];
FlatArray<int> sels = pnt2el[pi1]; FlatArray<int> sels = pnt2el[pi1];
@ -1264,12 +1291,14 @@ namespace netgen
for (int l = 0; l < se.GetNP(); l++ && !found) for (int l = 0; l < se.GetNP(); l++ && !found)
found |= (se[l]==seg[1]); found |= (se[l]==seg[1]);
if(found) { if(found) {
seg.SetPartition(se.GetPartition()); // seg.SetPartition(se.GetPartition());
seg_partition[segi] = surf_partition[sei];
break; break;
} }
} }
if (seg.GetPartition() == -1) { // if (seg.GetPartition() == -1) {
if (seg_partition[segi] == -1) {
cout << endl << "segi: " << segi << endl; cout << endl << "segi: " << segi << endl;
cout << "points: " << seg[0] << " " << seg[1] << endl; cout << "points: " << seg[0] << " " << seg[1] << endl;
cout << "surfels: " << endl << sels << endl; cout << "surfels: " << endl << sels << endl;
@ -1387,15 +1416,21 @@ namespace netgen
Array<idx_t> epart(ne), npart(nn); Array<idx_t> epart(ne), npart(nn);
idxtype nparts = GetCommunicator().Size()-1; idxtype nparts = GetCommunicator().Size()-1;
vol_partition.SetSize(GetNE());
surf_partition.SetSize(GetNSE());
seg_partition.SetSize(GetNSeg());
if (nparts == 1) if (nparts == 1)
{ {
for (int i = 0; i < GetNE(); i++) for (int i = 0; i < GetNE(); i++)
VolumeElement(i+1).SetPartition(1); // VolumeElement(i+1).SetPartition(1);
vol_partition[i] = 1;
for (int i = 0; i < GetNSE(); i++) for (int i = 0; i < GetNSE(); i++)
SurfaceElement(i+1).SetPartition(1); // SurfaceElement(i+1).SetPartition(1);
surf_partition[i] = 1;
for (int i = 0; i < GetNSeg(); i++) for (int i = 0; i < GetNSeg(); i++)
LineSegment(i+1).SetPartition(1); // LineSegment(i+1).SetPartition(1);
seg_partition[i] = 1;
return; return;
} }
@ -1416,11 +1451,14 @@ namespace netgen
// cout << "done" << endl; // cout << "done" << endl;
for (int i = 0; i < GetNE(); i++) for (int i = 0; i < GetNE(); i++)
VolumeElement(i+1).SetPartition(epart[i] + 1); // VolumeElement(i+1).SetPartition(epart[i] + 1);
vol_partition[i] = epart[i] + 1;
for (int i = 0; i < GetNSE(); i++) for (int i = 0; i < GetNSE(); i++)
SurfaceElement(i+1).SetPartition(epart[i+GetNE()] + 1); // SurfaceElement(i+1).SetPartition(epart[i+GetNE()] + 1);
surf_partition[i] = epart[i+GetNE()] + 1;
for (int i = 0; i < GetNSeg(); i++) for (int i = 0; i < GetNSeg(); i++)
LineSegment(i+1).SetPartition(epart[i+GetNE()+GetNSE()] + 1); // LineSegment(i+1).SetPartition(epart[i+GetNE()+GetNSE()] + 1);
seg_partition[i] = epart[i+GetNE()+GetNSE()] + 1;
} }
#endif #endif
@ -1648,7 +1686,7 @@ namespace netgen
#endif #endif
Array<int> nodesinpart(ntasks); Array<int> nodesinpart(ntasks);
vol_partition.SetSize(ne);
for ( int el = 1; el <= ne; el++ ) for ( int el = 1; el <= ne; el++ )
{ {
Element & volel = VolumeElement(el); Element & volel = VolumeElement(el);
@ -1664,7 +1702,8 @@ namespace netgen
if ( nodesinpart[i] > nodesinpart[partition] ) if ( nodesinpart[i] > nodesinpart[partition] )
partition = i; partition = i;
volel.SetPartition(partition); // volel.SetPartition(partition);
vol_partition[el-1] = partition;
} }
delete [] xadj; delete [] xadj;
@ -1766,13 +1805,14 @@ namespace netgen
Array<int> nodesinpart(ntasks); Array<int> nodesinpart(ntasks);
vol_partition.SetSize(ne);
for ( int el = 1; el <= ne; el++ ) for ( int el = 1; el <= ne; el++ )
{ {
// Element & volel = VolumeElement(el); // Element & volel = VolumeElement(el);
nodesinpart = 0; nodesinpart = 0;
VolumeElement(el).SetPartition(part[el-1 ] + 1); // VolumeElement(el).SetPartition(part[el-1 ] + 1);
vol_partition[el-1] = part[el-1 ] + 1;
} }
/* /*
@ -1879,8 +1919,10 @@ namespace netgen
#endif #endif
surf_partition.SetSize(ne);
for (SurfaceElementIndex sei = 0; sei < ne; sei++) for (SurfaceElementIndex sei = 0; sei < ne; sei++)
(*this) [sei].SetPartition (part[sei]+1); // (*this) [sei].SetPartition (part[sei]+1);
surf_partition[sei] = part[sei]+1;
#else #else
cout << "partdualmesh not available" << endl; cout << "partdualmesh not available" << endl;
#endif #endif

View File

@ -141,7 +141,8 @@ namespace netgen
topology.GetElementEdges (el, edges); topology.GetElementEdges (el, edges);
const Element & volel = mesh.VolumeElement (el); const Element & volel = mesh.VolumeElement (el);
Array<int> & sendarray = *sendarrays[volel.GetPartition()]; // Array<int> & sendarray = *sendarrays[volel.GetPartition()];
Array<int> & sendarray = *sendarrays[mesh.vol_partition[el-1]];
for ( int i = 0; i < edges.Size(); i++ ) for ( int i = 0; i < edges.Size(); i++ )
sendarray.Append (edges[i]); sendarray.Append (edges[i]);
@ -153,7 +154,8 @@ namespace netgen
{ {
topology.GetSurfaceElementEdges (el, edges); topology.GetSurfaceElementEdges (el, edges);
const Element2d & surfel = mesh.SurfaceElement (el); const Element2d & surfel = mesh.SurfaceElement (el);
Array<int> & sendarray = *sendarrays[surfel.GetPartition()]; // Array<int> & sendarray = *sendarrays[surfel.GetPartition()];
Array<int> & sendarray = *sendarrays[mesh.surf_partition[el-1]];
for ( int i = 0; i < edges.Size(); i++ ) for ( int i = 0; i < edges.Size(); i++ )
sendarray.Append (edges[i]); sendarray.Append (edges[i]);

View File

@ -1618,12 +1618,15 @@ namespace netgen
{ {
const Segment & seg = mesh->LineSegment(i); const Segment & seg = mesh->LineSegment(i);
/*
#ifdef PARALLEL #ifdef PARALLEL
if (ntasks > 1 && if (ntasks > 1 &&
vispar.drawtetsdomain && vispar.drawtetsdomain &&
(vispar.drawtetsdomain != seg.GetPartition())) continue; // (vispar.drawtetsdomain != seg.GetPartition())) continue;
(vispar.drawtetsdomain != mesh->seg_partition[i-1]) continue;
#endif #endif
*/
const Point3d & p1 = (*mesh)[seg[0]]; const Point3d & p1 = (*mesh)[seg[0]];
const Point3d & p2 = (*mesh)[seg[1]]; const Point3d & p2 = (*mesh)[seg[1]];
@ -1865,9 +1868,11 @@ namespace netgen
{ {
if (vispar.drawtetsdomain > 0) if (vispar.drawtetsdomain > 0)
{ {
/*
int tetid = vispar.drawmetispartition ? int tetid = vispar.drawmetispartition ?
(*mesh)[ei].GetPartition() : (*mesh)[ei].GetIndex(); (*mesh)[ei].GetPartition() : (*mesh)[ei].GetIndex();
*/
int tetid = (*mesh)[ei].GetIndex();
if (vispar.drawtetsdomain != tetid) continue; if (vispar.drawtetsdomain != tetid) continue;
} }
@ -1884,8 +1889,8 @@ namespace netgen
int ind = el.GetIndex() % 4; int ind = el.GetIndex() % 4;
if (vispar.drawmetispartition && el.GetPartition()!=-1) // if (vispar.drawmetispartition && el.GetPartition()!=-1)
ind = el.GetPartition() % 4; // ind = el.GetPartition() % 4;
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, tetcols[ind]); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, tetcols[ind]);

View File

@ -2264,8 +2264,9 @@ namespace netgen
mesh->ParallelMetis(); mesh->ParallelMetis();
cout << "done" << endl; cout << "done" << endl;
ntasks = 1; ntasks = 1;
for (ElementIndex ei = 0; ei < mesh->GetNE(); ei++)
(*mesh)[ei].SetIndex ( (*mesh)[ei].GetPartition() ); // for (ElementIndex ei = 0; ei < mesh->GetNE(); ei++)
// (*mesh)[ei].SetIndex ( (*mesh)[ei].GetPartition() );
return TCL_OK; return TCL_OK;