Data Structures | |
class | cornerEvaluator |
class | faceEvaluator |
Public Member Functions | |
edgeExtractor (polyMeshGen &mesh, const meshOctree &octree) | |
Construct from mesh surface and octree. More... | |
~edgeExtractor () | |
void | moveVerticesTowardsDiscontinuities (const label nIterations=2) |
bool | checkConcaveEdgeCells () |
bool | checkFacePatchesTopology () |
bool | checkCorners () |
bool | checkFacePatchesGeometry () |
bool | findCornerCandidates () |
void | projectDeterminedFeatureVertices () |
project the estimated corners and edges onto the surface mesh More... | |
bool | untangleSurface () |
check and untangle the surface of the volume mesh More... | |
void | extractEdges () |
assemble the above functionality into a workflow More... | |
const triSurf * | surfaceWithPatches () const |
const triSurf * | surfaceWithPatches (const label bpI) const |
void | updateMeshPatches () |
update mesh with selected patches More... | |
Private Types | |
enum | edgeClassifier_ { NONE = 0, SINGLECELLEDGE = 1, FITSATCONVEXEDGE = 2, FITSATCONCAVEEDGE = 4, ATTACHEDTOCORNER = 8, CANDIDATE = 16 } |
Private Member Functions | |
void | calculateValence () |
calculate point valence More... | |
void | calculateSingleCellEdge () |
calculate the number of boundary faces for each cell More... | |
void | findPatchesNearSurfaceFace () |
void | findFeatureEdgesNearEdge () |
void | markPatchPoints (boolList &) |
const meshSurfaceEngine & | surfaceEngine () const |
get the surface engine More... | |
const triSurfacePartitioner & | partitioner () const |
get the surface partitioner More... | |
const triSurfaceClassifyEdges & | edgeClassifier () const |
get the edge classifier More... | |
void | findFaceCandidates (labelLongList &faceCandidates, const labelList *facePatchPtr=NULL, const Map< label > *otherFacePatchPtr=NULL) const |
void | findOtherFacePatchesParallel (Map< label > &otherFacePatch, const labelList *facePatchPtr=NULL) const |
find patches over edges More... | |
void | findNeiPatches (const label, const Map< label > &, DynList< label > &) const |
find neighbour patches over edges for a boundary face More... | |
scalar | calculateAlignmentForEdge (const label beI, const label patch0, const label patch1) const |
scalar | calculateDeformationMetricForEdge (const label beI, const label patch0, const label patch1) const |
scalar | calculateDeformationMetricForFace (const label bfI, const DynList< label > &neiPatches, const label facePatch=-1) const |
calculates deformation energy metric for a face More... | |
void | distributeBoundaryFaces () |
bool | distributeBoundaryFacesNormalAlignment () |
move faces into the patch with the best alignment More... | |
void | findEdgeCandidates () |
edgeExtractor (const edgeExtractor &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const edgeExtractor &) |
Disallow default bitwise assignment. More... | |
Private Attributes | |
polyMeshGen & | mesh_ |
reference to the mesh More... | |
meshSurfaceEngine * | surfaceEnginePtr_ |
surface engine More... | |
const meshOctree & | meshOctree_ |
reference to the octree More... | |
const triSurfacePartitioner * | surfPartitionerPtr_ |
surface mesh partitioner More... | |
const triSurfaceClassifyEdges * | surfEdgeClassificationPtr_ |
classification of edges in the surface mesh More... | |
labelLongList | pointValence_ |
valence of surface points More... | |
labelLongList | pointPatch_ |
patch to which a boundary point is mapped to More... | |
labelList | facePatch_ |
boundary face patch More... | |
labelLongList | nCellsAtEdge_ |
number of cells attached to a boundary edge More... | |
LongList< direction > | edgeType_ |
edge classification More... | |
VRWGraph | patchesNearFace_ |
patches in the vicinity of a face on the surface of the volume mesh More... | |
VRWGraph | featureEdgesNearEdge_ |
Definition at line 65 of file edgeExtractor.H.
|
private |
Enumerator | |
---|---|
NONE | |
SINGLECELLEDGE | |
FITSATCONVEXEDGE | |
FITSATCONCAVEEDGE | |
ATTACHEDTOCORNER | |
CANDIDATE |
Definition at line 326 of file edgeExtractor.H.
|
private |
Disallow default bitwise copy construct.
edgeExtractor | ( | polyMeshGen & | mesh, |
const meshOctree & | octree | ||
) |
Construct from mesh surface and octree.
Definition at line 655 of file edgeExtractor.C.
~edgeExtractor | ( | ) |
Definition at line 685 of file edgeExtractor.C.
References Foam::deleteDemandDrivenData(), edgeExtractor::surfaceEnginePtr_, edgeExtractor::surfEdgeClassificationPtr_, and edgeExtractor::surfPartitionerPtr_.
|
private |
calculate point valence
Definition at line 62 of file edgeExtractor.C.
References meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), meshSurfaceEngine::bpAtProcs(), meshSurfaceEngine::bpNeiProcs(), Foam::help::exchangeMap(), Pair::first(), forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalToLocalBndPointAddressing(), UPstream::myProcNo(), UPstream::parRun(), edgeExtractor::pointValence_, Pair::second(), LongList< T, Offset >::setSize(), List::size(), and edgeExtractor::surfaceEngine().
|
private |
calculate the number of boundary faces for each cell
find the number of boundary faces for each cell in the mesh
calculate the number of cells attache to a boundary edge
Definition at line 123 of file edgeExtractor.C.
References DynList< T, staticSize >::append(), meshSurfaceEngine::boundaryPointEdges(), meshSurfaceEngine::bp(), Foam::constant::universal::c, Foam::constant::physicoChemical::c1, cells, polyMeshGenCells::cells(), DynList< T, staticSize >::contains(), Foam::e, meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::edges(), edgeExtractor::edgeType_, f(), meshSurfaceEngine::faceOwners(), meshSurfaceEngine::faces(), forAll, forAllRow, meshSurfaceEngine::mesh(), edgeExtractor::nCellsAtEdge_, edgeExtractor::NONE, LongList< T, Offset >::setSize(), edgeExtractor::SINGLECELLEDGE, VRWGraph::size(), VRWGraph::sizeOfRow(), and edgeExtractor::surfaceEngine().
|
private |
search for surface patches in the vicinity of a face at the surface of the volume mesh
get the patches near the current boundary face
copy the data to the graph
Definition at line 197 of file edgeExtractor.C.
References LongList< T, Offset >::append(), DynList< T, staticSize >::appendIfNotIn(), meshSurfaceEngine::boundaryFaces(), Foam::constant::universal::c, face::centre(), meshOctree::findTrianglesInBox(), forAll, Foam::mag(), Foam::max(), edgeExtractor::meshOctree_, edgeExtractor::patchesNearFace_, points, meshSurfaceEngine::points(), VRWGraph::setSize(), VRWGraph::setSizeAndRowSize(), LongList< T, Offset >::size(), DynList< T, staticSize >::size(), UList::size(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
|
private |
search for feature edges in the surface mesh which are in the vicinity of an edge at the surface of the volume mesh
get the edges near the current edge
copy the data to the graph
Definition at line 268 of file edgeExtractor.C.
References LongList< T, Offset >::append(), Foam::constant::universal::c, DynList< T, staticSize >::containsAtPosition(), Foam::e, meshSurfaceEngine::edges(), edgeExtractor::featureEdgesNearEdge_, meshOctree::findEdgesInBox(), forAll, forAllReverse, edgeExtractor::meshOctree_, points, meshSurfaceEngine::points(), Foam::pos(), DynList< T, staticSize >::removeElement(), VRWGraph::setSize(), VRWGraph::setSizeAndRowSize(), List::size(), LongList< T, Offset >::size(), DynList< T, staticSize >::size(), and edgeExtractor::surfaceEngine().
|
private |
calculate a list of booleans with the following properties: true if all faces at a surface vertex are in the same patch false otherwise
create communication matrix
send data as follows: 1. global edge label 2. patch of the attached boundary face
set the patchPoint to false for all vertices at feature edges
an ordinary edge
an edge at a parallel interface
this is a non-manifold edge
make sure that the information is spread to all processors
Definition at line 336 of file edgeExtractor.C.
References LongList< T, Offset >::append(), meshSurfaceEngine::beNeiProcs(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), meshSurfaceEngine::bpAtProcs(), meshSurfaceEngine::bpNeiProcs(), Foam::e, meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::edges(), Foam::help::exchangeMap(), edgeExtractor::facePatch_, forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalBoundaryPointLabel(), meshSurfaceEngine::globalToLocalBndEdgeAddressing(), meshSurfaceEngine::globalToLocalBndPointAddressing(), UPstream::myProcNo(), meshSurfaceEngine::otherEdgeFaceAtProc(), UPstream::parRun(), List::setSize(), List::size(), LongList< T, Offset >::size(), VRWGraph::sizeOfRow(), and edgeExtractor::surfaceEngine().
Referenced by edgeExtractor::checkConcaveEdgeCells().
|
private |
get the surface engine
Definition at line 462 of file edgeExtractor.C.
References edgeExtractor::mesh_, and edgeExtractor::surfaceEnginePtr_.
Referenced by edgeExtractor::faceEvaluator::calculateNeiPatchesParallel(), edgeExtractor::calculateSingleCellEdge(), edgeExtractor::calculateValence(), edgeExtractor::checkConcaveEdgeCells(), edgeExtractor::checkCorners(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), edgeExtractor::findCornerCandidates(), edgeExtractor::findEdgeCandidates(), edgeExtractor::findFeatureEdgesNearEdge(), edgeExtractor::findPatchesNearSurfaceFace(), edgeExtractor::markPatchPoints(), edgeExtractor::moveVerticesTowardsDiscontinuities(), edgeExtractor::projectDeterminedFeatureVertices(), edgeExtractor::surfaceWithPatches(), edgeExtractor::untangleSurface(), and edgeExtractor::updateMeshPatches().
|
private |
get the surface partitioner
Definition at line 480 of file edgeExtractor.C.
References edgeExtractor::meshOctree_, meshOctree::surface(), and edgeExtractor::surfPartitionerPtr_.
Referenced by edgeExtractor::checkCorners(), and edgeExtractor::findEdgeCandidates().
|
private |
get the edge classifier
Definition at line 499 of file edgeExtractor.C.
References edgeExtractor::meshOctree_, and edgeExtractor::surfEdgeClassificationPtr_.
Referenced by edgeExtractor::checkConcaveEdgeCells().
|
private |
find faces which have faces assigned to other patches as their neighbours
this face is probably near some feature edge
Definition at line 511 of file edgeExtractor.C.
References LongList< T, Offset >::append(), DynList< T, staticSize >::appendIfNotIn(), LongList< T, Offset >::clear(), Foam::deleteDemandDrivenData(), meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::faceEdges(), forAll, forAllRow, DynList< T, staticSize >::size(), and VRWGraph::sizeOfRow().
Referenced by edgeExtractor::checkFacePatchesTopology(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), and edgeExtractor::findEdgeCandidates().
|
private |
find patches over edges
create communication matrix
send data as follows: 1. global edge label 2. patch of the attached boundary face
Definition at line 594 of file edgeExtractor.C.
References LongList< T, Offset >::append(), meshSurfaceEngine::beNeiProcs(), meshSurfaceEngine::edgeFaces(), Foam::help::exchangeMap(), forAll, forAllConstIter(), meshSurfaceEngine::globalToLocalBndEdgeAddressing(), meshSurfaceEngine::otherEdgeFaceAtProc(), UPstream::parRun(), LongList< T, Offset >::size(), and VRWGraph::sizeOfRow().
Referenced by edgeExtractor::checkCorners(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), and edgeExtractor::findEdgeCandidates().
|
private |
find neighbour patches over edges for a boundary face
Definition at line 1274 of file edgeExtractor.C.
References meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::faceEdges(), forAllRow, DynList< T, staticSize >::setSize(), and VRWGraph::sizeOfRow().
Referenced by edgeExtractor::checkFacePatchesGeometry().
|
private |
calculate alignment between the boundary edge and a feature edge between the specified patches
Definition at line 1307 of file edgeExtractor.C.
References Foam::e, fv(), Foam::mag(), Foam::max(), Foam::min(), patches, and points.
|
private |
calculates the deformation energy metric for the boundary edge when it would be constrained to a feature edge between the specified patches
Definition at line 1347 of file edgeExtractor.C.
References Foam::acos(), Foam::constant::universal::c, Foam::e, fv(), Foam::mag(), Foam::max(), Foam::min(), patches, points, and Foam::sqrt().
|
private |
calculates deformation energy metric for a face
Definition at line 1388 of file edgeExtractor.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAllRow, DynList< T, staticSize >::size(), and VRWGraph::sizeOfRow().
Referenced by edgeExtractor::checkFacePatchesGeometry().
|
private |
project face centres on the nearest location at the surface mesh and assign the patch to the patch of the surface element
set the size of the facePatch list
check if the mesh already has patches
set size of patchNames, newBoundaryFaces_ and newBoundaryOwners_
find patches to which the surface points are mapped to
find the patch for face by finding the patch nearest to the face centre
find the nearest surface patch to face centre
Definition at line 843 of file edgeExtractor.C.
References polyMeshGenFaces::boundaries(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), Foam::constant::universal::c, face::centre(), Foam::endl(), Foam::exit(), edgeExtractor::facePatch_, Foam::FatalError, FatalErrorIn, meshOctree::findNearestSurfacePoint(), forAll, edgeExtractor::mesh_, edgeExtractor::meshOctree_, nPatches, p, edgeExtractor::pointPatch_, points, meshSurfaceEngine::points(), LongList< T, Offset >::setSize(), List::setSize(), List::size(), UList::size(), meshOctree::surface(), edgeExtractor::surfaceEngine(), and Foam::Warning.
Referenced by edgeExtractor::extractEdges().
|
private |
move faces into the patch with the best alignment
allocate a copy of boundary patches
check whether there exist situations where a boundary face is surrounded by more faces in different patches than the faces in the current patch
find the faces which have neighbouring faces in other patches
go through the list of faces and check if they shall remain in the current patch
do not modify faces with all neighbours in the same patch
check whether there exist edges which are more suitable for projection onto feature edges than the currently selected ones
calculate normal vectors
calculate alignment
transfer the new patches back
Definition at line 929 of file edgeExtractor.C.
References DynList< T, staticSize >::appendIfNotIn(), meshSurfaceEngine::boundaryFaces(), face::centre(), meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::faceEdges(), edgeExtractor::facePatch_, edgeExtractor::findFaceCandidates(), meshOctree::findNearestSurfacePointInRegion(), edgeExtractor::findOtherFacePatchesParallel(), forAll, forAllRow, Foam::mag(), Foam::max(), edgeExtractor::mesh_, edgeExtractor::meshOctree_, face::normal(), p, UPstream::parRun(), points, triSurfPoints::points(), polyMeshGenPoints::points(), Foam::reduce(), DynList< T, staticSize >::setSize(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), Foam::sqrt(), meshOctree::surface(), edgeExtractor::surfaceEngine(), and List::transfer().
Referenced by edgeExtractor::extractEdges().
|
private |
go through the boundary faces which have at least one neighour assigned to a different patch and check which of its edges are best candidates to be used as feature edges
find distances of all vertices supporting CANDIDATE edges from feature edges separating various patches
check the squared distance from the nearest feature edge
create a boundaing box used for searching neighbour edges
find the surface triangles in the vicinity of the point check for potential feature edges
check the distance of the vertex from the candidates
find nearest edges
start post-processing gathered data
find the feature-edge partition for which the sum of node weights is minimal.
store the data
sort the data according to the weights
Definition at line 1082 of file edgeExtractor.C.
References DynList< T, staticSize >::append(), DynList< T, staticSize >::appendIfNotIn(), meshSurfaceEngine::boundaryPointEdges(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), edgeExtractor::CANDIDATE, DynList< T, staticSize >::clear(), Foam::e, triSurfacePartitioner::edgeGroups(), meshSurfaceEngine::edges(), edgeExtractor::edgeType_, Foam::endl(), meshSurfaceEngine::faceEdges(), edgeExtractor::facePatch_, edgeExtractor::findFaceCandidates(), edgeExtractor::findOtherFacePatchesParallel(), meshOctree::findTrianglesInBox(), forAll, forAllRow, Foam::Info, Foam::magSqr(), Foam::max(), edgeExtractor::meshOctree_, Foam::help::nearestPointOnTheEdgeExact(), p, edgeExtractor::partitioner(), points, meshSurfaceEngine::points(), s(), List::setSize(), List::size(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), Foam::sort(), Foam::sqrt(), Foam::stableSort(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
|
private |
Disallow default bitwise assignment.
void moveVerticesTowardsDiscontinuities | ( | const label | nIterations = 2 | ) |
move vertices in the vicinity of discontinuities towards the the surface mesh by reducing the deviation of the mesh from the input geometry
find displacements of face centres
initialise displacements
calculate displacements of boundary points as the average of face centre displacements
update geometry
Definition at line 694 of file edgeExtractor.C.
References meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bpAtProcs(), meshSurfaceEngine::bpNeiProcs(), labelledPoint::coordinates(), Foam::endl(), Foam::help::exchangeMap(), meshOctree::findNearestSurfacePoint(), Foam::flush(), forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalToLocalBndPointAddressing(), Foam::Info, edgeExtractor::meshOctree_, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), Foam::constant::atomic::mp, UPstream::myProcNo(), UPstream::parRun(), meshSurfaceEngine::pointFaces(), labelledPoint::pointLabel(), points, meshSurfaceEngine::points(), List::size(), UList::size(), edgeExtractor::surfaceEngine(), meshSurfaceEngineModifier::updateGeometry(), and Vector< scalar >::zero.
bool checkConcaveEdgeCells | ( | ) |
check if there exist cells at concave feature edges which have more than one face at the boundary and the faces are distributed into patches at the concave edge
analyse the surface mesh and find out which edges are concave or convex
create a copy of facePatch array for local modifications
start checking the surface of the mesh
check which surface points are surrounded by boundary faces in the same surface patch
check whether exist edges of a single cell which shall be projected onto a concave edge
check if all faces are assigned to the same patch
find edges within the bounding box determined by the cell
check if there exists concave edges boundaing patches assigned to boundary faces of the current cell
there exist more faces in patch 1 assign all boundary faces to the same patch
there exist more faces in patch 0 assign all boundary faces to the same patch
transfer all faces to patch 1
transfer all faces to patch 0
just transfer all faces to the same patch
transfer the information back to facePatch
Definition at line 1423 of file edgeExtractor.C.
References DynList< T, staticSize >::append(), polyMeshGenFaces::boundaries(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), Foam::constant::universal::c, cells, polyMeshGenCells::cells(), triSurfaceClassifyEdges::CONCAVEEDGE, Foam::diff(), edgeExtractor::edgeClassifier(), meshSurfaceEngine::edgeFaces(), triSurfAddressing::edgeFacets(), edgeExtractor::edgeType_, triSurfaceClassifyEdges::edgeTypes(), f(), meshSurfaceEngine::faceOwners(), edgeExtractor::facePatch_, polyMeshGenFaces::faces(), triSurfaceClassifyEdges::FEATUREEDGE, meshOctree::findEdgesInBox(), forAll, edgeExtractor::markPatchPoints(), Foam::max(), edgeExtractor::mesh_, edgeExtractor::meshOctree_, Foam::min(), UPstream::parRun(), pMin(), points, polyMeshGenPoints::points(), Foam::reduce(), DynList< T, staticSize >::setSize(), edgeExtractor::SINGLECELLEDGE, List::size(), VRWGraph::sizeOfRow(), meshOctree::surface(), edgeExtractor::surfaceEngine(), and List::transfer().
bool checkFacePatchesTopology | ( | ) |
check and improve the distribution of mesh faces into patches in order to minimize the number of decomposed faces
allocate a copy of boundary patches
check whether there exist situations where a boundary face is surrounded by more faces in different patches than the faces in the current patch
find the faces which have neighbouring faces in other patches
go through the list of faces and check if they shall remain in the current patch
do not change patches of faces where all points are mapped onto the same patch
do not modify faces with all neighbours in the same patch
check whether there exist edges which are more suitable for projection onto feature edges than the currently selected ones
check if some faces have to be distributed to another patch in order to reduce the number of feature edges
do not swap in case the
check whether the edges shared ith the neighbour patch form a singly linked chain
change the patch to the newPatch
evaluate the new situation and ensure that no oscillation occur
transfer the new patches back
Definition at line 1632 of file edgeExtractor.C.
References DynList< T, staticSize >::appendIfNotIn(), Foam::help::areElementsInChain(), edgeExtractor::faceEvaluator::bestPatchAfterModification(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::bp(), meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::faceEdges(), edgeExtractor::facePatch_, edgeExtractor::findFaceCandidates(), edgeExtractor::findOtherFacePatchesParallel(), forAll, forAllConstIter(), forAllRow, UPstream::parRun(), edgeExtractor::pointPatch_, Foam::reduce(), Foam::help::scalarToText(), edgeExtractor::faceEvaluator::setNewBoundaryPatches(), DynList< T, staticSize >::setSize(), FixedList::setSize(), Foam::help::sharedEdge(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), edgeExtractor::surfaceEngine(), edgeExtractor::surfaceWithPatches(), List::transfer(), and triSurf::writeSurface().
Referenced by edgeExtractor::extractEdges().
bool checkCorners | ( | ) |
checks whether there exist corners which do not exist in the surface mesh, and checks whether the locations of corners in the volume mesh are near the existing counterparts in the surface mesh
allocate a copy of boundary patches
check whether there exist situations where a boundary face is surrounded by more faces in different patches than the faces in the current patch
update the information which edges are assigned as feature edges
find corners in the current constelation
find nearest corners in the surface mesh
the corner does not exist in the surface mesh this may be a situation where parts of the surface are in close proximity and are not topologically connected
for all edge nodes find their nearest counterparts in the surface
get the patches bounded by this feature edge
store the edge into the right group
check if some points have already been checked
find surface facets in the vicinity of the edge and check whether there exist various disconnected surface parts in the vicinity of this group of edge
check the vicinity of the corner point and check whether it shall be replaced by some other point in the vicinity
find all points connected to the corner point via a face
find the nearest point to the location where the corner shall be mapped onto the surface mesh
sort faces and edges at the corner in counter-clockwise order
find the best fitting edge to move towards the corner
only the edges of this face can be candidates
the edge containing the best point is the candidate
select the edge which contains best fitting point
find groups of sorted faces at this corner which are bounded by existing feature edges and the new candidate
check which group of faces shall change patch in order to make the best fitting edge a feature edge
check which groups shall change their patch desired patches at the best edge are determined by finding the best alignment between the bestEdge and the feature edges
assign new patches
calculate deformation energy of the old state
calculate deformation energy of the new state
calculate deformation energy of the old state
calculate deformation energy of the new state
Definition at line 953 of file edgeExtractorCorners.C.
References Foam::abort(), Foam::acos(), DynList< T, staticSize >::append(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), Foam::constant::universal::c, Foam::polyMeshGenChecks::checkPoints(), VRWGraph::containsAtPosition(), meshSurfacePartitioner::corners(), Foam::deleteDemandDrivenData(), Foam::e, meshSurfaceEngine::edgeFaces(), meshSurfaceEngine::edges(), Foam::endl(), Foam::exit(), meshSurfaceEngine::faceEdges(), edgeExtractor::facePatch_, Foam::FatalError, meshSurfacePartitioner::featureEdges(), meshOctree::findNearestCorner(), meshOctree::findNearestEdgePoint(), meshOctree::findNearestPointToPatches(), edgeExtractor::findOtherFacePatchesParallel(), Pair::first(), forAll, forAllConstIter(), forAllRow, HashTable::found(), fv(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::mag(), Foam::magSqr(), Foam::max(), edgeExtractor::mesh_, edgeExtractor::meshOctree_, Foam::min(), p, UPstream::parRun(), edgeExtractor::partitioner(), patches, triSurfacePartitioner::patchPatches(), pFaces, meshSurfaceEngine::pointFaces(), meshSurfacePartitioner::pointPatches(), points, polyMeshGenPoints::points(), Foam::pos(), Foam::reduce(), DynList< T, staticSize >::removeLastElement(), Foam::help::scalarToText(), Pair::second(), List::size(), DynList< T, staticSize >::size(), VRWGraph::sizeOfRow(), edgeExtractor::surfaceEngine(), edgeExtractor::surfaceWithPatches(), Foam::Warning, face::which(), and triSurf::writeSurface().
bool checkFacePatchesGeometry | ( | ) |
optimise distribution of mesh faces into patches in order to get better geometric quality of the mesh
allocate a copy of boundary patches
create feature edges and corners information
project vertices onto the surface mesh
stop after a certain number of iterations
update surface geometry data
check if there exist any inverted faces
untangle the surface
untangle the surface
check whether there exist situations where a boundary face is surrounded by more faces in different patches than the faces in the current patch
find the faces which have neighbouring faces in other patches
check the deformation energy and find the minimum energy which can be achieved by switching face patch
check if any faces are re-assigned to some other patch
update faceEvaluator with information after patches have been altered. It blocks chaning of patches if it causes oscillations
compare face patches before and after disallow modification which may trigger oscillating behaviour
Definition at line 2054 of file edgeExtractor.C.
References LongList< T, Offset >::append(), DynList< T, staticSize >::appendIfNotIn(), edgeExtractor::faceEvaluator::bestPatchAfterModification(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), edgeExtractor::calculateDeformationMetricForFace(), LongList< T, Offset >::clear(), Foam::endl(), edgeExtractor::facePatch_, edgeExtractor::findNeiPatches(), edgeExtractor::findOtherFacePatchesParallel(), forAll, forAllConstIter(), HashTable::found(), meshSurfaceCheckInvertedVertices::invertedVertices(), meshSurfaceMapper::mapVerticesOntoSurfacePatches(), edgeExtractor::meshOctree_, UPstream::parRun(), Foam::reduce(), Foam::returnReduce(), Foam::help::scalarToText(), edgeExtractor::faceEvaluator::setNewBoundaryPatches(), List::size(), LongList< T, Offset >::size(), DynList< T, staticSize >::size(), HashTable::size(), edgeExtractor::surfaceEngine(), edgeExtractor::surfaceWithPatches(), meshSurfaceOptimizer::untangleSurface(), meshSurfaceEngineModifier::updateGeometry(), WarningIn, and triSurf::writeSurface().
Referenced by edgeExtractor::extractEdges().
bool findCornerCandidates | ( | ) |
find the nearest points on the surface of the volume mesh to the corners on the surface mesh
create the surface partitioner and find the corners on the surface mesh
calculate the search range
find the nearest corner on the surface mesh
update the nearest point to the found corner
Definition at line 817 of file edgeExtractorCorners.C.
References meshSurfaceEngine::beAtProcs(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), meshSurfaceEngine::bpNeiProcs(), Foam::constant::universal::c, face::centre(), triSurfacePartitioner::corners(), Foam::endl(), Foam::help::exchangeMap(), meshOctree::findTrianglesInBox(), forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalToLocalBndPointAddressing(), Foam::Info, Foam::mag(), Foam::magSqr(), Foam::max(), edgeExtractor::mesh_, edgeExtractor::meshOctree_, UPstream::myProcNo(), p, UPstream::parRun(), points, triSurfPoints::points(), polyMeshGenPoints::points(), s(), List::size(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
void projectDeterminedFeatureVertices | ( | ) |
project the estimated corners and edges onto the surface mesh
calculate patches for each point
collect the data distributed to others
exchange information
unify the data
find the nearest object on the surface mesh
find the nearest object in an iterative procedure
check if the exact position of the corner is further away than the iteratively found object
Definition at line 2245 of file edgeExtractor.C.
References meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), meshSurfaceEngine::bpAtProcs(), meshSurfaceEngine::bpNeiProcs(), Foam::e, Foam::help::exchangeMap(), edgeExtractor::facePatch_, meshOctree::findNearestCorner(), meshOctree::findNearestEdgePoint(), meshOctree::findNearestSurfacePointInRegion(), Pair::first(), forAll, forAllConstIter(), forAllRow, meshSurfaceEngine::globalToLocalBndPointAddressing(), Foam::magSqr(), meshSurfaceEngine::mesh(), edgeExtractor::meshOctree_, meshSurfaceEngineModifier::moveBoundaryVertexNoUpdate(), UPstream::myProcNo(), p, UPstream::parRun(), triSurfAddressing::pointEdges(), points, polyMeshGenPoints::points(), edgeExtractor::pointValence_, Pair::second(), List::setSize(), LongList< T, Offset >::size(), DynList< T, staticSize >::size(), meshOctree::surface(), edgeExtractor::surfaceEngine(), meshSurfaceEngineModifier::syncVerticesAtParallelBoundaries(), meshSurfaceEngineModifier::updateGeometry(), and Vector< scalar >::zero.
bool untangleSurface | ( | ) |
check and untangle the surface of the volume mesh
Definition at line 2386 of file edgeExtractor.C.
References edgeExtractor::meshOctree_, edgeExtractor::surfaceEngine(), and meshSurfaceOptimizer::untangleSurface().
void extractEdges | ( | ) |
assemble the above functionality into a workflow
Definition at line 2398 of file edgeExtractor.C.
References edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), Foam::deleteDemandDrivenData(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), Foam::endl(), Foam::Info, Foam::help::scalarToText(), edgeExtractor::surfaceWithPatches(), and triSurf::writeSurface().
Referenced by cartesianMeshGenerator::extractPatches(), tetMeshGenerator::extractPatches(), and voronoiMeshGenerator::extractPatches().
const triSurf * surfaceWithPatches | ( | ) | const |
generate a surface mesh and store the created patches this is mainly intended for debugging purposes
allocate the memory for the surface mesh
surface of the volume mesh
modifier of the new surface mesh
copy points
create the triangulation of the volume mesh surface
Definition at line 2445 of file edgeExtractor.C.
References triSurfFacets::appendTriangle(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::boundaryPoints(), meshSurfaceEngine::bp(), edgeExtractor::facePatch_, forAll, edgeExtractor::mesh_, edgeExtractor::meshOctree_, triSurfFacets::patches(), triSurfModifier::patchesAccess(), points, polyMeshGenPoints::points(), triSurfModifier::pointsAccess(), labelledTri::region(), List::size(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
Referenced by edgeExtractor::checkCorners(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), and edgeExtractor::extractEdges().
generate a surface mesh constin of facets adjacent to the requested surface point
allocate the memory for the surface mesh
surface of the volume mesh
modifier of the new surface mesh
create the triangulation of the volume mesh surface
copy points
Definition at line 2492 of file edgeExtractor.C.
References triSurfFacets::appendTriangle(), meshSurfaceEngine::boundaryFaces(), edgeExtractor::facePatch_, forAll, forAllRow, edgeExtractor::mesh_, edgeExtractor::meshOctree_, nPoints, triSurfFacets::patches(), triSurfModifier::patchesAccess(), pFaces, meshSurfaceEngine::pointFaces(), points, polyMeshGenPoints::points(), triSurfModifier::pointsAccess(), labelledTri::region(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
void updateMeshPatches | ( | ) |
update mesh with selected patches
set patchNames
append boundary faces
replace the boundary with the new patches
set the new patch types
Definition at line 2544 of file edgeExtractor.C.
References VRWGraph::appendList(), polyMeshGenModifier::boundariesAccess(), meshSurfaceEngine::boundaryFaces(), meshSurfaceEngine::faceOwners(), edgeExtractor::facePatch_, forAll, edgeExtractor::mesh_, edgeExtractor::meshOctree_, geometryBase::name(), nPatches, patchNames(), polyMeshGenModifier::replaceBoundary(), List::size(), UList::size(), meshOctree::surface(), and edgeExtractor::surfaceEngine().
Referenced by cartesianMeshGenerator::extractPatches(), tetMeshGenerator::extractPatches(), and voronoiMeshGenerator::extractPatches().
|
private |
reference to the mesh
Definition at line 69 of file edgeExtractor.H.
Referenced by edgeExtractor::checkConcaveEdgeCells(), edgeExtractor::checkCorners(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), edgeExtractor::findCornerCandidates(), edgeExtractor::surfaceEngine(), edgeExtractor::surfaceWithPatches(), and edgeExtractor::updateMeshPatches().
|
mutableprivate |
surface engine
Definition at line 72 of file edgeExtractor.H.
Referenced by edgeExtractor::surfaceEngine(), and edgeExtractor::~edgeExtractor().
|
private |
reference to the octree
Definition at line 75 of file edgeExtractor.H.
Referenced by edgeExtractor::checkConcaveEdgeCells(), edgeExtractor::checkCorners(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), edgeExtractor::edgeClassifier(), edgeExtractor::findCornerCandidates(), edgeExtractor::findEdgeCandidates(), edgeExtractor::findFeatureEdgesNearEdge(), edgeExtractor::findPatchesNearSurfaceFace(), edgeExtractor::moveVerticesTowardsDiscontinuities(), edgeExtractor::partitioner(), edgeExtractor::projectDeterminedFeatureVertices(), edgeExtractor::surfaceWithPatches(), edgeExtractor::untangleSurface(), and edgeExtractor::updateMeshPatches().
|
mutableprivate |
surface mesh partitioner
Definition at line 78 of file edgeExtractor.H.
Referenced by edgeExtractor::partitioner(), and edgeExtractor::~edgeExtractor().
|
mutableprivate |
classification of edges in the surface mesh
Definition at line 81 of file edgeExtractor.H.
Referenced by edgeExtractor::edgeClassifier(), and edgeExtractor::~edgeExtractor().
|
private |
valence of surface points
Definition at line 84 of file edgeExtractor.H.
Referenced by edgeExtractor::calculateValence(), and edgeExtractor::projectDeterminedFeatureVertices().
|
private |
patch to which a boundary point is mapped to
Definition at line 87 of file edgeExtractor.H.
Referenced by edgeExtractor::checkFacePatchesTopology(), and edgeExtractor::distributeBoundaryFaces().
|
private |
boundary face patch
Definition at line 90 of file edgeExtractor.H.
Referenced by edgeExtractor::faceEvaluator::calculateNeiPatchesParallel(), edgeExtractor::checkConcaveEdgeCells(), edgeExtractor::checkCorners(), edgeExtractor::checkFacePatchesGeometry(), edgeExtractor::checkFacePatchesTopology(), edgeExtractor::distributeBoundaryFaces(), edgeExtractor::distributeBoundaryFacesNormalAlignment(), edgeExtractor::findEdgeCandidates(), edgeExtractor::markPatchPoints(), edgeExtractor::projectDeterminedFeatureVertices(), edgeExtractor::surfaceWithPatches(), and edgeExtractor::updateMeshPatches().
|
private |
number of cells attached to a boundary edge
Definition at line 93 of file edgeExtractor.H.
Referenced by edgeExtractor::calculateSingleCellEdge().
edge classification
Definition at line 96 of file edgeExtractor.H.
Referenced by edgeExtractor::calculateSingleCellEdge(), edgeExtractor::checkConcaveEdgeCells(), and edgeExtractor::findEdgeCandidates().
|
private |
patches in the vicinity of a face on the surface of the volume mesh
Definition at line 99 of file edgeExtractor.H.
Referenced by edgeExtractor::findPatchesNearSurfaceFace().
|
private |
feature edges in the surface mesh which are candindates for an edge at the surface of the volume mesh
Definition at line 103 of file edgeExtractor.H.
Referenced by edgeExtractor::findFeatureEdgesNearEdge().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.