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  //- Update the patch areas after AMI update
69  void updateAreas() const;
70 
71  //- Make patch weighting factors
72  void makeWeights(scalarField&) const;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName(cyclicACMIPolyPatch::typeName_());
79 
80 
81  // Constructors
82 
83  //- Construct from polyPatch
85  :
86  coupledFvPatch(patch, bm),
88  cyclicACMIPolyPatch_(refCast<const cyclicACMIPolyPatch>(patch))
89  {}
90 
91 
92  // Member functions
93 
94  // Access
95 
96  //- Return local reference cast into the cyclic patch
98  {
99  return cyclicACMIPolyPatch_;
100  }
101 
102  //- Return neighbour
103  virtual label neighbPatchID() const
104  {
105  return cyclicACMIPolyPatch_.neighbPatchID();
106  }
107 
108  virtual bool owner() const
109  {
110  return cyclicACMIPolyPatch_.owner();
111  }
112 
113  //- Return neighbour fvPatch
114  virtual const cyclicACMIFvPatch& neighbPatch() const
115  {
116  return refCast<const cyclicACMIFvPatch>
117  (
118  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
119  );
120  }
121 
122  //- Return neighbour
123  virtual label nonOverlapPatchID() const
124  {
125  return cyclicACMIPolyPatch_.nonOverlapPatchID();
126  }
127 
128  //- Return non-overlapping fvPatch
129  virtual const fvPatch& nonOverlapPatch() const
130  {
131  return this->boundaryMesh()[nonOverlapPatchID()];
132  }
133 
134  //- Return a reference to the AMI interpolator
135  virtual const AMIPatchToPatchInterpolation& AMI() const
136  {
138  cyclicACMIPolyPatch_.AMI();
139 
140  updateAreas();
141 
142  return AMI;
143  }
144 
145  //- Are the cyclic planes parallel
146  virtual bool parallel() const
147  {
148  return cyclicACMIPolyPatch_.parallel();
149  }
150 
151  //- Return face transformation tensor
152  virtual const tensorField& forwardT() const
153  {
154  return cyclicACMIPolyPatch_.forwardT();
155  }
156 
157  //- Return neighbour-cell transformation tensor
158  virtual const tensorField& reverseT() const
159  {
160  return cyclicACMIPolyPatch_.reverseT();
161  }
162 
163  const cyclicACMIFvPatch& neighbFvPatch() const
164  {
165  return refCast<const cyclicACMIFvPatch>
166  (
167  this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
168  );
169  }
170 
171  //- Return true if this patch is coupled. This is equivalent
172  // to the coupledPolyPatch::coupled() if parallel running or
173  // both sides present, false otherwise
174  virtual bool coupled() const;
175 
176  //- Return delta (P to N) vectors across coupled patch
177  virtual tmp<vectorField> delta() const;
178 
179  //- Interpolate (make sure to have uptodate areas)
180  template<class Type>
182  (
183  const Field<Type>& fld
184  ) const
185  {
186  updateAreas();
187 
188  return
189  cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
190  (
191  fld
192  );
193  }
194 
195  //- Interpolate (make sure to have uptodate areas)
196  template<class Type>
198  (
199  const tmp<Field<Type>>& tfld
200  ) const
201  {
202  return interpolate(tfld());
203  }
204 
205 
206  // Interface transfer functions
207 
208  //- Return the values of the given internal data adjacent to
209  // the interface as a field
211  (
212  const labelUList& internalData
213  ) const;
214 
215  //- Return neighbour field
217  (
218  const Pstream::commsTypes commsType,
219  const labelUList& internalData
220  ) const;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
Foam::cyclicACMIFvPatch::updateAreas
void updateAreas() const
Update the patch areas after AMI update.
Definition: cyclicACMIFvPatch.C:44
Foam::cyclicACMIFvPatch::neighbFvPatch
const cyclicACMIFvPatch & neighbFvPatch() const
Definition: cyclicACMIFvPatch.H:162
Foam::cyclicAMIPolyPatch::owner
virtual bool owner() const
Does this side own the patch?
Definition: cyclicAMIPolyPatch.C:751
cyclicACMIPolyPatch.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::cyclicACMIFvPatch::owner
virtual bool owner() const
Definition: cyclicACMIFvPatch.H:107
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:181
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:145
Foam::cyclicACMIFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicACMIFvPatch.C:140
Foam::cyclicACMIFvPatch::coupled
virtual bool coupled() const
Return true if this patch is coupled. This is equivalent.
Definition: cyclicACMIFvPatch.C:134
Foam::cyclicACMIFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicACMIFvPatch.C:195
coupledFvPatch.H
Foam::fvPatch::boundaryMesh
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:187
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::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:62
Foam::cyclicACMIFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicACMIFvPatch.H:151
Foam::Field< scalar >
Foam::cyclicACMIFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicACMIFvPatch.H:157
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:63
Foam::cyclicACMIFvPatch::neighbPatch
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
Definition: cyclicACMIFvPatch.H:113
Foam::cyclicACMIFvPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Return neighbour.
Definition: cyclicACMIFvPatch.H:122
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:102
Foam::cyclicACMIFvPatch::nonOverlapPatch
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
Definition: cyclicACMIFvPatch.H:128
fvBoundaryMesh.H
Foam::cyclicACMIPolyPatch::nonOverlapPatchID
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
Definition: cyclicACMIPolyPatch.C:484
Foam::cyclicAMIPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patch ID.
Definition: cyclicAMIPolyPatch.C:715
Foam::cyclicACMIFvPatch::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicACMIFvPatch.H:134
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:83
cyclicACMILduInterface.H
Foam::cyclicAMIPolyPatch::AMI
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIPolyPatch.C:796
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:66
Foam::cyclicACMIFvPatch::cyclicACMIPatch
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicACMIFvPatch.H:96
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:81
Foam::UList< label >
Foam::cyclicACMIFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicACMIFvPatch.C:186
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:145
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:53
Foam::cyclicACMIFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicACMIFvPatch.C:86
Foam::cyclicACMIFvPatch
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
Definition: cyclicACMIFvPatch.H:53