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-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::cyclicPeriodicAMIPolyPatch
28
29Description
30 Cyclic patch for periodic Arbitrary Mesh Interface (AMI)
31
32SourceFiles
33 cyclicPeriodicAMIPolyPatch.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef cyclicPeriodicAMIPolyPatch_H
38#define cyclicPeriodicAMIPolyPatch_H
39
40#include "cyclicAMIPolyPatch.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47class OBJstream;
48
49/*---------------------------------------------------------------------------*\
50 Class cyclicPeriodicAMIPolyPatch Declaration
51\*---------------------------------------------------------------------------*/
54:
56{
57private:
58
59 // Private data
60
61 //- Current number of transformations (+ve forward, -ve backward)
62 mutable label nTransforms_;
63
64 //- Number of sectors in a rotationally periodic geometry (optional)
65 const label nSectors_;
66
67 //- Maximum number of attempts to match the AMI geometry
68 const label maxIter_;
69
70
71 // Private Member Functions
72
73 //- Synchronise the periodic transformations
74 void syncTransforms() const;
75
76 //- Debug: write obj files of patch (collected on master)
77 void writeOBJ(const primitivePatch& p, OBJstream& str) const;
78
79 //- Reset the AMI interpolator
80 virtual void resetAMI() const;
81
82
83public:
84
85 //- Runtime type information
86 TypeName("cyclicPeriodicAMI");
87
88
89 // Constructors
90
91 //- Construct from (base coupled patch) components
93 (
94 const word& name,
95 const label size,
96 const label start,
97 const label index,
98 const polyBoundaryMesh& bm,
99 const word& patchType,
101 );
102
103 //- Construct from dictionary
105 (
106 const word& name,
107 const dictionary& dict,
108 const label index,
109 const polyBoundaryMesh& bm,
110 const word& patchType
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 (
125 const polyBoundaryMesh& bm,
126 const label index,
127 const label newSize,
128 const label newStart,
129 const word& nbrPatchName
130 );
131
132 //- Construct given the original patch and a map
134 (
136 const polyBoundaryMesh& bm,
137 const label index,
138 const labelUList& mapAddressing,
139 const label newStart
140 );
141
142
143 //- Construct and return a clone, resetting the boundary mesh
144 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
145 {
146 return autoPtr<polyPatch>
147 (
148 new cyclicPeriodicAMIPolyPatch(*this, bm)
149 );
150 }
151
152 //- Construct and return a clone, resetting the face list
153 // and boundary mesh
155 (
156 const polyBoundaryMesh& bm,
157 const label index,
158 const label newSize,
159 const label newStart
160 ) const
161 {
162 return autoPtr<polyPatch>
163 (
165 (
166 *this,
167 bm,
168 index,
169 newSize,
170 newStart,
172 )
173 );
174 }
175
176 //- Construct and return a clone, resetting the face list
177 // and boundary mesh
179 (
180 const polyBoundaryMesh& bm,
181 const label index,
182 const labelUList& mapAddressing,
183 const label newStart
184 ) const
185 {
186 return autoPtr<polyPatch>
187 (
189 (
190 *this,
191 bm,
192 index,
193 mapAddressing,
194 newStart
195 )
196 );
197 }
198
199
200 //- Destructor
202
203
204 // Member Functions
205
206 //- Write the polyPatch data as a dictionary
207 virtual void write(Ostream&) const;
208};
209
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213} // End namespace Foam
214
215// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#endif
221
222// ************************************************************************* //
OFstream that keeps track of vertices.
Definition: OBJstream.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of faces which address into the list of points.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
virtual transformType transform() const
Type of transform.
Cyclic patch for Arbitrary Mesh Interface (AMI)
word nbrPatchName_
Name of other half.
Cyclic patch for periodic Arbitrary Mesh Interface (AMI)
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
TypeName("cyclicPeriodicAMI")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:364
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
UList< label > labelUList
A UList of labels.
Definition: UList.H:85
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73