Commit 682c97c3 by Christophe Geuzaine

Merge branch 'Fltk_partition_options' into 'master'

Fltk partition options

See merge request !84
parents 0efdac03 fd4bf71d
Pipeline #1192 passed with stage
in 36 minutes 5 seconds
......@@ -50,6 +50,7 @@ struct PartitionDialog
Fl_Value_Input *inputNumPartition;
Fl_Check_Button *setGhostCells;
Fl_Check_Button *setTopology;
Fl_Check_Button *setPhysical;
// Group 1
Fl_Choice *choiceMetisAlg;
Fl_Toggle_Button *toggleButtonAdvMetis;
......@@ -69,6 +70,7 @@ struct PartitionDialog
CTX::instance()->mesh.numPartitions = static_cast<int>(inputNumPartition->value());
CTX::instance()->mesh.partitionCreateGhostCells = setGhostCells->value();
CTX::instance()->mesh.partitionCreateTopology = setTopology->value();
CTX::instance()->mesh.partitionCreatePhysicals = setPhysical->value();
// Group 1
CTX::instance()->mesh.metisAlgorithm = choiceMetisAlg->value() + 1;
......@@ -91,6 +93,7 @@ struct PartitionDialog
inputNumPartition->value(CTX::instance()->mesh.numPartitions);
setGhostCells->value(CTX::instance()->mesh.partitionCreateGhostCells);
setTopology->value(CTX::instance()->mesh.partitionCreateTopology);
setPhysical->value(CTX::instance()->mesh.partitionCreatePhysicals);
// Group 2
choiceMetisAlg->value(CTX::instance()->mesh.metisAlgorithm - 1);
......@@ -243,7 +246,7 @@ void partition_dialog()
// Main options group [0]
{
const int GH = 2*BH + 2 + 4*WB;
const int GH = 3*BH + 2 + 5*WB;
y += WB;
Fl_Group *g = new Fl_Group(0, y, w, GH);
// Partitioner
......@@ -273,7 +276,6 @@ void partition_dialog()
{
Fl_Check_Button *const o = new Fl_Check_Button
(2*WB + 2*BB, y, 2*BB, BH, "Create ghost cells");
o->deactivate();
dlg.setGhostCells = o;
}
{
......@@ -282,6 +284,12 @@ void partition_dialog()
dlg.setTopology = o;
}
y += BH + WB;
{
Fl_Check_Button *const o = new Fl_Check_Button
(WB, y, 2*BB, BH, "Create physicals partitions");
dlg.setPhysical = o;
}
y += BH + WB;
// Box (line)
{ Fl_Box* o = new Fl_Box(WB, y, w - 2*WB, 2);
o->box(FL_ENGRAVED_FRAME);
......
......@@ -30,7 +30,8 @@ class discreteFace : public GFace {
void updateTopology(std::vector<triangulation*>&);
void split(triangulation*,std::vector<triangulation*>&,int);
void fillHoles(triangulation*);
void addTriangle(triangulation*,MTriangle*);
virtual void addTriangle(triangulation*,MTriangle*);
using GFace::addTriangle;
void complex_crossField();
void crossField();
using GFace::point;
......
......@@ -37,10 +37,6 @@ class ghostEdge : public discreteEdge {
bool haveMesh() const { return _haveMesh; }
void haveMesh(bool haveMesh) { _haveMesh = haveMesh; }
virtual std::map<MElement*, unsigned int> &getGhostCells() { return _ghostCells; }
// To make the hidden function visible in ghostEdge
using GEdge::addLine;
using GEdge::addElement;
void addLine(MLine *l, unsigned int onWhichPartition)
{
......@@ -54,6 +50,10 @@ class ghostEdge : public discreteEdge {
_ghostCells.insert(std::pair<MElement*, unsigned int>(e,onWhichPartition));
model()->addGhostCells(e,onWhichPartition);
}
// To make the hidden function visible in ghostEdge
using discreteEdge::addLine;
using discreteEdge::addElement;
};
#endif
......@@ -41,36 +41,36 @@ class ghostFace : public discreteFace {
bool haveMesh() const { return _haveMesh; }
void haveMesh(bool haveMesh) { _haveMesh = haveMesh; }
virtual std::map<MElement*, unsigned int> &getGhostCells() { return _ghostCells; }
// To make the hidden function visible in ghostFace
using GFace::addTriangle;
using GFace::addQuadrangle;
using GFace::addElement;
void addTriangle(MTriangle *t, unsigned int onWhichPartition)
virtual void addTriangle(MTriangle *t, unsigned int onWhichPartition)
{
GFace::addTriangle(t);
_ghostCells.insert(std::pair<MElement*, unsigned int>(t,onWhichPartition));
model()->addGhostCells(t,onWhichPartition);
}
void addQuadrangle(MQuadrangle *q, unsigned int onWhichPartition)
virtual void addQuadrangle(MQuadrangle *q, unsigned int onWhichPartition)
{
GFace::addQuadrangle(q);
_ghostCells.insert(std::pair<MElement*, unsigned int>(q,onWhichPartition));
model()->addGhostCells(q,onWhichPartition);
}
void addPolygon(MPolygon *p, unsigned int onWhichPartition)
virtual void addPolygon(MPolygon *p, unsigned int onWhichPartition)
{
GFace::addPolygon(p);
_ghostCells.insert(std::pair<MElement*, unsigned int>(p,onWhichPartition));
model()->addGhostCells(p,onWhichPartition);
}
void addElement(int type, MElement *e, unsigned int onWhichPartition)
virtual void addElement(int type, MElement *e, unsigned int onWhichPartition)
{
GFace::addElement(type, e);
_ghostCells.insert(std::pair<MElement*, unsigned int>(e,onWhichPartition));
model()->addGhostCells(e,onWhichPartition);
}
// To make the hidden function visible in ghostFace
using discreteFace::addTriangle;
using discreteFace::addQuadrangle;
using discreteFace::addElement;
};
#endif
......@@ -46,15 +46,6 @@ class ghostRegion : public discreteRegion {
void haveMesh(bool haveMesh) { _haveMesh = haveMesh; }
virtual std::map<MElement*, unsigned int> &getGhostCells() { return _ghostCells; }
// To make the hidden function visible in ghostRegion
using GRegion::addTetrahedron;
using GRegion::addHexahedron;
using GRegion::addPrism;
using GRegion::addPyramid;
using GRegion::addPolyhedron;
using GRegion::addTrihedron;
using GRegion::addElement;
void addTetrahedron(MTetrahedron *t, unsigned int onWhichPartition)
{
GRegion::addTetrahedron(t);
......@@ -97,6 +88,15 @@ class ghostRegion : public discreteRegion {
_ghostCells.insert(std::pair<MElement*, unsigned int>(e,onWhichPartition));
model()->addGhostCells(e,onWhichPartition);
}
// To make the hidden function visible in ghostRegion
using discreteRegion::addTetrahedron;
using discreteRegion::addHexahedron;
using discreteRegion::addPrism;
using discreteRegion::addPyramid;
using discreteRegion::addPolyhedron;
using discreteRegion::addTrihedron;
using discreteRegion::addElement;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment