All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cyclicRepeatAMIPolyPatch.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) 2018-2020 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::cyclicRepeatAMIPolyPatch
26 
27 Description
28  Repeat patch for Arbitrary Mesh Interface (AMI)
29 
30 SourceFiles
31  cyclicRepeatAMIPolyPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicRepeatAMIPolyPatch_H
36 #define cyclicRepeatAMIPolyPatch_H
37 
38 #include "cyclicAMIPolyPatch.H"
39 #include "AMIInterpolation.H"
40 #include "polyBoundaryMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cyclicRepeatAMIPolyPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public cyclicAMIPolyPatch
54 {
55 protected:
56 
57  // Protected data
58 
59  //- Name of the transform patch
60  mutable word transformPatchName_;
61 
62  //- Index of the transform patch
63  mutable label transformPatchID_;
64 
65 
66  // Protected Member Functions
67 
68  //- Reset the AMI interpolator
69  virtual void resetAMI() const;
70 
71  //- Calculate the patch geometry
72  virtual void calcGeometry(PstreamBuffers&);
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("cyclicRepeatAMI");
79 
80 
81  // Constructors
82 
83  //- Construct from (base couped patch) 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 dictionary
96  (
97  const word& name,
98  const dictionary& dict,
99  const label index,
100  const polyBoundaryMesh& bm,
101  const word& patchType
102  );
103 
104  //- Construct as copy, resetting the boundary mesh
106  (
108  const polyBoundaryMesh&
109  );
110 
111  //- Construct given the original patch and resetting the
112  // face list and boundary mesh information
114  (
115  const cyclicRepeatAMIPolyPatch& pp,
116  const polyBoundaryMesh& bm,
117  const label index,
118  const label newSize,
119  const label newStart,
120  const word& nbrPatchName
121  );
122 
123  //- Construct given the original patch and a map
125  (
126  const cyclicRepeatAMIPolyPatch& pp,
127  const polyBoundaryMesh& bm,
128  const label index,
129  const labelUList& mapAddressing,
130  const label newStart
131  );
132 
133 
134  //- Construct and return a clone, resetting the boundary mesh
135  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
136  {
137  return autoPtr<polyPatch>(new cyclicRepeatAMIPolyPatch(*this, bm));
138  }
139 
140  //- Construct and return a clone, resetting the face list
141  // and boundary mesh
143  (
144  const polyBoundaryMesh& bm,
145  const label index,
146  const label newSize,
147  const label newStart
148  ) const
149  {
150  return autoPtr<polyPatch>
151  (
153  (
154  *this,
155  bm,
156  index,
157  newSize,
158  newStart,
160  )
161  );
162  }
163 
164  //- Construct and return a clone, resetting the face list
165  // and boundary mesh
167  (
168  const polyBoundaryMesh& bm,
169  const label index,
170  const labelUList& mapAddressing,
171  const label newStart
172  ) const
173  {
174  return autoPtr<polyPatch>
175  (
177  (
178  *this,
179  bm,
180  index,
181  mapAddressing,
182  newStart
183  )
184  );
185  }
186 
187 
188  //- Destructor
189  virtual ~cyclicRepeatAMIPolyPatch();
190 
191 
192  // Member Functions
193 
194  // Access
195 
196  //- Return a reference to the neighbour patch
197  virtual const cyclicRepeatAMIPolyPatch& nbrPatch() const;
198 
199  //- Neighbour patch name
200  inline const word& transformPatchName() const;
201 
202  //- Neighbour patch ID
203  virtual label transformPatchID() const;
204 
205  //- Return a reference to the transform patch
206  virtual const coupledPolyPatch& transformPatch() const;
207 
208  //- Return the weights sum for this patch
209  virtual const scalarField& weightsSum() const;
210 
211  //- Return the weights sum for the neighbour patch
212  virtual const scalarField& nbrWeightsSum() const;
213 
214 
215  //- Write the polyPatch data as a dictionary
216  virtual void write(Ostream&) const;
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
dictionary dict
virtual void resetAMI() const
Reset the AMI interpolator.
virtual ~cyclicRepeatAMIPolyPatch()
Destructor.
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
const word & name() const
Return name.
virtual const scalarField & weightsSum() const
Return the weights sum for this patch.
const word & transformPatchName() const
Neighbour patch name.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual const scalarField & nbrWeightsSum() const
Return the weights sum for the neighbour patch.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
virtual label transformPatchID() const
Neighbour patch ID.
Repeat patch for Arbitrary Mesh Interface (AMI)
virtual const cyclicRepeatAMIPolyPatch & nbrPatch() const
Return a reference to the neighbour patch.
A class for handling words, derived from string.
Definition: word.H:59
label transformPatchID_
Index of the transform patch.
word transformPatchName_
Name of the transform patch.
Cyclic patch for Arbitrary Mesh Interface (AMI)
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
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
cyclicRepeatAMIPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from (base couped patch) components.
const word & nbrPatchName() const
Neighbour patch name.
label index() const
Return the index of this patch in the boundaryMesh.
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:303
TypeName("cyclicRepeatAMI")
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
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
word nbrPatchName_
Name of cyclic neighbour patch.
Namespace for OpenFOAM.
virtual const coupledPolyPatch & transformPatch() const
Return a reference to the transform patch.