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 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"
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 
72 public:
73 
74  //- Runtime type information
75  TypeName("cyclicRepeatAMI");
76 
77 
78  // Constructors
79 
80  //- Construct from (base couped patch) components
82  (
83  const word& name,
84  const label size,
85  const label start,
86  const label index,
87  const polyBoundaryMesh& bm,
88  const word& patchType,
90  );
91 
92  //- Construct from dictionary
94  (
95  const word& name,
96  const dictionary& dict,
97  const label index,
98  const polyBoundaryMesh& bm,
99  const word& patchType
100  );
101 
102  //- Construct as copy, resetting the boundary mesh
104  (
106  const polyBoundaryMesh&
107  );
108 
109  //- Construct given the original patch and resetting the
110  // face list and boundary mesh information
112  (
113  const cyclicRepeatAMIPolyPatch& pp,
114  const polyBoundaryMesh& bm,
115  const label index,
116  const label newSize,
117  const label newStart,
118  const word& nbrPatchName
119  );
120 
121  //- Construct given the original patch and a map
123  (
124  const cyclicRepeatAMIPolyPatch& pp,
125  const polyBoundaryMesh& bm,
126  const label index,
127  const labelUList& mapAddressing,
128  const label newStart
129  );
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>(new cyclicRepeatAMIPolyPatch(*this, bm));
136  }
137 
138  //- Construct and return a clone, resetting the face list
139  // and boundary mesh
141  (
142  const polyBoundaryMesh& bm,
143  const label index,
144  const label newSize,
145  const label newStart
146  ) const
147  {
148  return autoPtr<polyPatch>
149  (
151  (
152  *this,
153  bm,
154  index,
155  newSize,
156  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
187  virtual ~cyclicRepeatAMIPolyPatch();
188 
189 
190  // Member Functions
191 
192  // Access
193 
194  //- Return a reference to the neighbour patch
195  virtual const cyclicRepeatAMIPolyPatch& neighbPatch() const;
196 
197  //- Neighbour patch name
198  inline const word& transformPatchName() const;
199 
200  //- Neighbour patch ID
201  virtual label transformPatchID() const;
202 
203  //- Return a reference to the transform patch
204  virtual const coupledPolyPatch& transformPatch() const;
205 
206  //- Return the weights sum for this patch
207  virtual const scalarField& weightsSum() const;
208 
209  //- Return the weights sum for the neighbour patch
210  virtual const scalarField& neighbWeightsSum() const;
211 
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 
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
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:137
virtual const cyclicRepeatAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual label transformPatchID() const
Neighbour patch ID.
Repeat patch for Arbitrary Mesh Interface (AMI)
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:61
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
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:300
TypeName("cyclicRepeatAMI")
Runtime type information.
virtual transformType transform() const
Type of transform.
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 autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
word nbrPatchName_
Name of other half.
virtual const scalarField & neighbWeightsSum() const
Return the weights sum for the neighbour patch.
cyclicRepeatAMIPolyPatch(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 couped patch) components.
Namespace for OpenFOAM.
virtual const coupledPolyPatch & transformPatch() const
Return a reference to the transform patch.