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-2026 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  );
92 
93  //- Construct from components
95  (
96  const word& name,
97  const label size,
98  const label start,
99  const label index,
100  const polyBoundaryMesh& bm,
101  const word& origPatchName
102  );
103 
104  //- Construct from dictionary
106  (
107  const word& name,
108  const dictionary& dict,
109  const label index,
110  const polyBoundaryMesh& bm
111  );
112 
113  //- Construct as copy, resetting the boundary mesh
115  (
117  const polyBoundaryMesh&
118  );
119 
120  //- Construct given the original patch and resetting the
121  // face list and boundary mesh information
123  (
124  const nonConformalErrorPolyPatch& pp,
125  const polyBoundaryMesh& bm,
126  const label index,
127  const label newSize,
128  const label newStart,
129  const word& origPatchName
130  );
131 
132  //- Construct and return a clone, resetting the boundary mesh
133  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
134  {
135  return autoPtr<polyPatch>
136  (
137  new nonConformalErrorPolyPatch(*this, bm)
138  );
139  }
140 
141  //- Construct and return a clone, resetting the face list
142  // and boundary mesh
143  virtual autoPtr<polyPatch> clone
144  (
145  const polyBoundaryMesh& bm,
146  const label index,
147  const label newSize,
148  const label newStart
149  ) const
150  {
151  return autoPtr<polyPatch>
152  (
154  (
155  *this,
156  bm,
157  index,
158  newSize,
159  newStart,
160  origPatchName()
161  )
162  );
163  }
164 
165 
166  //- Destructor
167  virtual ~nonConformalErrorPolyPatch();
168 
169 
170  // Member Functions
171 
172  //- Return true as this patch is a constraint type
173  virtual bool constraint() const
174  {
175  return true;
176  }
177 
178  //- Write the polyPatch data as a dictionary
179  virtual void write(Ostream&) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
autoPtr< PrimitivePatch< SubList< face >, const pointField & > > clone() const
Construct and return a clone.
label size() const
Return the number of elements in the UList.
Definition: UListI.H:311
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Non-conformal error poly patch. As nonConformalPolyPatch. This patch is a non-coupled non-conformal p...
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void rename(const wordList &newNames)
Reset the patch name.
nonConformalErrorPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Construct from components.
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
virtual bool constraint() const
Return true as this patch is a constraint type.
TypeName("nonConformalError")
Runtime type information.
Non-conformal poly patch. This patch is a placeholder and must have no faces. This patch is linked to...
const word & origPatchName() const
Original patch name.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
Foam::polyBoundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:277
A class for handling words, derived from string.
Definition: word.H:63
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