checkBoundaryFacesSharingTwoEdges.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  checkBoundaryFacesSharingTwoEdges
26 
27 Description
28  Checks cell connections at the surface. Cells with all vertices at
29  the boundary are considered problematic because they get severly skewed
30  after being mapped to the geometry surface in most cases. This code performs
31  checks of cells with all vertices at the boundary with the rest of the mesh.
32  Such cells having a neighbour with all internal faces are removed.
33 
34 SourceFiles
35  checkBoundaryFacesSharingTwoEdges.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef checkBoundaryFacesSharingTwoEdges_H
40 #define checkBoundaryFacesSharingTwoEdges_H
41 
42 #include "polyMeshGenModifier.H"
43 #include "HashSet.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declarations
51 class meshSurfaceEngine;
52 
53 /*---------------------------------------------------------------------------*\
54  Class checkBoundaryFacesSharingTwoEdges Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59  // Private data
60  //- Reference to polyMeshGen
62 
63  //- pointer to meshSurfaceEngine
65 
66  //- number of boundary faces attached to a boundary vertex
68 
69  //- a list of boundary points which can be removed from the mesh
71 
72  // Private member functions
73  //- creates meshSurfaceEngine
74  void createMeshSurface() const;
75 
76  //- returns mesh surface
77  inline const meshSurfaceEngine& meshSurface() const
78  {
79  if( !meshSurfacePtr_ )
81 
82  return *meshSurfacePtr_;
83  }
84 
85  //- find the faces connected to each boundary edge
86  //- mark the points which can be removed
87  void findFacesAtBndEdge();
88 
89  //- find the number of faces connected to the boundary vertex
91 
92  //- remove vertices from the faces
94 
95  //- find boundary faces which shall be decomposed into triangles
97 
98  //- Disallow default bitwise copy construct
100  (
102  );
103 
104  //- Disallow default bitwise assignment
106 
107 public:
108 
109  // Constructors
110 
111  //- Construct from polyMeshGen and meshOctree
113 
114  // Destructor
115 
117 
118  // Member Functions
119  //- find boundary points connected to two boundary faces, only
120  void findPoints(labelHashSet& badPoints);
121 
122  //- find boundary points connected to two boundary faces
123  //- remove points if possible, decompose boundary faces otherwise
124  bool improveTopology();
125 };
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
meshSurfaceEngine
Calculates surface of the mesh.
Foam::checkBoundaryFacesSharingTwoEdges
Definition: checkBoundaryFacesSharingTwoEdges.H:56
polyMeshGenModifier.H
Foam::checkBoundaryFacesSharingTwoEdges::findBndFacesAtBndVertex
void findBndFacesAtBndVertex()
find the number of faces connected to the boundary vertex
Definition: checkBoundaryFacesSharingTwoEdges.C:206
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::checkBoundaryFacesSharingTwoEdges::improveTopology
bool improveTopology()
Definition: checkBoundaryFacesSharingTwoEdges.C:457
Foam::checkBoundaryFacesSharingTwoEdges::nBndFacesAtBndPoint_
labelList nBndFacesAtBndPoint_
number of boundary faces attached to a boundary vertex
Definition: checkBoundaryFacesSharingTwoEdges.H:66
Foam::HashSet< label, Hash< label > >
Foam::checkBoundaryFacesSharingTwoEdges::~checkBoundaryFacesSharingTwoEdges
~checkBoundaryFacesSharingTwoEdges()
Definition: checkBoundaryFacesSharingTwoEdges.C:434
Foam::checkBoundaryFacesSharingTwoEdges::operator=
void operator=(const checkBoundaryFacesSharingTwoEdges &)
Disallow default bitwise assignment.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::checkBoundaryFacesSharingTwoEdges::findPoints
void findPoints(labelHashSet &badPoints)
find boundary points connected to two boundary faces, only
Definition: checkBoundaryFacesSharingTwoEdges.C:441
HashSet.H
Foam::checkBoundaryFacesSharingTwoEdges::meshSurface
const meshSurfaceEngine & meshSurface() const
returns mesh surface
Definition: checkBoundaryFacesSharingTwoEdges.H:76
Foam::checkBoundaryFacesSharingTwoEdges::mesh_
polyMeshGen & mesh_
Reference to polyMeshGen.
Definition: checkBoundaryFacesSharingTwoEdges.H:60
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::checkBoundaryFacesSharingTwoEdges::findBndFacesForDecomposition
label findBndFacesForDecomposition(boolList &decomposeFace)
find boundary faces which shall be decomposed into triangles
Definition: checkBoundaryFacesSharingTwoEdges.C:381
Foam::checkBoundaryFacesSharingTwoEdges::meshSurfacePtr_
meshSurfaceEngine * meshSurfacePtr_
pointer to meshSurfaceEngine
Definition: checkBoundaryFacesSharingTwoEdges.H:63
Foam::checkBoundaryFacesSharingTwoEdges::createMeshSurface
void createMeshSurface() const
creates meshSurfaceEngine
Definition: checkBoundaryFacesSharingTwoEdges.C:48
Foam::checkBoundaryFacesSharingTwoEdges::findFacesAtBndEdge
void findFacesAtBndEdge()
Definition: checkBoundaryFacesSharingTwoEdges.C:53
Foam::checkBoundaryFacesSharingTwoEdges::removeExcessiveVertices
void removeExcessiveVertices()
remove vertices from the faces
Definition: checkBoundaryFacesSharingTwoEdges.C:257
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::checkBoundaryFacesSharingTwoEdges::removeBndPoint_
boolList removeBndPoint_
a list of boundary points which can be removed from the mesh
Definition: checkBoundaryFacesSharingTwoEdges.H:69
Foam::checkBoundaryFacesSharingTwoEdges::checkBoundaryFacesSharingTwoEdges
checkBoundaryFacesSharingTwoEdges(const checkBoundaryFacesSharingTwoEdges &)
Disallow default bitwise copy construct.
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54