nonConformalProcessorCyclicPolyPatch.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) 2011-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::nonConformalProcessorCyclicPolyPatch
26 
27 Description
28  Non-conformal processor cyclic poly patch. As nonConformalCyclicPolyPatch,
29  but the neighbouring patch is on a different processor.
30 
31 See also
32  Foam::nonConformalCyclicPatch
33 
34 SourceFiles
35  nonConformalProcessorCyclicPolyPatch.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef nonConformalProcessorCyclicPolyPatch_H
40 #define nonConformalProcessorCyclicPolyPatch_H
41 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class nonConformalProcessorCyclicPolyPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
58 {
59 protected:
60 
61  // Protected Member Functions
62 
63  //- Reset the patch name
64  virtual void rename(const wordList& newNames);
65 
66  //- Reset the patch index
67  virtual void reorder(const labelUList& newToOldIndex);
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("nonConformalProcessorCyclic");
74 
75 
76  // Constructors
77 
78  //- Construct from components
80  (
81  const label size,
82  const label start,
83  const label index,
84  const polyBoundaryMesh& bm,
85  const int myProcNo,
86  const int neighbProcNo,
87  const word& referPatchName,
88  const word& origPatchName,
89  const word& patchType = typeName
90  );
91 
92  //- Construct from dictionary
94  (
95  const word& name,
96  const dictionary& dict,
97  const label index,
98  const polyBoundaryMesh&,
99  const word& patchType
100  );
101 
102  //- Construct as copy, resetting the boundary mesh
104  (
106  const polyBoundaryMesh&
107  );
108 
109  //- Construct as given the original patch and resetting the
110  // face list and boundary mesh information
112  (
114  const polyBoundaryMesh& bm,
115  const label index,
116  const label newSize,
117  const label newStart
118  );
119 
120  //- Construct given the original patch and a map
122  (
124  const polyBoundaryMesh& bm,
125  const label index,
126  const labelUList& mapAddressing,
127  const label newStart
128  );
129 
130  //- Construct and return a clone, resetting the boundary mesh
131  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
132  {
133  return autoPtr<polyPatch>
134  (
136  );
137  }
138 
139  //- Construct and return a clone, resetting the face list
140  // and boundary mesh
142  (
143  const polyBoundaryMesh& bm,
144  const label index,
145  const label newSize,
146  const label newStart
147  ) const
148  {
149  return autoPtr<polyPatch>
150  (
152  (
153  *this,
154  bm,
155  index,
156  newSize,
157  newStart
158  )
159  );
160  }
161 
162  //- Construct and return a clone, resetting the face list
163  // and boundary mesh
165  (
166  const polyBoundaryMesh& bm,
167  const label index,
168  const labelUList& mapAddressing,
169  const label newStart
170  ) const
171  {
172  return autoPtr<polyPatch>
173  (
175  (
176  *this,
177  bm,
178  index,
179  mapAddressing,
180  newStart
181  )
182  );
183  }
184 
185 
186  // Destructor
188 
189 
190  // Member Functions
191 
192  //- Get the referred patch
194  {
195  const polyPatch& pp = this->boundaryMesh()[referPatchID()];
196  return refCast<const nonConformalCyclicPolyPatch>(pp);
197  }
198 
199  //- Inherit the processor cyclic owner method
201 
202  //- Inherit the processor cyclic neighbour method
204 
205  //- Inherit the processor cyclic transform method
207 
208  //- Is this patch coupled? Returns false. For NCC patches the poly
209  // mesh is considered non-coupled whilst the finite volume mesh is
210  // considered coupled.
211  virtual bool coupled() const;
212 
213  //- Write the polyPatch data as a dictionary
214  virtual void write(Ostream&) const;
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
label referPatchID() const
Return the referring patchID.
virtual bool owner() const
Does this side own the patch ?
Non-conformal coupled poly patch. As nonConformalPolyPatch, but this patch is coupled to another non-...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: polyPatch.C:297
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
const nonConformalCyclicPolyPatch & referPatch() const
Get the referred patch.
TypeName("nonConformalProcessorCyclic")
Runtime type information.
Non-conformal processor cyclic poly patch. As nonConformalCyclicPolyPatch, but the neighbouring patch...
virtual bool coupled() const
Is this patch coupled? Returns false. For NCC patches the poly.
A class for handling words, derived from string.
Definition: word.H:59
virtual void reorder(const labelUList &newToOldIndex)
Reset the patch index.
Non-conformal cyclic poly patch. As nonConformalCoupledPolyPatch, but the neighbouring patch is local...
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.
bool neighbour() const
Is the processor the patch neighbour ?
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
nonConformalProcessorCyclicPolyPatch(const label size, const label start, const label index, const polyBoundaryMesh &bm, const int myProcNo, const int neighbProcNo, const word &referPatchName, const word &origPatchName, const word &patchType=typeName)
Construct from components.
autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
virtual void rename(const wordList &newNames)
Reset the patch name.
virtual const transformer & transform() const
Return transformation between the coupled patches.
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
Namespace for OpenFOAM.