FreeFOAM The Cross-Platform CFD Toolkit
cellSplitter.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) 1991-2010 OpenCFD Ltd.
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::cellSplitter
26 
27 Description
28  Does pyramidal decomposition of selected cells. So all faces will become
29  base of pyramid with as top a user-supplied point (usually the cell centre)
30 
31 SourceFiles
32  cellSplitter.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cellSplitter_H
37 #define cellSplitter_H
38 
39 #include <OpenFOAM/Map.H>
40 #include <OpenFOAM/edge.H>
41 #include <OpenFOAM/typeInfo.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyTopoChange;
50 class mapPolyMesh;
51 class polyMesh;
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class cellSplitter Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  // Private data
61 
62  //- Reference to mesh
63  const polyMesh& mesh_;
64 
65  //- Per cell the mid point added.
66  Map<label> addedPoints_;
67 
68 
69  // Private Member Functions
70 
71  //- Get patch and zone info for face
72  void getFaceInfo
73  (
74  const label faceI,
75  label& patchID,
76  label& zoneID,
77  label& zoneFlip
78  ) const;
79 
80  //- Find the new owner (if any) of the face.
81  label newOwner
82  (
83  const label faceI,
84  const Map<labelList>& cellToCells
85  ) const;
86 
87  //- Find the new neighbour (if any) of the face.
88  label newNeighbour
89  (
90  const label faceI,
91  const Map<labelList>& cellToCells
92  ) const;
93 
94  //- Disallow default bitwise copy construct
95  cellSplitter(const cellSplitter&);
96 
97  //- Disallow default bitwise assignment
98  void operator=(const cellSplitter&);
99 
100 public:
101 
102  //- Runtime type information
103  ClassName("cellSplitter");
104 
105  // Constructors
106 
107  //- Construct from mesh
108  cellSplitter(const polyMesh& mesh);
109 
110 
111  // Destructor
112 
113  ~cellSplitter();
114 
115 
116  // Member Functions
117 
118  // Edit
119 
120  //- Insert mesh changes into meshMod.
121  // cellToMidPoint : cell to cut and position of its new midpoint
122  void setRefinement
123  (
124  const Map<point>& cellToMidPoint,
125  polyTopoChange& meshMod
126  );
127 
128  //- Force recalculation of locally stored data on topological change
129  void updateMesh(const mapPolyMesh&);
130 
131 
132  // Access
133 
134  //- Per cell the mid point added.
135  const Map<label>& addedPoints() const
136  {
137  return addedPoints_;
138  }
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************ vim: set sw=4 sts=4 et: ************************ //