Public Member Functions | Private Types | Private Member Functions | Private Attributes
meshSurfaceOptimizer Class Reference
Collaboration diagram for meshSurfaceOptimizer:
Collaboration graph
[legend]

Public Member Functions

 meshSurfaceOptimizer (const meshSurfaceEngine &)
 Construct from mesh surface. More...
 
 meshSurfaceOptimizer (const meshSurfacePartitioner &)
 Construct from partitioner. More...
 
 meshSurfaceOptimizer (const meshSurfaceEngine &, const meshOctree &)
 Construct from mesh surface and octree. More...
 
 meshSurfaceOptimizer (const meshSurfacePartitioner &, const meshOctree &)
 Construct from partitioner and octree. More...
 
 ~meshSurfaceOptimizer ()
 
template<class labelListType >
void lockBoundaryFaces (const labelListType &)
 lock the boundary faces which shall not be modified More...
 
template<class labelListType >
void lockBoundaryPoints (const labelListType &)
 lock boundary points. They are not be moved. More...
 
void lockFeatureEdges ()
 lock edge points More...
 
void removeUserConstraints ()
 reset to default constraints More...
 
void enforceConstraints (const word subsetName="badPoints")
 
bool untangleSurface (const labelLongList &activeBoundaryPoints, const label nAdditionalLayers=0)
 runs a surface smoother on the selected boundary points More...
 
bool untangleSurface (const label nAdditionalLayers=2)
 
void optimizeSurface (const label nIterations=5)
 optimize boundary nodes after boundary regions are created More...
 
void optimizeSurface2D (const label nIterations=5)
 optimize the surface of a 2D mesh More...
 
void untangleSurface2D ()
 untangle the surface of a 2D mesh More...
 

Private Types

enum  vertexTypes {
  PARTITION = 1, EDGE = 2, CORNER = 4, PROCBND = 8,
  LOCKED = 16
}
 

Private Member Functions

void classifySurfaceVertices ()
 classify surface vertices as PARTITION, EDGE, CORNER More...
 
void calculateTrianglesAndAddressing () const
 calculate surface triangulation More...
 
const partTriMeshtriMesh () const
 
void updateTriMesh (const labelLongList &)
 
void updateTriMesh ()
 
label findInvertedVertices (boolList &smoothVertex, const label nAdditionalLayers=2) const
 
bool transformIntoPlane (const label bpI, const plane &pl, vector &vecX, vector &vecY, DynList< point > &pts, DynList< triFace > &trias) const
 transform into a 2D space in plane More...
 
point newPositionLaplacian (const label bpI, const bool transformIntoPlane=true) const
 
point newPositionLaplacianFC (const label bpI, const bool transformIntoPlane=true) const
 
point newPositionLaplacianWFC (const label bpI, const bool transformIntoPlane=true) const
 
point newPositionSurfaceOptimizer (const label bpI, const scalar tol=0.001) const
 new position of a node after using surfaceOptimizer More...
 
point newEdgePositionLaplacian (const label bpI) const
 
void nodeDisplacementLaplacian (const label bpI, const bool transformIntoPlane=true) const
 
void nodeDisplacementLaplacianFC (const label bpI, const bool transformIntoPlane=true) const
 
void nodeDisplacementSurfaceOptimizer (const label bpI, const scalar tol=1.0)
 smooth the node using surface optimizer More...
 
void edgeNodeDisplacement (const label bpI) const
 smooth edge node More...
 
void smoothEdgePoints (const labelLongList &edgePoints, const labelLongList &procEdgePoints)
 smooth selected edge points More...
 
void smoothLaplacianFC (const labelLongList &selectedPoints, const labelLongList &selectedProcPoints, const bool transform=true)
 smooth selected points using laplaceFC More...
 
void smoothSurfaceOptimizer (const labelLongList &selectedPoints, const labelLongList &selectedProcPoints)
 smooth selected points using surface optimizer More...
 
void exchangeData (const labelLongList &nodesToSmooth, std::map< label, DynList< parTriFace > > &m) const
 transfer data between processors More...
 
void nodeDisplacementLaplacianParallel (const labelLongList &nodesToSmooth, const bool transformIntoPlane=true)
 
void nodeDisplacementLaplacianFCParallel (const labelLongList &nodesToSmooth, const bool transformIntoPlane=true)
 laplacian smoothing of points at processor boundaries More...
 
void edgeNodeDisplacementParallel (const labelLongList &nodesToSmooth)
 smooth edge nodes at processor boundaries More...
 
 meshSurfaceOptimizer (const meshSurfaceOptimizer &)
 Disallow default bitwise copy construct. More...
 
void operator= (const meshSurfaceOptimizer &)
 Disallow default bitwise assignment. More...
 

Private Attributes

const meshSurfaceEnginesurfaceEngine_
 const reference to the mesh surface More...
 
List< directionvertexType_
 type of surface vertex More...
 
labelLongList lockedSurfaceFaces_
 locked faces which shall not be changed More...
 
const meshSurfacePartitionerpartitionerPtr_
 surface partitioner More...
 
const bool deletePartitioner_
 
const meshOctreeoctreePtr_
 pointer to mesh octree More...
 
partTriMeshtriMeshPtr_
 mesh of surface triangles needed for some smoothers More...
 
bool enforceConstraints_
 enforce constraints More...
 
word badPointsSubsetName_
 name of the subset contaning tangled points More...
 

Detailed Description

Definition at line 63 of file meshSurfaceOptimizer.H.

Member Enumeration Documentation

◆ vertexTypes

enum vertexTypes
private
Enumerator
PARTITION 
EDGE 
CORNER 
PROCBND 
LOCKED 

Definition at line 242 of file meshSurfaceOptimizer.H.

Constructor & Destructor Documentation

◆ meshSurfaceOptimizer() [1/5]

Disallow default bitwise copy construct.

◆ meshSurfaceOptimizer() [2/5]

Construct from mesh surface.

Definition at line 77 of file meshSurfaceOptimizer.C.

References meshSurfaceOptimizer::classifySurfaceVertices().

Here is the call graph for this function:

◆ meshSurfaceOptimizer() [3/5]

Construct from partitioner.

Definition at line 91 of file meshSurfaceOptimizer.C.

References meshSurfaceOptimizer::classifySurfaceVertices().

Here is the call graph for this function:

◆ meshSurfaceOptimizer() [4/5]

meshSurfaceOptimizer ( const meshSurfaceEngine surface,
const meshOctree octree 
)

Construct from mesh surface and octree.

Definition at line 106 of file meshSurfaceOptimizer.C.

◆ meshSurfaceOptimizer() [5/5]

meshSurfaceOptimizer ( const meshSurfacePartitioner partitioner,
const meshOctree octree 
)

Construct from partitioner and octree.

Definition at line 124 of file meshSurfaceOptimizer.C.

◆ ~meshSurfaceOptimizer()

Member Function Documentation

◆ classifySurfaceVertices()

void classifySurfaceVertices ( )
private

classify surface vertices as PARTITION, EDGE, CORNER

set all vertices to partition

set corners

set edges

mark nodes at parallel boundaries

Definition at line 44 of file meshSurfaceOptimizer.C.

References meshSurfaceOptimizer::CORNER, meshSurfacePartitioner::corners(), meshSurfaceOptimizer::EDGE, meshSurfacePartitioner::edgePoints(), forAllConstIter(), meshSurfaceEngine::globalToLocalBndPointAddressing(), UPstream::parRun(), meshSurfaceOptimizer::PARTITION, meshSurfaceOptimizer::partitionerPtr_, meshSurfaceOptimizer::PROCBND, meshSurfaceOptimizer::surfaceEngine_, and meshSurfaceOptimizer::vertexType_.

Referenced by meshSurfaceOptimizer::meshSurfaceOptimizer().

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

◆ calculateTrianglesAndAddressing()

void calculateTrianglesAndAddressing ( ) const
private

◆ triMesh()

const partTriMesh & triMesh ( ) const
inlineprivate

Definition at line 51 of file meshSurfaceOptimizerI.H.

References meshSurfaceOptimizer::calculateTrianglesAndAddressing(), and meshSurfaceOptimizer::triMeshPtr_.

Here is the call graph for this function:

◆ updateTriMesh() [1/2]

void updateTriMesh ( const labelLongList selPoints)
inlineprivate

Definition at line 59 of file meshSurfaceOptimizerI.H.

References Foam::abort(), Foam::FatalError, FatalErrorIn, meshSurfaceOptimizer::triMeshPtr_, and partTriMesh::updateVertices().

Here is the call graph for this function:

◆ updateTriMesh() [2/2]

void updateTriMesh ( )
inlineprivate

Definition at line 71 of file meshSurfaceOptimizerI.H.

References Foam::abort(), Foam::FatalError, FatalErrorIn, meshSurfaceOptimizer::triMeshPtr_, and partTriMesh::updateVertices().

Here is the call graph for this function:

◆ findInvertedVertices()

label findInvertedVertices ( boolList smoothVertex,
const label  nAdditionalLayers = 2 
) const
private

find vertices which are inverted mark additional layers of vertices near the inverted ones

check the vertices at the surface mark the ones where the mesh is tangled

add additional layers around inverted points

exchange global labels of inverted points

exchange data with other processors

Definition at line 60 of file meshSurfaceOptimizerOptimizeSurface.C.

References Foam::endl(), Foam::help::exchangeMap(), forAll, forAllConstIter(), forAllRow, HashTable::found(), Foam::Info, meshSurfaceCheckInvertedVertices::invertedVertices(), UPstream::myProcNo(), UPstream::parRun(), Foam::reduce(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ transformIntoPlane()

bool transformIntoPlane ( const label  bpI,
const plane pl,
vector vecX,
vector vecY,
DynList< point > &  pts,
DynList< triFace > &  trias 
) const
inlineprivate

◆ newPositionLaplacian()

point newPositionLaplacian ( const label  bpI,
const bool  transformIntoPlane = true 
) const
inlineprivate

new position of a node after laplacian smoothing the position is the average of neighbouring vertex positions

Definition at line 187 of file meshSurfaceOptimizerI.H.

References forAll, forAllRow, Foam::magSqr(), plane::nearestPoint(), points, DynList< T, staticSize >::setSize(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ newPositionLaplacianFC()

point newPositionLaplacianFC ( const label  bpI,
const bool  transformIntoPlane = true 
) const
inlineprivate

new position of a node after laplacian smoothing the position is the average of neighbouring face centres

Definition at line 232 of file meshSurfaceOptimizerI.H.

References forAll, forAllRow, Foam::magSqr(), plane::nearestPoint(), points, DynList< T, staticSize >::setSize(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ newPositionLaplacianWFC()

point newPositionLaplacianWFC ( const label  bpI,
const bool  transformIntoPlane = true 
) const
inlineprivate

new position of a node after laplacian smoothing the position is the weighted average of neighbouring face centres the weights are the magnitudes of neighbouring face area vectors

Definition at line 279 of file meshSurfaceOptimizerI.H.

References forAll, forAllRow, Foam::magSqr(), Foam::max(), plane::nearestPoint(), points, DynList< T, staticSize >::setSize(), VRWGraph::sizeOfRow(), w(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ newPositionSurfaceOptimizer()

point newPositionSurfaceOptimizer ( const label  bpI,
const scalar  tol = 0.001 
) const
inlineprivate

new position of a node after using surfaceOptimizer

project vertices onto the plane

Definition at line 339 of file meshSurfaceOptimizerI.H.

References Foam::endl(), Foam::help::isinf(), Foam::help::isnan(), Foam::magSqr(), surfaceOptimizer::optimizePoint(), points, Foam::Pout, success, WarningIn, Vector< Cmpt >::x(), and Vector< Cmpt >::y().

Here is the call graph for this function:

◆ newEdgePositionLaplacian()

point newEdgePositionLaplacian ( const label  bpI) const
inlineprivate

new position of edge vertex the position is the average of neighbouring edge vertices

Definition at line 398 of file meshSurfaceOptimizerI.H.

References DynList< T, staticSize >::append(), Foam::endl(), forAll, forAllRow, HashTable::found(), Foam::Info, points, Foam::pos(), DynList< T, staticSize >::size(), and Vector< scalar >::zero.

Referenced by meshSurfaceOptimizer::edgeNodeDisplacement().

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

◆ nodeDisplacementLaplacian()

void nodeDisplacementLaplacian ( const label  bpI,
const bool  transformIntoPlane = true 
) const
private

smooth the node using the laplacian smoother new position is the average of the neighbouring vertices

Definition at line 46 of file meshSurfaceOptimizerOptimizePoint.C.

References meshSurfaceEngineModifier::moveBoundaryVertex().

Here is the call graph for this function:

◆ nodeDisplacementLaplacianFC()

void nodeDisplacementLaplacianFC ( const label  bpI,
const bool  transformIntoPlane = true 
) const
private

smooth the node using the laplacian smoother new position is the average of the centres of faces attached to the vertex

Definition at line 61 of file meshSurfaceOptimizerOptimizePoint.C.

References meshSurfaceEngineModifier::moveBoundaryVertex().

Here is the call graph for this function:

◆ nodeDisplacementSurfaceOptimizer()

void nodeDisplacementSurfaceOptimizer ( const label  bpI,
const scalar  tol = 1.0 
)
private

smooth the node using surface optimizer

project vertices onto the plane

Definition at line 76 of file meshSurfaceOptimizerOptimizePoint.C.

References Foam::endl(), Foam::Info, Foam::magSqr(), meshSurfaceEngineModifier::moveBoundaryVertex(), surfaceOptimizer::optimizePoint(), points, Foam::Warning, Vector< Cmpt >::x(), and Vector< Cmpt >::y().

Here is the call graph for this function:

◆ edgeNodeDisplacement()

void edgeNodeDisplacement ( const label  bpI) const
private

◆ smoothEdgePoints()

void smoothEdgePoints ( const labelLongList edgePoints,
const labelLongList procEdgePoints 
)
private

◆ smoothLaplacianFC()

void smoothLaplacianFC ( const labelLongList selectedPoints,
const labelLongList selectedProcPoints,
const bool  transform = true 
)
private

smooth selected points using laplaceFC

Definition at line 215 of file meshSurfaceOptimizerOptimizeSurface.C.

References LongList< T, Offset >::append(), coordinates(), forAll, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::parRun(), List::setSize(), Foam::transform(), and meshSurfaceEngineModifier::updateGeometry().

Referenced by meshSurfaceOptimizer::optimizeSurface().

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

◆ smoothSurfaceOptimizer()

void smoothSurfaceOptimizer ( const labelLongList selectedPoints,
const labelLongList selectedProcPoints 
)
private

smooth selected points using surface optimizer

create partTriMesh is it is not yet present

update coordinates of the triangulation

ensure that vertices at inter-processor boundaries are at the same location at all processors

update geometry addressing for moved points

Definition at line 283 of file meshSurfaceOptimizerOptimizeSurface.C.

References forAll, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), LongList< T, Offset >::size(), meshSurfaceEngineModifier::syncVerticesAtParallelBoundaries(), and meshSurfaceEngineModifier::updateGeometry().

Referenced by meshSurfaceOptimizer::optimizeSurface(), meshSurfaceOptimizer::optimizeSurface2D(), and meshSurfaceOptimizer::untangleSurface2D().

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

◆ exchangeData()

void exchangeData ( const labelLongList nodesToSmooth,
std::map< label, DynList< parTriFace > > &  m 
) const
private

transfer data between processors

Definition at line 427 of file meshSurfaceOptimizerOptimizePointParallel.C.

Referenced by meshSurfaceOptimizer::lockBoundaryFaces(), meshSurfaceOptimizer::lockBoundaryPoints(), and meshSurfaceOptimizer::untangleSurface2D().

Here is the caller graph for this function:

◆ nodeDisplacementLaplacianParallel()

void nodeDisplacementLaplacianParallel ( const labelLongList nodesToSmooth,
const bool  transformIntoPlane = true 
)
private

laplacian smoothing of points at processor boundaries new position is the average of the neighbouring vertices

create storage for data

exchange data with other processors

perform smoothing

project points onto the plane

add data to the list which will be sent to other processor

exchange data with other processors

create new point position

Definition at line 47 of file meshSurfaceOptimizerOptimizePointParallel.C.

References LongList< T, Offset >::append(), VRWGraph::contains(), labelledPoint::coordinates(), Foam::help::exchangeMap(), forAll, forAllRow, refLabelledPoint::lPoint(), Foam::magSqr(), meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::myProcNo(), plane::nearestPoint(), UPstream::nProcs(), refLabelledPoint::objectLabel(), p, pMin(), labelledPoint::pointLabel(), points, Foam::returnReduce(), LongList< T, Offset >::size(), VRWGraph::sizeOfRow(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ nodeDisplacementLaplacianFCParallel()

void nodeDisplacementLaplacianFCParallel ( const labelLongList nodesToSmooth,
const bool  transformIntoPlane = true 
)
private

laplacian smoothing of points at processor boundaries

create storage for data

exchange data with other processors

perform smoothing

project points onto the plane

add data to the list which will be sent to other processor

exchange data with other processors

create new point position

Definition at line 167 of file meshSurfaceOptimizerOptimizePointParallel.C.

References LongList< T, Offset >::append(), labelledPoint::coordinates(), Foam::help::exchangeMap(), forAll, forAllRow, refLabelledPoint::lPoint(), Foam::magSqr(), meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::myProcNo(), plane::nearestPoint(), refLabelledPoint::objectLabel(), p, pFaces, labelledPoint::pointLabel(), points, Foam::returnReduce(), LongList< T, Offset >::size(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ edgeNodeDisplacementParallel()

void edgeNodeDisplacementParallel ( const labelLongList nodesToSmooth)
private

smooth edge nodes at processor boundaries

insert labels into the map

add local edge points

start preparing data which can be exchanged with other processors

exchange data with other processors

Finally, the data is ready to start smoothing

Definition at line 289 of file meshSurfaceOptimizerOptimizePointParallel.C.

References LongList< T, Offset >::append(), DynList< T, staticSize >::append(), DynList< T, staticSize >::appendIfNotIn(), Foam::e, Foam::help::exchangeMap(), forAll, forAllRow, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::myProcNo(), refLabelledPoint::objectLabel(), points, LongList< T, Offset >::size(), DynList< T, staticSize >::size(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ operator=()

void operator= ( const meshSurfaceOptimizer )
private

Disallow default bitwise assignment.

◆ lockBoundaryFaces()

void lockBoundaryFaces ( const labelListType &  l)
inline

◆ lockBoundaryPoints()

void lockBoundaryPoints ( const labelListType &  l)
inline

◆ lockFeatureEdges()

void lockFeatureEdges ( )
inline

lock edge points

Definition at line 557 of file meshSurfaceOptimizerI.H.

References meshSurfaceOptimizer::CORNER, meshSurfaceOptimizer::EDGE, forAll, meshSurfaceOptimizer::LOCKED, and meshSurfaceOptimizer::vertexType_.

Referenced by boundaryLayerOptimisation::optimiseLayer().

Here is the caller graph for this function:

◆ removeUserConstraints()

void removeUserConstraints ( )

reset to default constraints

Definition at line 153 of file meshSurfaceOptimizer.C.

References forAll, meshSurfaceOptimizer::LOCKED, and meshSurfaceOptimizer::vertexType_.

◆ enforceConstraints()

void enforceConstraints ( const word  subsetName = "badPoints")

Flag stopping the meshing process if it is not possible to untangle the surface without sacrificing geometry constraints Points which must be moved away from the required position are stored into a point subset

Definition at line 163 of file meshSurfaceOptimizer.C.

References meshSurfaceOptimizer::badPointsSubsetName_, and meshSurfaceOptimizer::enforceConstraints_.

Referenced by voronoiMeshGenerator::optimiseFinalMesh(), and cartesianMeshGenerator::optimiseFinalMesh().

Here is the caller graph for this function:

◆ untangleSurface() [1/2]

bool untangleSurface ( const labelLongList activeBoundaryPoints,
const label  nAdditionalLayers = 0 
)

runs a surface smoother on the selected boundary points

find the min number of inverted points and add the last number to the stack

count the number of iteration after the last minimum occurence

update the stack

check if the number of inverted points reduces

stop if the procedure does not minimise the number of inverted points

find points which will be handled by the smoothers

smooth edge vertices

use laplacian smoothing

use surface optimizer

update normals and other geometric data

use the combination with the minimum number of inverted points

update normals and other geometric data

the procedure has given up without success there exist some remaining inverted faces in the mesh

Definition at line 327 of file meshSurfaceOptimizerOptimizeSurface.C.

References LongList< T, Offset >::append(), LongList< T, Offset >::clear(), Foam::deleteDemandDrivenData(), Foam::endl(), forAll, forAllConstIter(), Foam::Info, meshSurfaceMapper::mapEdgeNodes(), meshSurfaceMapper::mapVerticesOntoSurface(), mesh, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::parRun(), points, FIFOStack< T >::pop(), FIFOStack< T >::push(), Foam::returnReduce(), List::size(), meshSurfaceEngineModifier::updateGeometry(), and WarningIn.

Referenced by edgeExtractor::checkFacePatchesGeometry(), cartesianMeshGenerator::mapMeshToSurface(), tetMeshGenerator::mapMeshToSurface(), voronoiMeshGenerator::mapMeshToSurface(), voronoiMeshGenerator::optimiseMeshSurface(), meshSurfaceOptimizer::optimizeSurface(), meshSurfaceMapper::preMapVertices(), meshSurfaceOptimizer::untangleSurface(), and edgeExtractor::untangleSurface().

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

◆ untangleSurface() [2/2]

bool untangleSurface ( const label  nAdditionalLayers = 2)

checks for invertex surface elements and tries to untangle them it tries to keep the points on the surface for a couple of iteration and gives up the final iterations by default, it smooths two additional layers of elements around the inverted ones

Definition at line 572 of file meshSurfaceOptimizerOptimizeSurface.C.

References meshSurfaceEngine::boundaryPoints(), forAll, List::size(), meshSurfaceOptimizer::surfaceEngine_, and meshSurfaceOptimizer::untangleSurface().

Here is the call graph for this function:

◆ optimizeSurface()

void optimizeSurface ( const label  nIterations = 5)

optimize boundary nodes after boundary regions are created

needed for parallel execution

optimize edge vertices

project vertices back onto the boundary

update the geometry information

delete the mapper

optimize positions of surface vertices which are not on surface edges

Definition at line 581 of file meshSurfaceOptimizerOptimizeSurface.C.

References LongList< T, Offset >::append(), meshSurfaceEngine::boundaryFacePatches(), meshSurfaceEngine::boundaryPointEdges(), meshSurfaceEngine::boundaryPoints(), Foam::deleteDemandDrivenData(), meshSurfaceOptimizer::EDGE, Foam::endl(), meshSurfaceEngine::faceCentres(), Foam::flush(), forAll, Foam::Info, meshSurfaceOptimizer::LOCKED, meshSurfaceMapper::mapEdgeNodes(), meshSurfaceOptimizer::octreePtr_, meshSurfaceOptimizer::PARTITION, meshSurfaceOptimizer::partitionerPtr_, meshSurfaceEngine::pointFaces(), meshSurfaceEngine::pointNormals(), meshSurfaceEngine::pointPoints(), meshSurfaceOptimizer::PROCBND, meshSurfaceOptimizer::smoothEdgePoints(), meshSurfaceOptimizer::smoothLaplacianFC(), meshSurfaceOptimizer::smoothSurfaceOptimizer(), meshSurfaceOptimizer::surfaceEngine_, meshSurfaceOptimizer::untangleSurface(), meshSurfaceEngineModifier::updateGeometry(), and meshSurfaceOptimizer::vertexType_.

Referenced by voronoiMeshGenerator::optimiseFinalMesh(), cartesianMeshGenerator::optimiseFinalMesh(), boundaryLayerOptimisation::optimiseLayer(), cartesianMeshGenerator::optimiseMeshSurface(), tetMeshGenerator::optimiseMeshSurface(), voronoiMeshGenerator::optimiseMeshSurface(), and meshSurfaceEdgeExtractorFUN::smoothMeshSurface().

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

◆ optimizeSurface2D()

void optimizeSurface2D ( const label  nIterations = 5)

optimize the surface of a 2D mesh

needed for parallel execution

optimize edge vertices

move points with maximum z coordinate

map boundary edges to the surface

update normal, centres, etc, after the surface has been modified

optimize Pts of surface vertices which are not on surface edges

move the points which are not at minimum z coordinate

update geometrical data due to movement of vertices

Definition at line 658 of file meshSurfaceOptimizerOptimizeSurface.C.

References LongList< T, Offset >::append(), meshSurfaceEngine::boundaryFacePatches(), meshSurfaceEngine::boundaryPointEdges(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), LongList< T, Offset >::clear(), polyMeshGen2DEngine::correctPoints(), Foam::deleteDemandDrivenData(), Foam::e, meshSurfaceOptimizer::EDGE, meshSurfaceEngine::edges(), Foam::endl(), meshSurfaceEngine::faceCentres(), Foam::flush(), forAll, Foam::Info, meshSurfaceMapper2D::mapVerticesOntoSurfacePatches(), meshSurfaceEngine::mesh(), meshSurfaceOptimizer::octreePtr_, meshSurfaceOptimizer::PARTITION, meshSurfaceEngine::pointFaces(), meshSurfaceEngine::pointNormals(), meshSurfaceEngine::pointPoints(), meshSurfaceOptimizer::PROCBND, meshSurfaceOptimizer::smoothEdgePoints(), meshSurfaceOptimizer::smoothSurfaceOptimizer(), meshSurfaceOptimizer::surfaceEngine_, meshSurfaceEngineModifier::updateGeometry(), meshSurfaceOptimizer::vertexType_, and polyMeshGen2DEngine::zMinPoints().

Referenced by cartesian2DMeshGenerator::optimiseMeshSurface().

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

◆ untangleSurface2D()

void untangleSurface2D ( )

untangle the surface of a 2D mesh

needed for parallel execution

update active points and faces affected by the movement of active points

collect active points at inter-processor boundaries

exchange active points among the processors

ensure that all processors have the same Pts active

activate this boundary point

set the changeFaces for the faces attached to this point

apply smoothing to the activated points

move the points which are not at minimum z coordinate

update geometrical data due to movement of vertices

update cell centres and face centres

delete invalid data

Definition at line 759 of file meshSurfaceOptimizerOptimizeSurface.C.

References polyMeshGen2DEngine::activeFace(), LongList< T, Offset >::append(), meshSurfaceEngine::boundaryFacePatches(), meshSurfaceEngine::boundaryPointEdges(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), meshSurfaceEngine::bpAtProcs(), meshSurfaceEngine::bpNeiProcs(), polyMeshGen2DEngine::correctPoints(), meshSurfaceOptimizer::EDGE, Foam::endl(), meshSurfaceOptimizer::exchangeData(), Foam::help::exchangeMap(), f(), meshSurfaceEngine::faceCentres(), Foam::polyMeshGenChecks::findBadFaces(), forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalToLocalBndPointAddressing(), Foam::Info, mesh, meshSurfaceEngine::mesh(), UPstream::myProcNo(), UPstream::parRun(), meshSurfaceOptimizer::PARTITION, meshSurfaceEngine::pointFaces(), meshSurfaceEngine::pointNormals(), meshSurfaceEngine::pointPoints(), meshSurfaceOptimizer::PROCBND, List::size(), meshSurfaceOptimizer::smoothEdgePoints(), meshSurfaceOptimizer::smoothSurfaceOptimizer(), meshSurfaceOptimizer::surfaceEngine_, meshSurfaceEngineModifier::updateGeometry(), meshSurfaceOptimizer::vertexType_, and polyMeshGen2DEngine::zMinPoints().

Referenced by cartesian2DMeshGenerator::optimiseMeshSurface(), and cartesian2DMeshGenerator::refBoundaryLayers().

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

Field Documentation

◆ surfaceEngine_

const meshSurfaceEngine& surfaceEngine_
private

◆ vertexType_

List<direction> vertexType_
private

◆ lockedSurfaceFaces_

labelLongList lockedSurfaceFaces_
private

locked faces which shall not be changed

Definition at line 73 of file meshSurfaceOptimizer.H.

Referenced by meshSurfaceOptimizer::lockBoundaryFaces().

◆ partitionerPtr_

const meshSurfacePartitioner* partitionerPtr_
private

◆ deletePartitioner_

const bool deletePartitioner_
private

Definition at line 77 of file meshSurfaceOptimizer.H.

Referenced by meshSurfaceOptimizer::~meshSurfaceOptimizer().

◆ octreePtr_

const meshOctree* octreePtr_
private

pointer to mesh octree

Definition at line 80 of file meshSurfaceOptimizer.H.

Referenced by meshSurfaceOptimizer::optimizeSurface(), and meshSurfaceOptimizer::optimizeSurface2D().

◆ triMeshPtr_

partTriMesh* triMeshPtr_
mutableprivate

◆ enforceConstraints_

bool enforceConstraints_
private

enforce constraints

Definition at line 86 of file meshSurfaceOptimizer.H.

Referenced by meshSurfaceOptimizer::enforceConstraints().

◆ badPointsSubsetName_

word badPointsSubsetName_
private

name of the subset contaning tangled points

Definition at line 89 of file meshSurfaceOptimizer.H.

Referenced by meshSurfaceOptimizer::enforceConstraints().


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