Skip to content
Snippets Groups Projects
Commit d6ec3072 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

small modif for high order optimization

parent f0636df7
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,12 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data)
int nbLayers = (int) o->value[2]->value();
double threshold_max = o->value[8]->value();
int NE = 0;
for (GModel::riter it = GModel::current()->firstRegion(); it != GModel::current()->lastRegion(); ++it){
NE += (*it)->getNumMeshElements();
}
#if defined(HAVE_OPTHOM)
switch(algo) {
case 0: { // Optimization
......@@ -140,7 +146,9 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data)
p.BARRIER_MIN = threshold_min;
p.BARRIER_MAX = threshold_max;
p.onlyVisible = onlyVisible;
p.dim = GModel::current()->getDim();
// change dim if no 3D elements are there
p.dim = GModel::current()->getDim() == 3 ? ( NE ? 3 : 2 ) : GModel::current()->getDim();
printf("%d %d\n",NE,p.dim);
p.itMax = (int) o->value[3]->value();
p.optPassMax = (int) o->value[4]->value();
p.weightFixed = o->value[5]->value();
......@@ -164,7 +172,7 @@ static void highordertools_runopti_cb(Fl_Widget *w, void *data)
p.BARRIER_MIN = threshold_min;
p.BARRIER_MAX = threshold_max;
p.onlyVisible = onlyVisible;
p.dim = GModel::current()->getDim();
p.dim = GModel::current()->getDim() == 3 ? ( NE ? 3 : 2 ) : GModel::current()->getDim();
p.distanceFactor = o->value[7]->value();
HighOrderMeshFastCurving(GModel::current(), p);
break;
......
......@@ -234,7 +234,10 @@ void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris,
if(pp < 0) t->reverse();
}
}
computeEquivalences(gf, data);
}
void computeEquivalences(GFace *gf, bidimMeshData & data){
if (data.equivalence){
std::vector<MTriangle*> newT;
for (unsigned int i=0;i<gf->triangles.size();i++){
......@@ -252,10 +255,13 @@ void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris,
}
gf->triangles = newT;
}
}
int splitEquivalentTriangles(GFace *gf, bidimMeshData & data){
}
void buildVertexToTriangle(std::vector<MTriangle*> &eles, v2t_cont &adj)
{
adj.clear();
......
......@@ -80,6 +80,7 @@ void buildMeshGenerationDataStructures(GFace *gf,
std::set<MTri3*, compareTri3Ptr> &AllTris,
bidimMeshData & data);
void transferDataStructure(GFace *gf, std::set<MTri3*, compareTri3Ptr> &AllTris,bidimMeshData &DATA);
void computeEquivalences(GFace *gf,bidimMeshData &DATA);
void recombineIntoQuads(GFace *gf,
bool topologicalOpti = true,
bool nodeRepositioning = true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment