nonConformalErrorPolyPatch.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-2022 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::nonConformalErrorPolyPatch
26 
27 Description
28  Non-conformal error poly patch. As nonConformalPolyPatch. This patch is a
29  non-coupled non-conformal patch which is used to manage the errors created
30  during the construction of a non-conformal coupled interface. Every patch
31  used as the original patch of the owner side of a non-conformal coupled
32  interface must also have an associated error patch.
33 
34 See also
35  Foam::nonConformalPolyPatch
36 
37 SourceFiles
38  nonConformalErrorPolyPatch.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef nonConformalErrorPolyPatch_H
43 #define nonConformalErrorPolyPatch_H
44 
45 #include "polyPatch.H"
46 #include "nonConformalPolyPatch.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class nonConformalCyclicPolyPatch;
54 
55 /*---------------------------------------------------------------------------*\
56  Class nonConformalErrorPolyPatch Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
61  public polyPatch,
63 {
64 protected:
65 
66  // Protected Member Functions
67 
68  //- Reset the patch name
69  virtual void rename(const wordList& newNames);
70 
71  //- Reset the patch index
72  virtual void reorder(const labelUList& newToOldIndex);
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("nonConformalError");
79 
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const word& name,
87  const label size,
88  const label start,
89  const label index,
90  const polyBoundaryMesh& bm,
91  const word& patchType
92  );
93 
94  //- Construct from components
96  (
97  const word& name,
98  const label size,
99  const label start,
100  const label index,
101  const polyBoundaryMesh& bm,
102  const word& patchType,
103  const word& origPatchName
104  );
105 
106  //- Construct from dictionary
108  (
109  const word& name,
110  const dictionary& dict,
111  const label index,
112  const polyBoundaryMesh& bm,
113  const word& patchType
114  );
115 
116  //- Construct as copy, resetting the boundary mesh
118  (
120  const polyBoundaryMesh&
121  );
122 
123  //- Construct given the original patch and resetting the
124  // face list and boundary mesh information
126  (
127  const nonConformalErrorPolyPatch& pp,
128  const polyBoundaryMesh& bm,
129  const label index,
130  const label newSize,
131  const label newStart,
132  const word& origPatchName
133  );
134 
135  //- Construct given the original patch and a map
137  (
138  const nonConformalErrorPolyPatch& pp,
139  const polyBoundaryMesh& bm,
140  const label index,
141  const labelUList& mapAddressing,
142  const label newStart
143  );
144 
145  //- Construct and return a clone, resetting the boundary mesh
146  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
147  {
148  return autoPtr<polyPatch>
149  (
150  new nonConformalErrorPolyPatch(*this, bm)
151  );
152  }
153 
154  //- Construct and return a clone, resetting the face list
155  // and boundary mesh
157  (
158  const polyBoundaryMesh& bm,
159  const label index,
160  const label newSize,
161  const label newStart
162  ) const
163  {
164  return autoPtr<polyPatch>
165  (
167  (
168  *this,
169  bm,
170  index,
171  newSize,
172  newStart,
173  origPatchName()
174  )
175  );
176  }
177 
178  //- Construct and return a clone, resetting the face list
179  // and boundary mesh
181  (
182  const polyBoundaryMesh& bm,
183  const label index,
184  const labelUList& mapAddressing,
185  const label newStart
186  ) const
187  {
188  return autoPtr<polyPatch>
189  (
191  (
192  *this,
193  bm,
194  index,
195  mapAddressing,
196  newStart
197  )
198  );
199  }
200 
201 
202  //- Destructor
203  virtual ~nonConformalErrorPolyPatch();
204 
205 
206  // Member Functions
207 
208  //- Write the polyPatch data as a dictionary
209  virtual void write(Ostream&) const;
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & origPatchName() const
Original patch name.
nonConformalErrorPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
A class for handling words, derived from string.
Definition: word.H:59
Non-conformal poly patch. This patch is a placeholder and must have no faces. This patch is linked to...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Non-conformal error poly patch. As nonConformalPolyPatch. This patch is a non-coupled non-conformal p...
autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
virtual void rename(const wordList &newNames)
Reset the patch name.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
TypeName("nonConformalError")
Runtime type information.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Namespace for OpenFOAM.