repatchPolyTopoChanger.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 OpenFOAM Foundation
9  Copyright (C) 2019-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::repatchPolyTopoChanger
29 
30 Description
31  A mesh which allows changes in the patch distribution of the
32  boundary faces. The change in patching is set using changePatchID. For a
33  boundary face, a new patch ID is given.
34 
35 SourceFiles
36  repatchPolyTopoChanger.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Foam_repatchPolyTopoChanger_H
41 #define Foam_repatchPolyTopoChanger_H
42 
43 #include "polyMesh.H"
44 #include "polyTopoChange.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class repatchPolyTopoChanger Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private Data
58 
59  //- The polyMesh to be repatched
60  polyMesh& mesh_;
61 
62  //- Topological change to accumulated all mesh changes
63  std::unique_ptr<polyTopoChange> meshModPtr_;
64 
65 
66  // Private Member Functions
67 
68  //- Demand-driven access to polyTopoChange
69  polyTopoChange& meshMod();
70 
71  //- No copy construct
73 
74  //- No copy assignment
75  void operator=(const repatchPolyTopoChanger&) = delete;
76 
77 
78 public:
79 
80  // Constructors
81 
82  //- Construct for given mesh
84 
85 
86  //- Destructor
87  virtual ~repatchPolyTopoChanger() = default;
88 
89 
90  // Member Functions
91 
92  //- Change patches.
94 
95  //- Change patches.
97 
98  //- Change patch ID for a boundary face.
99  //- Note: patchID should be in new numbering.
100  void changePatchID
101  (
102  const label faceID,
103  const label patchID
104  );
105 
106  //- Set zone ID for a face
107  void setFaceZone
108  (
109  const label faceID,
110  const label zoneID,
111  const bool zoneFlip
112  );
113 
114  //- Change anchor point (zero'th point of face) for a boundary face.
115  void changeAnchorPoint
116  (
117  const label faceID,
118  const label fp
119  );
120 
121 
122  //- Re-patch the mesh
123  void repatch();
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
virtual ~repatchPolyTopoChanger()=default
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
void setFaceZone(const label faceID, const label zoneID, const bool zoneFlip)
Set zone ID for a face.
void changeAnchorPoint(const label faceID, const label fp)
Change anchor point (zero&#39;th point of face) for a boundary face.
void changePatchID(const label faceID, const label patchID)
Change patch ID for a boundary face. Note: patchID should be in new numbering.
void repatch()
Re-patch the mesh.
dynamicFvMesh & mesh
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
void changePatches(polyPatchList &patches)
Change patches.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Direct mesh changes based on v1.3 polyTopoChange syntax.
const polyBoundaryMesh & patches
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.