Commit 23e5b3e5 by Christophe Geuzaine

removed unused parts of Lloyd code

parent 027da641
Pipeline #1101 failed with stage
in 91 minutes 59 seconds
......@@ -72,7 +72,6 @@ CTX::CTX() : gamepad(0)
numWindows = numTiles = 1;
deltaFontSize = 0;
recentFiles.resize(10);
mesh.optimizeLloyd = 0;
gamepad = 0;
mesh.switchElementTags = 0;
terminal = 0;
......
......@@ -17,9 +17,10 @@ class GamePad;
struct contextMeshOptions {
// mesh algorithms
int optimize, optimizeNetgen, optimizeLloyd, smoothCrossField, refineSteps;
int optimize, optimizeNetgen, smoothCrossField, refineSteps;
double lcFactor, randFactor, lcIntegrationPrecision;
double optimizeThreshold, normals, tangents, explode, angleSmoothNormals, allowSwapEdgeAngle;
double optimizeThreshold, normals, tangents, explode, angleSmoothNormals;
double allowSwapEdgeAngle;
double qualityInf, qualitySup, radiusInf, radiusSup;
double lcMin, lcMax, toleranceEdgeLength, toleranceInitialDelaunay;
double anisoMax, smoothRatio;
......
......@@ -986,8 +986,6 @@ StringXNumber MeshOptions_Number[] = {
"Field format for Nastran BDF files (0=free, 1=small, 2=large)" },
{ F|O, "Binary" , opt_mesh_binary , 0. ,
"Write mesh files in binary format (if possible)" },
{ F|O, "Lloyd" , opt_mesh_lloyd , 0. ,
"Apply lloyd optimization on surface meshes" },
{ F|O, "SmoothCrossField" , opt_mesh_smooth_cross_field , 0. ,
"Apply n barycentric smoothing passes to the cross field" },
......
......@@ -5799,18 +5799,6 @@ double opt_mesh_binary(OPT_ARGS_NUM)
return CTX::instance()->mesh.binary;
}
double opt_mesh_lloyd(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX::instance()->mesh.optimizeLloyd = (int)val;
#if defined(HAVE_FLTK)
if(FlGui::available() && (action & GMSH_GUI))
FlGui::instance()->options->mesh.value[27]->value
(CTX::instance()->mesh.optimizeLloyd);
#endif
return CTX::instance()->mesh.optimizeLloyd;
}
double opt_mesh_smooth_cross_field(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
......
......@@ -485,7 +485,6 @@ double opt_mesh_partition_tri_weight(OPT_ARGS_NUM);
double opt_mesh_partition_create_topology(OPT_ARGS_NUM);
double opt_mesh_partition_create_ghost_cells(OPT_ARGS_NUM);
double opt_mesh_binary(OPT_ARGS_NUM);
double opt_mesh_lloyd(OPT_ARGS_NUM);
double opt_mesh_smooth_cross_field(OPT_ARGS_NUM);
double opt_mesh_bdf_field_format(OPT_ARGS_NUM);
double opt_mesh_nb_smoothing(OPT_ARGS_NUM);
......
......@@ -508,7 +508,6 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data)
opt_mesh_recombine3d_all(0, GMSH_SET, o->mesh.butt[22]->value());
opt_mesh_nb_smoothing(0, GMSH_SET, o->mesh.value[0]->value());
opt_mesh_lloyd(0, GMSH_SET, o->mesh.value[27]->value());
opt_mesh_lc_factor(0, GMSH_SET, o->mesh.value[2]->value());
opt_mesh_lc_min(0, GMSH_SET, o->mesh.value[25]->value());
opt_mesh_lc_max(0, GMSH_SET, o->mesh.value[26]->value());
......@@ -2397,14 +2396,6 @@ optionWindow::optionWindow(int deltaFontSize)
mesh.butt[22]->type(FL_TOGGLE_BUTTON);
mesh.butt[22]->callback(mesh_options_ok_cb);
mesh.value[27] = new Fl_Value_Input
(L + 2 * WB, 2 * WB + 8 * BH, IW/2, BH, "LLoyd smoothing steps (experimental)");
mesh.value[27]->minimum(0);
mesh.value[27]->maximum(100);
mesh.value[27]->step(1);
mesh.value[27]->align(FL_ALIGN_RIGHT);
mesh.value[27]->callback(mesh_options_ok_cb);
o->end();
}
......
......@@ -1388,8 +1388,6 @@ void GFace::lloyd(int nbiter, int infn)
#if defined(HAVE_MESH) && defined(HAVE_BFGS)
smoothing s = smoothing(nbiter,infn);
s.optimize_face(this);
// lloydAlgorithm algo(nbiter, infn);
// algo(this);
#endif
}
......
......@@ -680,7 +680,7 @@ void DocRecord::printMedialAxis(Octree *_octree, std::string fileName, GFace *gf
GPoint p0(pc[0], pc[1], 0.0);
if (gf) p0 = gf->point(pc[0], pc[1]);
fprintf(f,"SP(%g,%g,%g){%g};\n", p0.x(), p0.y(), p0.z(), (double)i);
voronoiCell (i,pts);
voronoiCell(i, pts);
for (unsigned int j = 0; j < pts.size(); j++){
SVector3 pp1(pts[j].x(), pts[j].y(), 0.0);
SVector3 pp2(pts[(j+1) % pts.size()].x(), pts[(j+1) % pts.size()].y(), 0.0);
......@@ -783,35 +783,6 @@ void centroidOfPolygon(SPoint2 &pc, std::vector<SPoint2> &pts,
yc = x.y();
}
double DocRecord::Lloyd(int type)
{
fullMatrix<double> cgs(numPoints,2);
double inertia_tot = 0.;
for(PointNumero i = 0; i < numPoints; i++) {
PointRecord &pt = points[i];
std::vector<SPoint2> pts;
voronoiCell (i,pts);
double E = 0., A;
if (!points[i].data){
SPoint2 p (pt.where.h,pt.where.v);
if (type == 0)
centroidOfPolygon(p,pts, cgs(i,0), cgs(i,1), E, A);
else
centroidOfOrientedBox(pts, 0.0, cgs(i,0), cgs(i,1), E, A);
}
inertia_tot += E;
}
for(PointNumero i = 0; i < numPoints; i++) {
if (!points[i].data){
points[i].where.h = cgs(i,0);
points[i].where.v = cgs(i,1);
}
}
return inertia_tot;
}
// Convertir les listes d'adjacence en triangles
int DocRecord::ConvertDListToTriangles()
{
......
......@@ -104,8 +104,7 @@ class DocRecord{
int onHull(PointNumero i) { return std::binary_search(_hull, _hull+_hullSize, i); }
void makePosView(std::string, GFace *gf=NULL);
void printMedialAxis(Octree *_octree, std::string, GFace *gf=NULL, GEdge *ge=NULL);
double Lloyd (int);
void voronoiCell (PointNumero pt, std::vector<SPoint2> &pts) const;
void voronoiCell(PointNumero pt, std::vector<SPoint2> &pts) const;
std::set<std::pair<void*,void*> > boundaryEdges;
......
......@@ -28,7 +28,6 @@
#include "BoundaryLayers.h"
#include "HighOrder.h"
#include "Generator.h"
#include "meshGFaceLloyd.h"
#include "Field.h"
#include "Options.h"
#include "simple3D.h"
......@@ -851,7 +850,7 @@ static void Mesh3D(GModel *m)
}
double a = Cpu();
// CTX::instance()->mesh.recombine3DLevel = 2;
// CTX::instance()->mesh.recombine3DLevel = 2;
if (CTX::instance()->mesh.recombine3DLevel >= 0){
Recombinator rec;
......@@ -862,9 +861,9 @@ static void Mesh3D(GModel *m)
sup.execute(gr);
}
PostOp post;
printf("-----------> %d %d\n",CTX::instance()->mesh.recombine3DLevel,CTX::instance()->mesh.recombine3DConformity);
post.execute(gr,CTX::instance()->mesh.recombine3DLevel,CTX::instance()->mesh.recombine3DConformity);
// CTX::instance()->mesh.recombine3DConformity);
post.execute(gr,CTX::instance()->mesh.recombine3DLevel,
CTX::instance()->mesh.recombine3DConformity);
// CTX::instance()->mesh.recombine3DConformity);
// 0: no pyramid, 1: single-step, 2: two-steps (conforming),
// true: fill non-conformities with trihedra
RelocateVertices(gr, CTX::instance()->mesh.nbSmoothing);
......
......@@ -39,7 +39,6 @@
#include "meshPartition.h"
#include "CreateFile.h"
#include "Context.h"
#include "meshGFaceLloyd.h"
#include "boundaryLayersData.h"
#include "filterElements.h"
......@@ -1514,11 +1513,9 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
#endif
if((CTX::instance()->mesh.recombineAll || gf->meshAttributes.recombine) &&
!CTX::instance()->mesh.optimizeLloyd && !onlyInitialMesh && CTX::instance()->mesh.algoRecombine != 2)
!onlyInitialMesh && CTX::instance()->mesh.algoRecombine != 2)
recombineIntoQuads(gf);
computeElementShapes(gf, gf->meshStatistics.worst_element_shape,
gf->meshStatistics.average_element_shape,
gf->meshStatistics.best_element_shape,
......@@ -2305,7 +2302,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true)
delete m;
if((CTX::instance()->mesh.recombineAll || gf->meshAttributes.recombine) &&
!CTX::instance()->mesh.optimizeLloyd && CTX::instance()->mesh.algoRecombine != 2)
CTX::instance()->mesh.algoRecombine != 2)
recombineIntoQuads(gf,true,false);
computeElementShapes(gf, gf->meshStatistics.worst_element_shape,
......
......@@ -5,7 +5,6 @@
#include <iostream>
#include "meshGFaceBamg.h"
#include "meshGFaceLloyd.h"
#include "GmshMessage.h"
#include "GFace.h"
#include "GModel.h"
......
......@@ -3,8 +3,7 @@
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
//
// Contributor(s):
// Tristan Carrier
// Contributed by Tristan Carrier
#ifndef _MESH_GFACE_LLOYD_H_
#define _MESH_GFACE_LLOYD_H_
......
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