cyclicPeriodicAMIPolyPatch.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) 2015 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::cyclicPeriodicAMIPolyPatch
28 
29 Description
30  Cyclic patch for periodic Arbitrary Mesh Interface (AMI)
31 
32 SourceFiles
33  cyclicPeriodicAMIPolyPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicPeriodicAMIPolyPatch_H
38 #define cyclicPeriodicAMIPolyPatch_H
39 
40 #include "cyclicAMIPolyPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class OBJstream;
48 
49 /*---------------------------------------------------------------------------*\
50  Class cyclicPeriodicAMIPolyPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public cyclicAMIPolyPatch
56 {
57 private:
58 
59  // Private data
60 
61  //- Periodic patch name
62  mutable word periodicPatchName_;
63 
64  //- Periodic patch ID
65  mutable label periodicPatchID_;
66 
67  //- Current number of transformations (+ve forward, -ve backward)
68  mutable label nTransforms_;
69 
70  //- Number of sectors in a rotationally periodic geometry (optional)
71  const label nSectors_;
72 
73  //- Maximum number of attempts to match the AMI geometry
74  const label maxIter_;
75 
76 
77  // Private Member Functions
78 
79  //- Synchronise the periodic transformations
80  void syncTransforms() const;
81 
82  //- Debug: write obj files of patch (collected on master)
83  void writeOBJ(const primitivePatch& p, OBJstream& str) const;
84 
85  //- Reset the AMI interpolator
86  virtual void resetAMI
87  (
90  ) const;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("cyclicPeriodicAMI");
97 
98 
99  // Constructors
100 
101  //- Construct from (base coupled patch) components
103  (
104  const word& name,
105  const label size,
106  const label start,
107  const label index,
108  const polyBoundaryMesh& bm,
109  const word& patchType,
111  );
112 
113  //- Construct from dictionary
115  (
116  const word& name,
117  const dictionary& dict,
118  const label index,
119  const polyBoundaryMesh& bm,
120  const word& patchType
121  );
122 
123  //- Construct as copy, resetting the boundary mesh
125  (
127  const polyBoundaryMesh&
128  );
129 
130  //- Construct given the original patch and resetting the
131  // face list and boundary mesh information
133  (
134  const cyclicPeriodicAMIPolyPatch& pp,
135  const polyBoundaryMesh& bm,
136  const label index,
137  const label newSize,
138  const label newStart,
139  const word& nbrPatchName
140  );
141 
142  //- Construct given the original patch and a map
144  (
145  const cyclicPeriodicAMIPolyPatch& pp,
146  const polyBoundaryMesh& bm,
147  const label index,
148  const labelUList& mapAddressing,
149  const label newStart
150  );
151 
152 
153  //- Construct and return a clone, resetting the boundary mesh
154  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
155  {
156  return autoPtr<polyPatch>
157  (
158  new cyclicPeriodicAMIPolyPatch(*this, bm)
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 label newSize,
169  const label newStart
170  ) const
171  {
172  return autoPtr<polyPatch>
173  (
175  (
176  *this,
177  bm,
178  index,
179  newSize,
180  newStart,
182  )
183  );
184  }
185 
186  //- Construct and return a clone, resetting the face list
187  // and boundary mesh
189  (
190  const polyBoundaryMesh& bm,
191  const label index,
192  const labelUList& mapAddressing,
193  const label newStart
194  ) const
195  {
196  return autoPtr<polyPatch>
197  (
199  (
200  *this,
201  bm,
202  index,
203  mapAddressing,
204  newStart
205  )
206  );
207  }
208 
209 
210  //- Destructor
211  virtual ~cyclicPeriodicAMIPolyPatch();
212 
213 
214  // Member Functions
215 
216  //- Periodic patch ID
217  virtual label periodicPatchID() const;
218 
219  //- Write the polyPatch data as a dictionary
220  virtual void write(Ostream&) const;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
Foam::AMIInterpolation::interpolationMethod
interpolationMethod
Enumeration specifying interpolation method.
Definition: AMIInterpolation.H:90
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::OBJstream
OFstream that keeps track of vertices.
Definition: OBJstream.H:56
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:62
Foam::cyclicAMIPolyPatch::nbrPatchName_
word nbrPatchName_
Name of other half.
Definition: cyclicAMIPolyPatch.H:77
Foam::AMIInterpolation::imFaceAreaWeight
Definition: AMIInterpolation.H:94
Foam::cyclicPeriodicAMIPolyPatch::~cyclicPeriodicAMIPolyPatch
virtual ~cyclicPeriodicAMIPolyPatch()
Destructor.
Definition: cyclicPeriodicAMIPolyPatch.C:676
Foam::AMIMethod
Base class for Arbitrary Mesh Interface (AMI) methods.
Definition: AMIMethod.H:60
Foam::label
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:62
Foam::coupledPolyPatch::UNKNOWN
Definition: coupledPolyPatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cyclicPeriodicAMIPolyPatch::periodicPatchID
virtual label periodicPatchID() const
Periodic patch ID.
Definition: cyclicPeriodicAMIPolyPatch.C:682
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:311
Foam::coupledPolyPatch::transform
virtual transformType transform() const
Type of transform.
Definition: coupledPolyPatch.H:258
cyclicAMIPolyPatch.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cyclicPeriodicAMIPolyPatch::clone
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Definition: cyclicPeriodicAMIPolyPatch.H:153
Foam::cyclicPeriodicAMIPolyPatch::cyclicPeriodicAMIPolyPatch
cyclicPeriodicAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform=UNKNOWN)
Construct from (base coupled patch) components.
Definition: cyclicPeriodicAMIPolyPatch.C:585
Foam::cyclicPeriodicAMIPolyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: cyclicPeriodicAMIPolyPatch.C:715
Foam::UList< label >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::cyclicPeriodicAMIPolyPatch::TypeName
TypeName("cyclicPeriodicAMI")
Runtime type information.
Foam::coupledPolyPatch::transformType
transformType
Definition: coupledPolyPatch.H:59
Foam::cyclicPeriodicAMIPolyPatch
Cyclic patch for periodic Arbitrary Mesh Interface (AMI)
Definition: cyclicPeriodicAMIPolyPatch.H:52
Foam::patchIdentifier::name
const word & name() const
Return the patch name.
Definition: patchIdentifier.H:109
Foam::patchIdentifier::index
label index() const
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:133
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:90
Foam::cyclicAMIPolyPatch
Cyclic patch for Arbitrary Mesh Interface (AMI)
Definition: cyclicAMIPolyPatch.H:53