cellSplitter.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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::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 "Map.H"
40 #include "edge.H"
41 #include "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 
58 class cellSplitter
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 
95 public:
96 
97  //- Runtime type information
98  ClassName("cellSplitter");
99 
100  // Constructors
101 
102  //- Construct from mesh
103  cellSplitter(const polyMesh& mesh);
104 
105  //- Disallow default bitwise copy construction
106  cellSplitter(const cellSplitter&) = delete;
107 
108 
109  //- Destructor
110  ~cellSplitter();
111 
112 
113  // Member Functions
114 
115  // Edit
116 
117  //- Insert mesh changes into meshMod.
118  // cellToMidPoint : cell to cut and position of its new midpoint
119  void setRefinement
120  (
121  const Map<point>& cellToMidPoint,
122  polyTopoChange& meshMod
123  );
124 
125  //- Force recalculation of locally stored data on topological change
126  void updateMesh(const mapPolyMesh&);
127 
128 
129  // Access
130 
131  //- Per cell the mid point added.
132  const Map<label>& addedPoints() const
133  {
134  return addedPoints_;
135  }
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const cellSplitter&) = delete;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
~cellSplitter()
Destructor.
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
void operator=(const cellSplitter &)=delete
Disallow default bitwise assignment.
void setRefinement(const Map< point > &cellToMidPoint, polyTopoChange &meshMod)
Insert mesh changes into meshMod.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Does pyramidal decomposition of selected cells. So all faces will become base of pyramid with as top ...
Definition: cellSplitter.H:57
cellSplitter(const polyMesh &mesh)
Construct from mesh.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
const Map< label > & addedPoints() const
Per cell the mid point added.
Definition: cellSplitter.H:131
dynamicFvMesh & mesh
ClassName("cellSplitter")
Runtime type information.
Direct mesh changes based on v1.3 polyTopoChange syntax.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.