cyclicACMIFvPatch.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 | Copyright (C) 2013 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::cyclicACMIFvPatch
26 
27 Description
28  Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
29 
30 SourceFiles
31  cyclicACMIFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicACMIFvPatch_H
36 #define cyclicACMIFvPatch_H
37 
38 #include "coupledFvPatch.H"
39 #include "cyclicACMILduInterface.H"
40 #include "cyclicACMIPolyPatch.H"
41 #include "fvBoundaryMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cyclicACMIFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public coupledFvPatch,
56 {
57  // Private data
58 
60 
61 
62 protected:
63 
64  // Protected Member functions
65 
66  //- Update the patch areas after AMI update
67  void updateAreas() const;
68 
69  //- Make patch weighting factors
70  void makeWeights(scalarField&) const;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName(cyclicACMIPolyPatch::typeName_());
77 
78 
79  // Constructors
80 
81  //- Construct from polyPatch
83  :
84  coupledFvPatch(patch, bm),
87  {}
88 
89 
90  // Member functions
91 
92  // Access
93 
94  //- Return local reference cast into the cyclic patch
96  {
97  return cyclicACMIPolyPatch_;
98  }
99 
100  //- Return neighbour
101  virtual label neighbPatchID() const
102  {
104  }
105 
106  virtual bool owner() const
107  {
108  return cyclicACMIPolyPatch_.owner();
109  }
110 
111  //- Return neighbour fvPatch
112  virtual const cyclicACMIFvPatch& neighbPatch() const
113  {
114  return refCast<const cyclicACMIFvPatch>
115  (
116  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
117  );
118  }
119 
120  //- Return neighbour
121  virtual label nonOverlapPatchID() const
122  {
124  }
125 
126  //- Return non-overlapping fvPatch
127  virtual const fvPatch& nonOverlapPatch() const
128  {
129  return this->boundaryMesh()[nonOverlapPatchID()];
130  }
131 
132  //- Return a reference to the AMI interpolator
133  virtual const AMIPatchToPatchInterpolation& AMI() const
134  {
137 
138  updateAreas();
139 
140  return AMI;
141  }
142 
143  //- Are the cyclic planes parallel
144  virtual bool parallel() const
145  {
147  }
148 
149  //- Return face transformation tensor
150  virtual const tensorField& forwardT() const
151  {
153  }
154 
155  //- Return neighbour-cell transformation tensor
156  virtual const tensorField& reverseT() const
157  {
159  }
160 
161  const cyclicACMIFvPatch& neighbFvPatch() const
162  {
163  return refCast<const cyclicACMIFvPatch>
164  (
165  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
166  );
167  }
168 
169  //- Return true if this patch is coupled. This is equivalent
170  // to the coupledPolyPatch::coupled() if parallel running or
171  // both sides present, false otherwise
172  virtual bool coupled() const;
173 
174  //- Return delta (P to N) vectors across coupled patch
175  virtual tmp<vectorField> delta() const;
176 
177  template<class Type>
179  (
180  const Field<Type>& fldCoupled
181  ) const
182  {
183  updateAreas();
184 
185  return
186  cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
187  (
188  fldCoupled
189  );
190  }
191 
192  template<class Type>
194  (
195  const tmp<Field<Type> >& tfldCoupled
196  ) const
197  {
198  updateAreas();
199 
200  return
201  cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
202  (
203  tfldCoupled
204  );
205  }
206 
207  template<class Type>
209  (
210  const Field<Type>& fldCoupled,
211  const Field<Type>& fldNonOverlap
212  ) const
213  {
214  updateAreas();
215 
216  return
218  (
219  fldCoupled,
220  fldNonOverlap
221  );
222  }
223 
224  template<class Type>
226  (
227  const tmp<Field<Type> >& tFldCoupled,
228  const tmp<Field<Type> >& tFldNonOverlap
229  ) const
230  {
231  updateAreas();
232 
233  return
235  (
236  tFldCoupled,
237  tFldNonOverlap
238  );
239  }
240 
241 
242  // Interface transfer functions
243 
244  //- Return the values of the given internal data adjacent to
245  // the interface as a field
247  (
248  const labelUList& internalData
249  ) const;
250 
251  //- Return neighbour field
253  (
254  const Pstream::commsTypes commsType,
255  const labelUList& internalData
256  ) const;
257 };
258 
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 } // End namespace Foam
263 
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 
266 #endif
267 
268 // ************************************************************************* //
Foam::cyclicACMIFvPatch::updateAreas
void updateAreas() const
Update the patch areas after AMI update.
Definition: cyclicACMIFvPatch.C:42
Foam::cyclicACMIFvPatch::neighbFvPatch
const cyclicACMIFvPatch & neighbFvPatch() const
Definition: cyclicACMIFvPatch.H:160
Foam::cyclicAMIPolyPatch::owner
virtual bool owner() const
Does this side own the patch?
Definition: cyclicAMIPolyPatch.C:738
cyclicACMIPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::cyclicACMIFvPatch::owner
virtual bool owner() const
Definition: cyclicACMIFvPatch.H:105
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:294
Foam::cyclicACMILduInterface
An abstract base class for cyclic ACMI coupled interfaces.
Definition: cyclicACMILduInterface.H:48
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:300
Foam::cyclicACMIFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicACMIFvPatch.H:143
Foam::cyclicACMIPolyPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fldCouple, const Field< Type > &fldNonOverlap) const
Interpolate field.
Foam::cyclicACMIFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicACMIFvPatch.C:121
Foam::cyclicACMIFvPatch::coupled
virtual bool coupled() const
Return true if this patch is coupled. This is equivalent.
Definition: cyclicACMIFvPatch.C:115
Foam::cyclicACMIFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicACMIFvPatch.C:194
coupledFvPatch.H
Foam::fvPatch::boundaryMesh
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:185
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:52
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:288
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:59
Foam::cyclicACMIFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIFvPatch.H:149
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::cyclicACMIFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIFvPatch.H:155
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::cyclicACMIFvPatch::neighbPatch
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
Definition: cyclicACMIFvPatch.H:111
Foam::cyclicACMIFvPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:120
Foam::cyclicACMIFvPatch::TypeName
TypeName(cyclicACMIPolyPatch::typeName_())
Runtime type information.
Foam::cyclicACMIFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:100
Foam::cyclicACMIFvPatch::nonOverlapPatch
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
Definition: cyclicACMIFvPatch.H:126
fvBoundaryMesh.H
Foam::cyclicACMIPolyPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
Definition: cyclicACMIPolyPatch.C:372
Foam::cyclicAMIPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patch ID.
Definition: cyclicAMIPolyPatch.C:702
Foam::cyclicACMIFvPatch::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicACMIFvPatch.H:132
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cyclicACMIFvPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fldCoupled) const
Definition: cyclicACMIFvPatch.H:178
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Foam::cyclicACMIFvPatch::cyclicACMIFvPatch
cyclicACMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicACMIFvPatch.H:81
cyclicACMILduInterface.H
Foam::cyclicAMIPolyPatch::AMI
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIPolyPatch.C:783
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::cyclicACMIFvPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicACMIFvPatch.H:94
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:77
Foam::UList
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::cyclicACMIFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicACMIFvPatch.C:185
Foam::cyclicACMIFvPatch::cyclicACMIPolyPatch_
const cyclicACMIPolyPatch & cyclicACMIPolyPatch_
Definition: cyclicACMIFvPatch.H:58
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:51
Foam::cyclicACMIPolyPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIPolyPatch.H:50
Foam::cyclicACMIFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicACMIFvPatch.C:79
Foam::cyclicACMIFvPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIFvPatch.H:51