gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
meshGFaceOptimize.cpp File Reference
#include <stack>
#include "GmshConfig.h"
#include "meshGFaceOptimize.h"
#include "qualityMeasures.h"
#include "GFace.h"
#include "GEdge.h"
#include "GVertex.h"
#include "GModel.h"
#include "MVertex.h"
#include "MTriangle.h"
#include "MQuadrangle.h"
#include "MLine.h"
#include "BackgroundMeshTools.h"
#include "Numeric.h"
#include "GmshMessage.h"
#include "Context.h"
#include "OS.h"
#include "SVector3.h"
#include "SPoint3.h"
#include "meshRelocateVertex.h"
#include "Field.h"
Include dependency graph for meshGFaceOptimize.cpp:

Go to the source code of this file.

Classes

struct  equivalentTriangle
 
struct  p1p2p3
 

Functions

static void setLcsInit (MTriangle *t, std::map< MVertex *, double > &vSizes)
 
static void setLcs (MTriangle *t, std::map< MVertex *, double > &vSizes, bidimMeshData &data)
 
bool buildMeshGenerationDataStructures (GFace *gf, std::set< MTri3 *, compareTri3Ptr > &AllTris, bidimMeshData &data)
 
void computeEquivalences (GFace *gf, bidimMeshData &data)
 
bool computeEquivalentTriangles (GFace *gf, std::map< MVertex *, MVertex * > *equivalence)
 
void splitEquivalentTriangles (GFace *gf, bidimMeshData &data)
 
void transferDataStructure (GFace *gf, std::set< MTri3 *, compareTri3Ptr > &AllTris, bidimMeshData &data)
 
template<class T >
void buildEdgeToElement (std::vector< T * > &elements, e2t_cont &adj)
 
void buildEdgeToElement (GFace *gf, e2t_cont &adj)
 
void buildEdgeToTriangle (std::vector< MTriangle * > &tris, e2t_cont &adj)
 
void buildEdgeToElements (std::vector< MElement * > &tris, e2t_cont &adj)
 
void buildListOfEdgeAngle (e2t_cont adj, std::vector< edge_angle > &edges_detected, std::vector< edge_angle > &edges_lonly)
 
static void parametricCoordinates (MElement *t, GFace *gf, double u[4], double v[4], MVertex *close=nullptr)
 
double surfaceFaceUV (MElement *t, GFace *gf, bool maximal=true)
 
static int _removeTwoQuadsNodes (GFace *gf)
 
int removeTwoQuadsNodes (GFace *gf)
 
static bool _tryToCollapseThatVertex2 (GFace *gf, std::vector< MElement * > &e1, std::vector< MElement * > &e2, MElement *q, MVertex *v1, MVertex *v2)
 
static bool _tryToCollapseThatVertex (GFace *gf, std::vector< MElement * > &e1, std::vector< MElement * > &e2, MElement *q, MVertex *v1, MVertex *v2)
 
static bool _isItAGoodIdeaToMoveThatVertex (GFace *gf, const std::vector< MElement * > &e1, MVertex *v1, const SPoint2 &before, const SPoint2 &after)
 
static bool has_none_of (std::set< MVertex * > const &touched, MVertex *const v1, MVertex *const v2, MVertex *const v3, MVertex *const v4)
 
static bool are_all_on_surface (MVertex *const v1, MVertex *const v2, MVertex *const v3, MVertex *const v4, GFace *gf)
 
template<class InputIterator >
bool are_size_three (InputIterator iterator1, InputIterator iterator2)
 
static int _removeDiamonds (GFace *const gf)
 
int removeDiamonds (GFace *gf)
 
static void _relocate (GFace *gf, MVertex *ver, const std::vector< MElement * > &lt)
 
void getAllBoundaryLayerVertices (GFace *gf, std::set< MVertex * > &vs)
 
void laplaceSmoothing (GFace *gf, int niter, bool infinity_norm)
 
static void _recombineIntoQuads (GFace *gf, bool blossom, bool cubicGraph=1)
 
static double printStats (GFace *gf, const char *message)
 
static bool _isModelOkForTopologicalOpti (GModel *m)
 
void recombineIntoQuads (GFace *gf, bool blossom, int topologicalOptiPasses, bool nodeRepositioning, double minqual)
 
void quadsToTriangles (GFace *gf, double minqual)
 
void splitElementsInBoundaryLayerIfNeeded (GFace *gf)
 

Function Documentation

◆ _isItAGoodIdeaToMoveThatVertex()

static bool _isItAGoodIdeaToMoveThatVertex ( GFace gf,
const std::vector< MElement * > &  e1,
MVertex v1,
const SPoint2 before,
const SPoint2 after 
)
static

Definition at line 736 of file meshGFaceOptimize.cpp.

Referenced by _relocate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _isModelOkForTopologicalOpti()

static bool _isModelOkForTopologicalOpti ( GModel m)
static

Definition at line 1295 of file meshGFaceOptimize.cpp.

Referenced by recombineIntoQuads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _recombineIntoQuads()

static void _recombineIntoQuads ( GFace gf,
bool  blossom,
bool  cubicGraph = 1 
)
static

Definition at line 1009 of file meshGFaceOptimize.cpp.

Referenced by recombineIntoQuads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _relocate()

static void _relocate ( GFace gf,
MVertex ver,
const std::vector< MElement * > &  lt 
)
static

Definition at line 900 of file meshGFaceOptimize.cpp.

Referenced by laplaceSmoothing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _removeDiamonds()

static int _removeDiamonds ( GFace *const  gf)
static

Definition at line 795 of file meshGFaceOptimize.cpp.

Referenced by removeDiamonds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _removeTwoQuadsNodes()

static int _removeTwoQuadsNodes ( GFace gf)
static

Definition at line 513 of file meshGFaceOptimize.cpp.

Referenced by removeTwoQuadsNodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tryToCollapseThatVertex()

static bool _tryToCollapseThatVertex ( GFace gf,
std::vector< MElement * > &  e1,
std::vector< MElement * > &  e2,
MElement q,
MVertex v1,
MVertex v2 
)
static

Definition at line 662 of file meshGFaceOptimize.cpp.

Referenced by _removeDiamonds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tryToCollapseThatVertex2()

static bool _tryToCollapseThatVertex2 ( GFace gf,
std::vector< MElement * > &  e1,
std::vector< MElement * > &  e2,
MElement q,
MVertex v1,
MVertex v2 
)
static

Definition at line 601 of file meshGFaceOptimize.cpp.

Referenced by _tryToCollapseThatVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ are_all_on_surface()

static bool are_all_on_surface ( MVertex *const  v1,
MVertex *const  v2,
MVertex *const  v3,
MVertex *const  v4,
GFace gf 
)
static

Definition at line 782 of file meshGFaceOptimize.cpp.

Referenced by _removeDiamonds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ are_size_three()

template<class InputIterator >
bool are_size_three ( InputIterator  iterator1,
InputIterator  iterator2 
)

Definition at line 790 of file meshGFaceOptimize.cpp.

Referenced by _removeDiamonds().

Here is the caller graph for this function:

◆ buildEdgeToElement() [1/2]

void buildEdgeToElement ( GFace gf,
e2t_cont adj 
)

Definition at line 436 of file meshGFaceOptimize.cpp.

Here is the call graph for this function:

◆ buildEdgeToElement() [2/2]

template<class T >
void buildEdgeToElement ( std::vector< T * > &  elements,
e2t_cont adj 
)

Definition at line 417 of file meshGFaceOptimize.cpp.

Referenced by _recombineIntoQuads(), buildEdgeToElement(), buildEdgeToElements(), and buildEdgeToTriangle().

Here is the caller graph for this function:

◆ buildEdgeToElements()

void buildEdgeToElements ( std::vector< MElement * > &  tris,
e2t_cont adj 
)

Definition at line 449 of file meshGFaceOptimize.cpp.

Referenced by classifyFaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildEdgeToTriangle()

void buildEdgeToTriangle ( std::vector< MTriangle * > &  tris,
e2t_cont adj 
)

Definition at line 443 of file meshGFaceOptimize.cpp.

Here is the call graph for this function:

◆ buildListOfEdgeAngle()

void buildListOfEdgeAngle ( e2t_cont  adj,
std::vector< edge_angle > &  edges_detected,
std::vector< edge_angle > &  edges_lonly 
)

Definition at line 455 of file meshGFaceOptimize.cpp.

Referenced by classifyFaces().

Here is the caller graph for this function:

◆ buildMeshGenerationDataStructures()

bool buildMeshGenerationDataStructures ( GFace gf,
std::set< MTri3 *, compareTri3Ptr > &  AllTris,
bidimMeshData data 
)

Definition at line 174 of file meshGFaceOptimize.cpp.

Referenced by bowyerWatson(), bowyerWatsonFrontal(), bowyerWatsonFrontalLayers(), bowyerWatsonParallelograms(), and bowyerWatsonParallelogramsConstrained().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeEquivalences()

void computeEquivalences ( GFace gf,
bidimMeshData data 
)

Definition at line 271 of file meshGFaceOptimize.cpp.

Referenced by transferDataStructure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeEquivalentTriangles()

bool computeEquivalentTriangles ( GFace gf,
std::map< MVertex *, MVertex * > *  equivalence 
)

Definition at line 317 of file meshGFaceOptimize.cpp.

Referenced by splitEquivalentTriangles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllBoundaryLayerVertices()

void getAllBoundaryLayerVertices ( GFace gf,
std::set< MVertex * > &  vs 
)

Definition at line 967 of file meshGFaceOptimize.cpp.

Referenced by laplaceSmoothing(), and RelocateVertices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_none_of()

static bool has_none_of ( std::set< MVertex * > const &  touched,
MVertex *const  v1,
MVertex *const  v2,
MVertex *const  v3,
MVertex *const  v4 
)
static

Definition at line 774 of file meshGFaceOptimize.cpp.

Referenced by _removeDiamonds().

Here is the caller graph for this function:

◆ laplaceSmoothing()

void laplaceSmoothing ( GFace gf,
int  niter,
bool  infinity_norm 
)

Definition at line 978 of file meshGFaceOptimize.cpp.

Referenced by GModel::adaptMesh(), meshGenerator(), meshGeneratorPeriodic(), and OptimizeMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parametricCoordinates()

static void parametricCoordinates ( MElement t,
GFace gf,
double  u[4],
double  v[4],
MVertex close = nullptr 
)
static

Definition at line 472 of file meshGFaceOptimize.cpp.

Referenced by bowyerWatson(), bowyerWatsonFrontal(), bowyerWatsonFrontalLayers(), bowyerWatsonParallelograms(), bowyerWatsonParallelogramsConstrained(), buildBackgroundMesh(), meshGeneratorPeriodic(), and surfaceFaceUV().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printStats()

static double printStats ( GFace gf,
const char *  message 
)
static

Definition at line 1269 of file meshGFaceOptimize.cpp.

Referenced by recombineIntoQuads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quadsToTriangles()

void quadsToTriangles ( GFace gf,
double  minqual 
)

Definition at line 1374 of file meshGFaceOptimize.cpp.

Referenced by buildBackgroundMesh(), Mesh3D(), recombineIntoQuads(), and splitElementsInBoundaryLayerIfNeeded().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recombineIntoQuads()

void recombineIntoQuads ( GFace gf,
bool  blossom,
int  topologicalOptiPasses,
bool  nodeRepositioning,
double  minqual 
)

Definition at line 1311 of file meshGFaceOptimize.cpp.

Referenced by quadMeshRemoveHalfOfOneDMesh::finish(), meshGenerator(), meshGeneratorPeriodic(), and RecombineMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeDiamonds()

int removeDiamonds ( GFace gf)

Definition at line 884 of file meshGFaceOptimize.cpp.

Referenced by recombineIntoQuads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeTwoQuadsNodes()

int removeTwoQuadsNodes ( GFace gf)

Definition at line 589 of file meshGFaceOptimize.cpp.

Referenced by recombineIntoQuads().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLcs()

static void setLcs ( MTriangle t,
std::map< MVertex *, double > &  vSizes,
bidimMeshData data 
)
static

Definition at line 153 of file meshGFaceOptimize.cpp.

Referenced by buildMeshGenerationDataStructures().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLcsInit()

static void setLcsInit ( MTriangle t,
std::map< MVertex *, double > &  vSizes 
)
static

Definition at line 141 of file meshGFaceOptimize.cpp.

Referenced by buildMeshGenerationDataStructures().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitElementsInBoundaryLayerIfNeeded()

void splitElementsInBoundaryLayerIfNeeded ( GFace gf)

Definition at line 1457 of file meshGFaceOptimize.cpp.

Referenced by bowyerWatson(), bowyerWatsonFrontal(), bowyerWatsonFrontalLayers(), bowyerWatsonParallelograms(), bowyerWatsonParallelogramsConstrained(), and meshGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitEquivalentTriangles()

void splitEquivalentTriangles ( GFace gf,
bidimMeshData data 
)

Definition at line 343 of file meshGFaceOptimize.cpp.

Referenced by transferDataStructure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ surfaceFaceUV()

double surfaceFaceUV ( MElement t,
GFace gf,
bool  maximal = true 
)

Definition at line 487 of file meshGFaceOptimize.cpp.

Referenced by _isItAGoodIdeaToMoveThatVertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transferDataStructure()

void transferDataStructure ( GFace gf,
std::set< MTri3 *, compareTri3Ptr > &  AllTris,
bidimMeshData data 
)

Definition at line 348 of file meshGFaceOptimize.cpp.

Referenced by bowyerWatson(), bowyerWatsonFrontal(), bowyerWatsonFrontalLayers(), bowyerWatsonParallelograms(), and bowyerWatsonParallelogramsConstrained().

Here is the call graph for this function:
Here is the caller graph for this function: