repatcher.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-2024 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::repatcher
26 
27 Description
28  A mesh which allows changes in the patch distribution of the
29  boundary faces. The change in patching is set using changePatchID. For a
30  boundary face, a new patch ID is given.
31 
32 SourceFiles
33  repatcher.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef repatcher_H
38 #define repatcher_H
39 
40 #include "polyMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class polyTopoChange;
48 
49 /*---------------------------------------------------------------------------*\
50  Class repatcher Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class repatcher
54 {
55  // Private Data
56 
57  //- The polyMesh to be repatched
58  polyMesh& mesh_;
59 
60  //- Topological change to accumulated all mesh changes
61  autoPtr<polyTopoChange> meshModPtr_;
62 
63 
64  // Private Member Functions
65 
66  //- Demand driven access to polyTopoChange
67  polyTopoChange& meshMod();
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct for given mesh
75  explicit repatcher(polyMesh& mesh);
76 
77  //- Disallow default bitwise copy construction
78  repatcher(const repatcher&) = delete;
79 
80 
81  //- Destructor
82  virtual ~repatcher();
83 
84 
85  // Member Functions
86 
87  //- Change patches.
89 
90  //- Change patch ID for a boundary face. Note: patchID should be in new
91  // numbering.
92  void changePatchID
93  (
94  const label faceID,
95  const label patchID
96  );
97 
98  //- Change anchor point (zero'th point of face) for a boundary face.
100  (
101  const label faceID,
102  const label fp
103  );
104 
105  //- Re-patch the mesh
106  void repatch();
107 
108 
109  // Member Operators
110 
111  //- Disallow default bitwise assignment
112  void operator=(const repatcher&) = delete;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Direct mesh changes based on v1.3 polyTopoChange syntax.
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
Definition: repatcher.H:53
void changeAnchorPoint(const label faceID, const label fp)
Change anchor point (zero'th point of face) for a boundary face.
Definition: repatcher.C:118
void operator=(const repatcher &)=delete
Disallow default bitwise assignment.
void changePatchID(const label faceID, const label patchID)
Change patch ID for a boundary face. Note: patchID should be in new.
Definition: repatcher.C:83
void changePatches(const List< polyPatch * > &patches)
Change patches.
Definition: repatcher.C:66
virtual ~repatcher()
Destructor.
Definition: repatcher.C:59
void repatch()
Re-patch the mesh.
Definition: repatcher.C:190
repatcher(polyMesh &mesh)
Construct for given mesh.
Definition: repatcher.C:50
const fvPatchList & patches
Namespace for OpenFOAM.
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