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-2020 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 repatchPolyTopoChanger_H
41 #define 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  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 patch ID for a boundary face. Note: patchID should be in new
96  // numbering.
97  void changePatchID
98  (
99  const label faceID,
100  const label patchID
101  );
102 
103  //- Set zone ID for a face
104  void setFaceZone
105  (
106  const label faceID,
107  const label zoneID,
108  const bool zoneFlip
109  );
110 
111  //- Change anchor point (zero'th point of face) for a boundary face.
112  void changeAnchorPoint
113  (
114  const label faceID,
115  const label fp
116  );
117 
118 
119  //- Re-patch the mesh
120  void repatch();
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::repatchPolyTopoChanger::changeAnchorPoint
void changeAnchorPoint(const label faceID, const label fp)
Change anchor point (zero'th point of face) for a boundary face.
Definition: repatchPolyTopoChanger.C:168
Foam::repatchPolyTopoChanger::setFaceZone
void setFaceZone(const label faceID, const label zoneID, const bool zoneFlip)
Set zone ID for a face.
Definition: repatchPolyTopoChanger.C:132
Foam::repatchPolyTopoChanger::~repatchPolyTopoChanger
virtual ~repatchPolyTopoChanger()=default
Destructor.
polyTopoChange.H
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:99
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::repatchPolyTopoChanger
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
Definition: repatchPolyTopoChanger.H:54
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
zoneID
const labelIOList & zoneID
Definition: interpolatedFaces.H:22
Foam::repatchPolyTopoChanger::changePatches
void changePatches(const List< polyPatch * > &patches)
Change patches.
Definition: repatchPolyTopoChanger.C:62
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::repatchPolyTopoChanger::repatch
void repatch()
Re-patch the mesh.
Definition: repatchPolyTopoChanger.C:264
Foam::repatchPolyTopoChanger::changePatchID
void changePatchID(const label faceID, const label patchID)
Change patch ID for a boundary face. Note: patchID should be in new.
Definition: repatchPolyTopoChanger.C:80