CV2D Class Reference

Conformal-Voronoi 2D automatic mesher with grid or read initial points and point position relaxation with optional "squarification". More...

Inheritance diagram for CV2D:
Collaboration diagram for CV2D:

Public Types

typedef const point2Dpoint2DFromPoint
 
typedef const Point & PointFromPoint2D
 

Public Member Functions

 ClassName ("CV2D")
 Runtime type information. More...
 
 CV2D (const Time &runTime, const dictionary &controlDict)
 Construct for given surface. More...
 
 CV2D (const CV2D &)=delete
 Disallow default bitwise copy construction. More...
 
 ~CV2D ()
 Destructor. More...
 
const cv2DControlsmeshControls () const
 
const point2DtoPoint2D (const point &) const
 
const point2DField toPoint2D (const pointField &) const
 
point toPoint3D (const point2D &) const
 
point2DFromPoint toPoint2D (const Point &) const
 
PointFromPoint2D toPoint (const point2D &) const
 
point toPoint3D (const Point &) const
 
void insertPoints (const point2DField &points, const scalar nearness)
 Create the initial mesh from the given internal points. More...
 
void insertPoints (const fileName &pointFileName)
 Create the initial mesh from the internal points in the given. More...
 
void insertGrid ()
 Create the initial mesh as a regular grid of points. More...
 
void insertSurfacePointPairs ()
 Insert all surface point-pairs from. More...
 
void boundaryConform ()
 Insert point-pairs where there are protrusions into. More...
 
void removeSurfacePointPairs ()
 Remove the point-pairs introduced by insertSurfacePointPairs. More...
 
void movePoint (const Vertex_handle &vh, const Point &P)
 
void newPoints ()
 Move the internal points to the given new locations and update. More...
 
void extractPatches (wordList &patchNames, labelList &patchSizes, EdgeMap< label > &mapEdgesRegion, EdgeMap< label > &indirectPatchEdge) const
 Extract patch names and sizes. More...
 
void writePoints (const fileName &fName, bool internalOnly) const
 Write internal points to .obj file. More...
 
void writeTriangles (const fileName &fName, bool internalOnly) const
 Write triangles as .obj file. More...
 
void writeFaces (const fileName &fName, bool internalOnly) const
 Write dual faces as .obj file. More...
 
void calcDual (point2DField &dualPoints, faceList &dualFaces, wordList &patchNames, labelList &patchSizes, EdgeMap< label > &mapEdgesRegion, EdgeMap< label > &indirectPatchEdge) const
 Calculates dual points (circumcentres of tets) and faces. More...
 
void writePatch (const fileName &fName) const
 Write patch. More...
 
void write () const
 
void operator= (const CV2D &)=delete
 Disallow default bitwise assignment. More...
 

Detailed Description

Conformal-Voronoi 2D automatic mesher with grid or read initial points and point position relaxation with optional "squarification".

There are a substantial number of options to this mesher read from CV2DMesherDict file e.g.:

Min cell size used in tolerances when inserting points for boundary conforming. Also used as the grid spacing in insertGrid. minCellSize 0.05;

Feature angle used to inser feature points 0 = all features, 180 = no features featureAngle 45;

Maximum quadrant angle allowed at a concave corner before additional "mitering" lines are added maxQuadAngle 110;

Should the mesh be square-dominated or of unbiased hexagons squares yes;

Near-wall region where cells are aligned with the wall specified as a number of cell layers nearWallAlignedDist 3;

Chose if the cell orientation should relax during the iterations or remain fixed to the x-y directions relaxOrientation no;

Insert near-boundary point mirror or point-pairs insertSurfaceNearestPointPairs yes;

Mirror near-boundary points rather than insert point-pairs mirrorPoints no;

Insert point-pairs vor dual-cell vertices very near the surface insertSurfaceNearPointPairs yes;

Choose if to randomise the initial grid created by insertGrid. randomiseInitialGrid yes;

Perturbation fraction, 1 = cell-size. randomPerturbation 0.1;

Number of relaxation iterations. nIterations 5;

Relaxation factor at the start of the iteration sequence. 0.5 is a sensible maximum and < 0.2 converges better. relaxationFactorStart 0.8;

Relaxation factor at the end of the iteration sequence. Should be <= relaxationFactorStart relaxationFactorEnd 0;

writeInitialTriangulation no; writeFeatureTriangulation no; writeNearestTriangulation no; writeInsertedPointPairs no; writeFinalTriangulation yes;

Maximum number of iterations used in boundaryConform. maxBoundaryConformingIter 5;

minEdgeLenCoeff 0.5; maxNotchLenCoeff 0.3; minNearPointDistCoeff 0.25; ppDistCoeff 0.05;

Source files

Definition at line 144 of file CV2D.H.

Member Typedef Documentation

◆ point2DFromPoint

typedef const point2D& point2DFromPoint

Definition at line 349 of file CV2D.H.

◆ PointFromPoint2D

typedef const Point& PointFromPoint2D

Definition at line 350 of file CV2D.H.

Constructor & Destructor Documentation

◆ CV2D() [1/2]

CV2D ( const Time runTime,
const dictionary controlDict 
)

Construct for given surface.

◆ CV2D() [2/2]

CV2D ( const CV2D )
delete

Disallow default bitwise copy construction.

◆ ~CV2D()

~CV2D ( )

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "CV2D"  )

Runtime type information.

◆ meshControls()

const Foam::cv2DControls & meshControls ( ) const
inline

Definition at line 118 of file CV2DI.H.

◆ toPoint2D() [1/3]

const Foam::point2D & toPoint2D ( const point p) const
inline

Definition at line 124 of file CV2DI.H.

References p.

Referenced by CV2D::toPoint3D().

Here is the caller graph for this function:

◆ toPoint2D() [2/3]

const Foam::point2DField toPoint2D ( const pointField p) const
inline

Definition at line 130 of file CV2DI.H.

References forAll, List< T >::size(), x, and y.

Here is the call graph for this function:

◆ toPoint3D() [1/2]

Foam::point toPoint3D ( const point2D p) const
inline

Definition at line 141 of file CV2DI.H.

References p, CV2D::toPoint(), CV2D::toPoint2D(), Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().

Here is the call graph for this function:

◆ toPoint2D() [3/3]

Foam::CV2D::point2DFromPoint toPoint2D ( const Point &  P) const
inline

Definition at line 162 of file CV2DI.H.

◆ toPoint()

Foam::CV2D::PointFromPoint2D toPoint ( const point2D p) const
inline

Definition at line 168 of file CV2DI.H.

References Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().

Referenced by CV2D::toPoint3D().

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

◆ toPoint3D() [2/2]

Foam::point toPoint3D ( const Point &  P) const
inline

Definition at line 176 of file CV2DI.H.

◆ insertPoints() [1/2]

void insertPoints ( const point2DField points,
const scalar  nearness 
)

Create the initial mesh from the given internal points.

Points must be inside the boundary by at least nearness otherwise they are ignored.

◆ insertPoints() [2/2]

void insertPoints ( const fileName pointFileName)

Create the initial mesh from the internal points in the given.

file. Points outside the geometry are ignored.

◆ insertGrid()

void insertGrid ( )

Create the initial mesh as a regular grid of points.

Points outside the geometry are ignored.

◆ insertSurfacePointPairs()

void insertSurfacePointPairs ( )

Insert all surface point-pairs from.

insertSurfaceNearestPointPairs and findIntersectionForOutsideCentroid

◆ boundaryConform()

void boundaryConform ( )

Insert point-pairs where there are protrusions into.

or out of the surface

◆ removeSurfacePointPairs()

void removeSurfacePointPairs ( )

Remove the point-pairs introduced by insertSurfacePointPairs.

and boundaryConform

◆ movePoint()

void movePoint ( const Vertex_handle &  vh,
const Point &  P 
)
inline

Definition at line 182 of file CV2DI.H.

References Foam::vtkWriteOps::insert().

Here is the call graph for this function:

◆ newPoints()

void newPoints ( )

Move the internal points to the given new locations and update.

the triangulation to ensure it is Delaunay void moveInternalPoints(const point2DField& newPoints);Calculate the displacements to create the new points

◆ extractPatches()

void extractPatches ( wordList patchNames,
labelList patchSizes,
EdgeMap< label > &  mapEdgesRegion,
EdgeMap< label > &  indirectPatchEdge 
) const

Extract patch names and sizes.

◆ writePoints()

void writePoints ( const fileName fName,
bool  internalOnly 
) const

Write internal points to .obj file.

◆ writeTriangles()

void writeTriangles ( const fileName fName,
bool  internalOnly 
) const

Write triangles as .obj file.

◆ writeFaces()

void writeFaces ( const fileName fName,
bool  internalOnly 
) const

Write dual faces as .obj file.

◆ calcDual()

void calcDual ( point2DField dualPoints,
faceList dualFaces,
wordList patchNames,
labelList patchSizes,
EdgeMap< label > &  mapEdgesRegion,
EdgeMap< label > &  indirectPatchEdge 
) const

Calculates dual points (circumcentres of tets) and faces.

(point-cell walk of tets). Returns:

  • dualPoints (in triangle ordering)
  • dualFaces (compacted)

◆ writePatch()

void writePatch ( const fileName fName) const

Write patch.

◆ write()

void write ( ) const

◆ operator=()

void operator= ( const CV2D )
delete

Disallow default bitwise assignment.


The documentation for this class was generated from the following files: