nonConformalPolyPatch.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) 2021-2023 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::nonConformalPolyPatch
26 
27 Description
28  Non-conformal poly patch. This patch is a placeholder and must have no
29  faces. This patch is linked to an "original" patch. Other parts of the code
30  (i.e., finite volume) will use this patch to create non-empty patches that
31  do not conform to the poly mesh.
32 
33 SourceFiles
34  nonConformalPolyPatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef nonConformalPolyPatch_H
39 #define nonConformalPolyPatch_H
40 
41 #include "cyclicPolyPatch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class nonConformalPolyPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 {
54 private:
55 
56  // Private
57 
58  //- Reference to the polyPatch
59  const polyPatch& patch_;
60 
61  //- Name of the patch from which this patch originates
62  mutable word origPatchName_;
63 
64  //- Index of the patch from which this patch originates
65  mutable label origPatchIndex_;
66 
67 
68  // Private Member Functions
69 
70  //- Validate the size of the patch
71  void validateSize() const;
72 
73 
74 protected:
75 
76  // Protected Member Functions
77 
78  //- Reset the patch name
79  virtual void rename(const wordList& newNames);
80 
81  //- Reset the patch index
82  virtual void reorder(const labelUList& newToOldIndex);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("nonConformal");
89 
90 
91  // Constructors
92 
93  //- Construct from a patch
95 
96  //- Construct from a patch and an original patch name
98  (
99  const polyPatch& patch,
100  const word& origPatchName
101  );
102 
103  //- Construct from a patch and a dictionary
105  (
106  const polyPatch& patch,
107  const dictionary& dict
108  );
109 
110  //- Construct from a patch and a non-conformal patch
112  (
113  const polyPatch& patch,
114  const nonConformalPolyPatch& ncPatch
115  );
116 
117 
118  //- Destructor
119  virtual ~nonConformalPolyPatch();
120 
121 
122  // Member Functions
123 
124  //- Reference to the polyPatch
125  const polyPatch& patch() const;
126 
127  //- Original patch name
128  const word& origPatchName() const;
129 
130  //- Original patchID
131  label origPatchIndex() const;
132 
133  //- Original patch
134  const polyPatch& origPatch() const;
135 
136  //- Write the polyPatch data as a dictionary
137  virtual void write(Ostream&) const;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Non-conformal poly patch. This patch is a placeholder and must have no faces. This patch is linked to...
label origPatchIndex() const
Original patchID.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void rename(const wordList &newNames)
Reset the patch name.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
TypeName("nonConformal")
Runtime type information.
const polyPatch & origPatch() const
Original patch.
const polyPatch & patch() const
Reference to the polyPatch.
nonConformalPolyPatch(const polyPatch &patch)
Construct from a patch.
const word & origPatchName() const
Original patch name.
virtual ~nonConformalPolyPatch()
Destructor.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
A class for handling words, derived from string.
Definition: word.H:62
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
dictionary dict