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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
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::cyclicACMIFvPatch
28 
29 Description
30  Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
31 
32 SourceFiles
33  cyclicACMIFvPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicACMIFvPatch_H
38 #define cyclicACMIFvPatch_H
39 
40 #include "coupledFvPatch.H"
41 #include "cyclicACMILduInterface.H"
42 #include "cyclicACMIPolyPatch.H"
43 #include "fvBoundaryMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class cyclicACMIFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public coupledFvPatch,
58 {
59  // Private data
60 
61  const cyclicACMIPolyPatch& cyclicACMIPolyPatch_;
62 
63 
64 protected:
65 
66  // Protected Member functions
67 
68  //- Helper function to reset the FV patch areas from the primitive patch
69  void resetPatchAreas(const fvPatch& fvp) const;
70 
71  //- Make patch weighting factors
72  void makeWeights(scalarField&) const;
73 
74  //- Correct patches after moving points
75  virtual void movePoints();
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName(cyclicACMIPolyPatch::typeName_());
82 
83 
84  // Constructors
85 
86  //- Construct from polyPatch
88  :
89  coupledFvPatch(patch, bm),
91  cyclicACMIPolyPatch_(refCast<const cyclicACMIPolyPatch>(patch))
92  {}
93 
94 
95  // Member functions
96 
97  // Access
98 
99  //- Return local reference cast into the cyclic patch
100  const cyclicACMIPolyPatch& cyclicACMIPatch() const
101  {
102  return cyclicACMIPolyPatch_;
103  }
104 
105  //- Return neighbour
106  virtual label neighbPatchID() const
107  {
108  return cyclicACMIPolyPatch_.neighbPatchID();
109  }
110 
111  virtual bool owner() const
112  {
113  return cyclicACMIPolyPatch_.owner();
114  }
115 
116  //- Return neighbour fvPatch
117  virtual const cyclicACMIFvPatch& neighbPatch() const
118  {
119  return refCast<const cyclicACMIFvPatch>
120  (
121  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
122  );
123  }
124 
125  //- Return neighbour
126  virtual label nonOverlapPatchID() const
127  {
128  return cyclicACMIPolyPatch_.nonOverlapPatchID();
129  }
130 
131  //- Return non-overlapping fvPatch
132  virtual const fvPatch& nonOverlapPatch() const
133  {
134  return this->boundaryMesh()[nonOverlapPatchID()];
135  }
136 
137  //- Return a reference to the AMI interpolator
138  virtual const AMIPatchToPatchInterpolation& AMI() const
139  {
140  return cyclicACMIPolyPatch_.AMI();
141  }
142 
143  //- Are the cyclic planes parallel
144  virtual bool parallel() const
145  {
146  return cyclicACMIPolyPatch_.parallel();
147  }
148 
149  //- Return face transformation tensor
150  virtual const tensorField& forwardT() const
151  {
152  return cyclicACMIPolyPatch_.forwardT();
153  }
154 
155  //- Return neighbour-cell transformation tensor
156  virtual const tensorField& reverseT() const
157  {
158  return cyclicACMIPolyPatch_.reverseT();
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  //- Interpolate (make sure to have uptodate areas)
178  template<class Type>
180  (
181  const Field<Type>& fld
182  ) const
183  {
184  return
185  cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
186  (
187  fld
188  );
189  }
190 
191  //- Interpolate (make sure to have up-to-date areas)
192  template<class Type>
194  (
195  const tmp<Field<Type>>& tfld
196  ) const
197  {
198  return interpolate(tfld());
199  }
200 
201 
202  // Interface transfer functions
203 
204  //- Return the values of the given internal data adjacent to
205  //- the interface as a field
207  (
208  const labelUList& internalData
209  ) const;
210 
211  //- Return neighbour field
213  (
214  const Pstream::commsTypes commsType,
215  const labelUList& internalData
216  ) const;
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #endif
227 
228 // ************************************************************************* //
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:843
cyclicACMIPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::cyclicACMIFvPatch::owner
virtual bool owner() const
Definition: cyclicACMIFvPatch.H:110
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:296
Foam::cyclicACMILduInterface
An abstract base class for cyclic ACMI coupled interfaces.
Definition: cyclicACMILduInterface.H:51
Foam::cyclicACMIFvPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fld) const
Interpolate (make sure to have uptodate areas)
Definition: cyclicACMIFvPatch.H:179
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:302
Foam::cyclicACMIFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicACMIFvPatch.H:143
Foam::cyclicACMIFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicACMIFvPatch.C:111
Foam::cyclicACMIFvPatch::coupled
virtual bool coupled() const
Definition: cyclicACMIFvPatch.C:105
Foam::cyclicACMIFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicACMIFvPatch.C:165
coupledFvPatch.H
Foam::fvPatch::boundaryMesh
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:199
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:290
Foam::cyclicACMIFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIFvPatch.H:149
Foam::Field< scalar >
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:67
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::cyclicACMIFvPatch::neighbPatch
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
Definition: cyclicACMIFvPatch.H:116
Foam::cyclicACMIFvPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:125
Foam::cyclicACMIFvPatch::TypeName
TypeName(cyclicACMIPolyPatch::typeName_())
Runtime type information.
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::cyclicACMIFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:105
Foam::cyclicACMIFvPatch::movePoints
virtual void movePoints()
Correct patches after moving points.
Definition: cyclicACMIFvPatch.C:174
Foam::cyclicACMIFvPatch::nonOverlapPatch
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
Definition: cyclicACMIFvPatch.H:131
fvBoundaryMesh.H
Foam::cyclicACMIPolyPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
Definition: cyclicACMIPolyPatch.C:488
Foam::cyclicAMIPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patch ID.
Definition: cyclicAMIPolyPatch.C:807
Foam::cyclicACMIFvPatch::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicACMIFvPatch.H:137
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::cyclicACMIFvPatch::cyclicACMIFvPatch
cyclicACMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicACMIFvPatch.H:86
cyclicACMILduInterface.H
Foam::cyclicAMIPolyPatch::AMI
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIPolyPatch.C:856
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:66
Foam::cyclicACMIFvPatch::resetPatchAreas
void resetPatchAreas(const fvPatch &fvp) const
Helper function to reset the FV patch areas from the primitive patch.
Definition: cyclicACMIFvPatch.C:46
Foam::cyclicACMIFvPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicACMIFvPatch.H:99
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:79
Foam::UList< label >
Foam::cyclicACMIFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: cyclicACMIFvPatch.C:156
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:157
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::cyclicACMIPolyPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIPolyPatch.H:54
Foam::cyclicACMIFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicACMIFvPatch.C:57
Foam::cyclicACMIFvPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIFvPatch.H:53