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

Public Member Functions

 tetMeshOptimisation (partTetMesh &mesh)
 Construct from tet mesh. More...
 
 ~tetMeshOptimisation ()
 
void optimiseUsingKnuppMetric (const label nInterations=5)
 untangle mesh by using Patrik Knupp's simple metric More...
 
void optimiseUsingMeshUntangler (const label nIerations=5)
 smooth using mesh untangler More...
 
void optimiseUsingVolumeOptimizer (const label nIterations=10)
 smooth using volume optimizer More...
 
void optimiseBoundaryVolumeOptimizer (const label nIterations=3, const bool nonShrinking=false)
 smooth boundary using the volume optimizer More...
 
void optimiseBoundarySurfaceLaplace (const label nIterations=3)
 smooth boundary using shrinking surface laplace More...
 

Private Member Functions

void unifyNegativePoints (boolList &negativeNode) const
 
void exchangeData (std::map< label, DynList< parPartTet > > &m, boolList *negativeNodePtr=NULL)
 exchange data with other processors More...
 
void updateBufferLayerPoints ()
 update buffer layer points More...
 
void unifyCoordinatesParallel (const boolList *negativeNodePtr=NULL)
 

Private Attributes

partTetMeshtetMesh_
 reference to the tet mesh More...
 

Detailed Description

Definition at line 58 of file tetMeshOptimisation.H.

Constructor & Destructor Documentation

◆ tetMeshOptimisation()

Construct from tet mesh.

Definition at line 55 of file tetMeshOptimisation.C.

◆ ~tetMeshOptimisation()

Definition at line 62 of file tetMeshOptimisation.C.

Member Function Documentation

◆ unifyNegativePoints()

void unifyNegativePoints ( boolList negativeNode) const
private

make sure that all processors have the same points marked as negativeNode

make sure that processor nodes are selected on all processors where they exist

Definition at line 43 of file tetMeshOptimisationParallel.C.

References Foam::help::exchangeMap(), forAll, forAllRow, partTetMesh::globalPointLabel(), partTetMesh::globalToLocalPointAddressing(), UPstream::myProcNo(), partTetMesh::neiProcs(), partTetMesh::PARALLELBOUNDARY, partTetMesh::pointAtProcs(), partTetMesh::pointsAtProcessorBoundaries(), partTetMesh::smoothVertex(), and tetMeshOptimisation::tetMesh_.

Referenced by tetMeshOptimisation::optimiseUsingKnuppMetric(), and tetMeshOptimisation::optimiseUsingMeshUntangler().

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

◆ exchangeData()

void exchangeData ( std::map< label, DynList< parPartTet > > &  m,
boolList negativeNodePtr = NULL 
)
private

exchange data with other processors

create the map holding data which will be sent to other procs

create storage in the m map

store local data into the maps

add processor labels

add data into the map of proc bnd points

add data into the map

exchange data with other processors

Definition at line 90 of file tetMeshOptimisationParallel.C.

References DynList< T, staticSize >::append(), DynList< T, staticSize >::appendIfNotIn(), Foam::help::exchangeMap(), forAll, forAllRow, UPstream::myProcNo(), points, DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), and partTetMesh::SMOOTH.

Referenced by tetMeshOptimisation::updateBufferLayerPoints().

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

◆ updateBufferLayerPoints()

void updateBufferLayerPoints ( )
private

◆ unifyCoordinatesParallel()

void unifyCoordinatesParallel ( const boolList negativeNodePtr = NULL)
private

make sure that coordinates of moved points remain the same on all processor containing those points

create the map

fill in the data

send points to other processors

gather the data

move the point to the averaged position

Definition at line 261 of file tetMeshOptimisationParallel.C.

References labelledPoint::coordinates(), Foam::help::exchangeMap(), forAll, forAllRow, UPstream::myProcNo(), partTetMesh::PARALLELBOUNDARY, labelledPoint::pointLabel(), and points.

Referenced by tetMeshOptimisation::optimiseUsingKnuppMetric(), tetMeshOptimisation::optimiseUsingMeshUntangler(), and tetMeshOptimisation::optimiseUsingVolumeOptimizer().

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

◆ optimiseUsingKnuppMetric()

void optimiseUsingKnuppMetric ( const label  nInterations = 5)

untangle mesh by using Patrik Knupp's simple metric

try getting rid of negative volume using the Patrik Knupp's metric which gets non-negative contributions from invertex tets, only

find the number of inverted tets

make sure that the points at procesor boundaries are selected at all processors

smooth the mesh

update mesh vertices

check which tets have been repaired

Definition at line 67 of file tetMeshOptimisation.C.

References LongList< T, Offset >::append(), partTetMeshSimplex::centrePoint(), List::clear(), forAll, partTetMesh::LOCKED, Foam::mag(), knuppMetric::optimizeNodePosition(), UPstream::parRun(), points, partTetMesh::points(), Foam::reduce(), List::setSize(), List::size(), LongList< T, Offset >::size(), partTetMesh::SMOOTH, partTetMesh::smoothVertex(), tetMeshOptimisation::tetMesh_, partTetMesh::tets(), List::transfer(), tetMeshOptimisation::unifyCoordinatesParallel(), tetMeshOptimisation::unifyNegativePoints(), tetMeshOptimisation::updateBufferLayerPoints(), and partTetMesh::updateVerticesSMP().

Referenced by meshOptimizer::untangleMeshFV().

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

◆ optimiseUsingMeshUntangler()

void optimiseUsingMeshUntangler ( const label  nIerations = 5)

smooth using mesh untangler

try getting rid of negative volume using the untangler

find the number of inverted tets

make sure that the points at procesor boundaries are selected at all processors

smooth the mesh

update mesh vertices

check which tets have been repaired

Definition at line 204 of file tetMeshOptimisation.C.

References LongList< T, Offset >::append(), partTetMeshSimplex::centrePoint(), List::clear(), forAll, partTetMesh::LOCKED, Foam::mag(), meshUntangler::optimizeNodePosition(), UPstream::parRun(), points, partTetMesh::points(), Foam::reduce(), List::setSize(), List::size(), LongList< T, Offset >::size(), partTetMesh::SMOOTH, partTetMesh::smoothVertex(), tetMeshOptimisation::tetMesh_, partTetMesh::tets(), List::transfer(), tetMeshOptimisation::unifyCoordinatesParallel(), tetMeshOptimisation::unifyNegativePoints(), tetMeshOptimisation::updateBufferLayerPoints(), and partTetMesh::updateVerticesSMP().

Referenced by meshOptimizer::untangleMeshFV().

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

◆ optimiseUsingVolumeOptimizer()

void optimiseUsingVolumeOptimizer ( const label  nIterations = 10)

◆ optimiseBoundaryVolumeOptimizer()

void optimiseBoundaryVolumeOptimizer ( const label  nIterations = 3,
const bool  nonShrinking = false 
)

smooth boundary using the volume optimizer

find boundary faces of the simplex

create normal tensor of the simplex

make sure the point stays on the surface

ordinary surface vertex

this vertex is on an edge

this vertex is a corner. do not move it

move the vertex without constraining it

update tetMesh

Definition at line 397 of file tetMeshOptimisation.C.

References LongList< T, Offset >::append(), DynList< T, staticSize >::append(), partTetMesh::BOUNDARY, partTetMeshSimplex::centrePoint(), List::clear(), DynList< T, staticSize >::containsAtPosition(), Foam::e, Foam::eigenValues(), Foam::eigenVector(), forAll, partTetMesh::LOCKED, Foam::mag(), n, triangle::normal(), volumeOptimizer::optimizeNodePosition(), UPstream::parRun(), points, Foam::pos(), partTetMeshSimplex::pts(), LongList< T, Offset >::size(), Foam::symm(), partTetMeshSimplex::tets(), and SymmTensor< scalar >::zero.

Referenced by meshOptimizer::untangleMeshFV().

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

◆ optimiseBoundarySurfaceLaplace()

void optimiseBoundarySurfaceLaplace ( const label  nIterations = 3)

smooth boundary using shrinking surface laplace

find boundary faces of the simplex

find boundary edges of the simplex

update tetMesh with new vertex positions

Definition at line 546 of file tetMeshOptimisation.C.

References LongList< T, Offset >::append(), DynList< T, staticSize >::append(), partTetMesh::BOUNDARY, triangle::centre(), partTetMeshSimplex::centrePoint(), List::clear(), DynList< T, staticSize >::containsAtPosition(), Foam::e, forAll, partTetMesh::LOCKED, UPstream::parRun(), Foam::pos(), partTetMeshSimplex::pts(), LongList< T, Offset >::size(), partTetMeshSimplex::tets(), and Vector< scalar >::zero.

Referenced by meshOptimizer::untangleMeshFV().

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

Field Documentation

◆ tetMesh_

partTetMesh& tetMesh_
private

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