Skip to content

Commit

Permalink
Rewrite node relocation in FixPeriodicMesh to simply map the master n…
Browse files Browse the repository at this point in the history
…odes on the slave surfaces, without doing the tricky "averaging" performed in contrib/HighOrderMeshOptimizer.
  • Loading branch information
geuzaine committed Feb 13, 2020
1 parent 8d238d5 commit a8eafab
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 243 deletions.
4 changes: 3 additions & 1 deletion Common/DefaultOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,9 @@ StringXNumber MeshOptions_Number[] = {
{ F|O, "HighOrderPassMax", opt_mesh_ho_pass_max, 25,
"Maximum number of high-order optimization passes (moving barrier)"},
{ F|O, "HighOrderPeriodic" , opt_mesh_ho_periodic , 0.,
"Correct high-order optimization for periodic connections?" },
"Force location of nodes for periodic meshes using periodicity transform (0: "
"assume identical parametrisations, 1: invert parametrisations, 2: compute "
"closest point" },
{ F|O, "HighOrderPoissonRatio", opt_mesh_ho_poisson, 0.33,
"Poisson ratio of the material used in the elastic smoother for high-order meshes "
"(between -1.0 and 0.5, excluded)"},
Expand Down
1 change: 1 addition & 0 deletions Fltk/highOrderToolsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "GModel.h"
#include "MElement.h"
#include "Context.h"
#include "Generator.h"
#include "HighOrder.h"

#if defined(HAVE_OPTHOM)
Expand Down
6 changes: 1 addition & 5 deletions Geo/GEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,9 @@ void GEdge::relocateMeshVertices()
}
}

SPoint3 GEdge::closestPoint(SPoint3 &p, double tolerance)
SPoint3 GEdge::closestPointWithTol(SPoint3 &p, double tolerance)
{
if(!_cp || _cp->tol() != tolerance) {
if(_cp)
printf("coucou %12.15E %22.15E \n", tolerance, _cp->tol());
else
printf("coucou %12.5E \n", tolerance);
if(_cp) delete _cp;
_cp = new closestPointFinder(this, tolerance);
}
Expand Down
4 changes: 2 additions & 2 deletions Geo/GEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GEdge : public GEntity {

// the STL discretization
std::vector<SPoint3> stl_vertices_xyz;

public:
GEdge(GModel *model, int tag, GVertex *_v0, GVertex *_v1);
GEdge(GModel *model, int tag);
Expand Down Expand Up @@ -250,7 +250,7 @@ class GEdge : public GEntity {

virtual void discretize(double tol, std::vector<SPoint3> &dpts,
std::vector<double> &ts);
SPoint3 closestPoint(SPoint3 &p, double tolerance);
SPoint3 closestPointWithTol(SPoint3 &p, double tolerance);
virtual void mesh(bool verbose);

virtual bool reorder(const int elementType, const std::vector<std::size_t> &ordering);
Expand Down
Loading

0 comments on commit a8eafab

Please sign in to comment.