tetDecomposer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::tetDecomposer
26 
27 Description
28  Decomposes polyMesh into tets.
29 
30 SourceFiles
31  tetDecomposer.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tetDecomposer_H
36 #define tetDecomposer_H
37 
38 #include "DynamicList.H"
39 #include "PackedBoolList.H"
40 #include "boolList.H"
41 #include "typeInfo.H"
42 #include "NamedEnum.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class polyMesh;
50 class polyTopoChange;
51 class face;
52 class mapPolyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class tetDecomposer Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class tetDecomposer
59 {
60 public:
61 
62  // Public data types
63 
65  {
66  FACE_CENTRE_TRIS, //- Faces decomposed into triangles
67  // using face-centre
68 
69  FACE_DIAG_TRIS //- Faces decomposed into triangles diagonally
70  };
72 
73 
74 private:
75 
76  // Private data
77 
78  const polyMesh& mesh_;
79 
80  //- From cell to tet point
82 
83  //- From face to tet point
85 
86 
87  // Per face, per point (faceCentre) or triangle (faceDiag)
88  // the added tet on the owner side
90 
91  // Per face, per point (faceCentre) or triangle (faceDiag)
92  // the added tet on the neighbour side
94 
95 
96  // Private Member Functions
97 
98  //- Modify a face
99  void modifyFace
100  (
101  polyTopoChange& meshMod,
102  const face& f,
103  const label faceI,
104  const label own,
105  const label nei,
106  const label patchI,
107  const label zoneI,
108  const bool zoneFlip
109  ) const;
110 
111  //- Add a face
112  void addFace
113  (
114  polyTopoChange& meshMod,
115  const face& f,
116  const label own,
117  const label nei,
118  const label masterPointID,
119  const label masterEdgeID,
120  const label masterFaceID,
121  const label patchI,
122  const label zoneI,
123  const bool zoneFlip
124  ) const;
125 
126  //- Work out triangle index given the starting vertex in the face
127  label triIndex(const label faceI, const label fp) const;
128 
129  //- Disallow default bitwise copy construct
131 
132  //- Disallow default bitwise assignment
133  void operator=(const tetDecomposer&);
134 
135 
136 public:
137 
138  //- Runtime type information
139  ClassName("tetDecomposer");
140 
141 
142  // Constructors
143 
144  //- Construct from mesh
145  tetDecomposer(const polyMesh&);
146 
147 
148  // Member Functions
149 
150  // Access
151 
152  //- From cell to tet point
153  const labelList& cellToPoint() const
154  {
155  return cellToPoint_;
156  }
157 
158  //- From face to tet point
159  const labelList& faceToPoint() const
160  {
161  return faceToPoint_;
162  }
163 
164 
165  //- Per face, per point (faceCentre) or triangle (faceDiag)
166  // the added tet on the owner side
167  const labelListList& faceOwnerCells() const
168  {
169  return faceOwnerCells_;
170  }
171 
172  //- Per face, per point (faceCentre) or triangle (faceDiag)
173  // the added tet on the neighbour side
174  const labelListList& faceNeighbourCells() const
175  {
176  return faceNeighbourCells_;
177  }
178 
179 
180  // Edit
181 
182  //- Insert all changes into meshMod to convert the polyMesh into
183  // tets.
184  void setRefinement
185  (
186  const decompositionType decomposeType,
187  polyTopoChange& meshMod
188  );
189 
190  //- Force recalculation of locally stored data on topological change
191  void updateMesh(const mapPolyMesh&);
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
Foam::tetDecomposer::ClassName
ClassName("tetDecomposer")
Runtime type information.
Foam::tetDecomposer::FACE_DIAG_TRIS
@ FACE_DIAG_TRIS
Definition: tetDecomposer.H:68
boolList.H
typeInfo.H
Foam::tetDecomposer::updateMesh
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: tetDecomposer.C:697
Foam::tetDecomposer::cellToPoint
const labelList & cellToPoint() const
From cell to tet point.
Definition: tetDecomposer.H:152
Foam::tetDecomposer::faceToPoint
const labelList & faceToPoint() const
From face to tet point.
Definition: tetDecomposer.H:158
NamedEnum.H
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:97
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::tetDecomposer::faceOwnerCells
const labelListList & faceOwnerCells() const
Per face, per point (faceCentre) or triangle (faceDiag)
Definition: tetDecomposer.H:166
Foam::tetDecomposer::faceOwnerCells_
labelListList faceOwnerCells_
Definition: tetDecomposer.H:88
Foam::tetDecomposer::operator=
void operator=(const tetDecomposer &)
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
PackedBoolList.H
Foam::tetDecomposer::modifyFace
void modifyFace(polyTopoChange &meshMod, const face &f, const label faceI, const label own, const label nei, const label patchI, const label zoneI, const bool zoneFlip) const
Modify a face.
Definition: tetDecomposer.C:54
Foam::tetDecomposer::decompositionType
decompositionType
Definition: tetDecomposer.H:63
Foam::tetDecomposer::setRefinement
void setRefinement(const decompositionType decomposeType, polyTopoChange &meshMod)
Insert all changes into meshMod to convert the polyMesh into.
Definition: tetDecomposer.C:183
Foam::tetDecomposer::mesh_
const polyMesh & mesh_
Definition: tetDecomposer.H:77
Foam::tetDecomposer::tetDecomposer
tetDecomposer(const tetDecomposer &)
Disallow default bitwise copy construct.
Foam::tetDecomposer
Decomposes polyMesh into tets.
Definition: tetDecomposer.H:57
Foam::tetDecomposer::faceNeighbourCells
const labelListList & faceNeighbourCells() const
Per face, per point (faceCentre) or triangle (faceDiag)
Definition: tetDecomposer.H:173
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:57
Foam::tetDecomposer::triIndex
label triIndex(const label faceI, const label fp) const
Work out triangle index given the starting vertex in the face.
Definition: tetDecomposer.C:148
f
labelList f(nPoints)
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::tetDecomposer::addFace
void addFace(polyTopoChange &meshMod, const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const label patchI, const label zoneI, const bool zoneFlip) const
Add a face.
Definition: tetDecomposer.C:98
Foam::tetDecomposer::faceNeighbourCells_
labelListList faceNeighbourCells_
Definition: tetDecomposer.H:92
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::tetDecomposer::faceToPoint_
labelList faceToPoint_
From face to tet point.
Definition: tetDecomposer.H:83
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
DynamicList.H
Foam::tetDecomposer::FACE_CENTRE_TRIS
@ FACE_CENTRE_TRIS
Definition: tetDecomposer.H:65
Foam::tetDecomposer::cellToPoint_
labelList cellToPoint_
From cell to tet point.
Definition: tetDecomposer.H:80
Foam::NamedEnum< decompositionType, 2 >
Foam::tetDecomposer::decompositionTypeNames
static const NamedEnum< decompositionType, 2 > decompositionTypeNames
Definition: tetDecomposer.H:70