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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::cellSplitter
28
29Description
30 Does pyramidal decomposition of selected cells. So all faces will become
31 base of pyramid with as top a user-supplied point (usually the cell centre)
32
33SourceFiles
34 cellSplitter.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef cellSplitter_H
39#define cellSplitter_H
40
41#include "Map.H"
42#include "edge.H"
43#include "typeInfo.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declaration of classes
51class polyTopoChange;
52class mapPolyMesh;
53class polyMesh;
54
55
56/*---------------------------------------------------------------------------*\
57 Class cellSplitter Declaration
58\*---------------------------------------------------------------------------*/
60class cellSplitter
61{
62 // Private data
63
64 //- Reference to mesh
65 const polyMesh& mesh_;
66
67 //- Per cell the mid point added.
68 Map<label> addedPoints_;
69
70
71 // Private Member Functions
72
73 //- Get patch and zone info for face
74 void getFaceInfo
75 (
76 const label facei,
77 label& patchID,
78 label& zoneID,
79 label& zoneFlip
80 ) const;
81
82 //- Find the new owner (if any) of the face.
83 label newOwner
84 (
85 const label facei,
86 const Map<labelList>& cellToCells
87 ) const;
88
89 //- Find the new neighbour (if any) of the face.
90 label newNeighbour
91 (
92 const label facei,
93 const Map<labelList>& cellToCells
94 ) const;
95
96 //- No copy construct
97 cellSplitter(const cellSplitter&) = delete;
98
99 //- No copy assignment
100 void operator=(const cellSplitter&) = delete;
101
102public:
103
104 //- Runtime type information
105 ClassName("cellSplitter");
106
107 // Constructors
108
109 //- Construct from mesh
110 cellSplitter(const polyMesh& mesh);
111
112
113 //- Destructor
114 ~cellSplitter() = default;
115
116
117 // Member Functions
118
119 // Edit
120
121 //- Insert mesh changes into meshMod.
122 // cellToMidPoint : cell to cut and position of its new midpoint
123 void setRefinement
124 (
125 const Map<point>& cellToMidPoint,
126 polyTopoChange& meshMod
127 );
128
129 //- Force recalculation of locally stored data on topological change
130 void updateMesh(const mapPolyMesh&);
131
132
133 // Access
134
135 //- Per cell the mid point added.
136 const Map<label>& addedPoints() const
137 {
138 return addedPoints_;
139 }
140};
141
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149#endif
150
151// ************************************************************************* //
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
Does pyramidal decomposition of selected cells. So all faces will become base of pyramid with as top ...
Definition: cellSplitter.H:60
const Map< label > & addedPoints() const
Per cell the mid point added.
Definition: cellSplitter.H:135
void setRefinement(const Map< point > &cellToMidPoint, polyTopoChange &meshMod)
Insert mesh changes into meshMod.
ClassName("cellSplitter")
Runtime type information.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
~cellSplitter()=default
Destructor.
cellSplitter(const polyMesh &mesh)
Construct from mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Direct mesh changes based on v1.3 polyTopoChange syntax.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
dynamicFvMesh & mesh
const labelIOList & zoneID
Namespace for OpenFOAM.