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 | |
partTetMesh & | tetMesh_ |
reference to the tet mesh More... | |
Definition at line 58 of file tetMeshOptimisation.H.
tetMeshOptimisation | ( | partTetMesh & | mesh | ) |
Construct from tet mesh.
Definition at line 55 of file tetMeshOptimisation.C.
~tetMeshOptimisation | ( | ) |
Definition at line 62 of file tetMeshOptimisation.C.
|
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().
|
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().
|
private |
update buffer layer points
create the map
add points into the map
Definition at line 209 of file tetMeshOptimisationParallel.C.
References partTetMesh::bufferLayerPoints(), labelledPoint::coordinates(), tetMeshOptimisation::exchangeData(), Foam::help::exchangeMap(), forAll, forAllRow, partTetMesh::globalPointLabel(), partTetMesh::globalToLocalPointAddressing(), UPstream::myProcNo(), partTetMesh::neiProcs(), partTetMesh::pointAtProcs(), labelledPoint::pointLabel(), points, partTetMesh::points(), tetMeshOptimisation::tetMesh_, and partTetMesh::updateVertex().
Referenced by tetMeshOptimisation::optimiseUsingKnuppMetric(), tetMeshOptimisation::optimiseUsingMeshUntangler(), and tetMeshOptimisation::optimiseUsingVolumeOptimizer().
|
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().
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().
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().
void optimiseUsingVolumeOptimizer | ( | const label | nIterations = 10 | ) |
smooth using volume optimizer
use mesh optimizer to improve the result
update mesh vertices
Definition at line 337 of file tetMeshOptimisation.C.
References LongList< T, Offset >::append(), partTetMeshSimplex::centrePoint(), List::clear(), Foam::e, forAll, partTetMesh::LOCKED, volumeOptimizer::optimizeNodePosition(), UPstream::parRun(), List::setSize(), partTetMesh::SMOOTH, partTetMesh::smoothVertex(), tetMeshOptimisation::tetMesh_, tetMeshOptimisation::unifyCoordinatesParallel(), tetMeshOptimisation::updateBufferLayerPoints(), and partTetMesh::updateVerticesSMP().
Referenced by meshOptimizer::optimizeLowQualityFaces(), meshOptimizer::optimizeMeshFVBestQuality(), meshOptimizer::optimizeMeshNearBoundaries(), and meshOptimizer::untangleMeshFV().
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().
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().
|
private |
reference to the tet mesh
Definition at line 62 of file tetMeshOptimisation.H.
Referenced by tetMeshOptimisation::optimiseUsingKnuppMetric(), tetMeshOptimisation::optimiseUsingMeshUntangler(), tetMeshOptimisation::optimiseUsingVolumeOptimizer(), tetMeshOptimisation::unifyNegativePoints(), and tetMeshOptimisation::updateBufferLayerPoints().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.