cyclicAMIFvPatch.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) 2011-2014 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::cyclicAMIFvPatch
26 
27 Description
28  Cyclic patch for Arbitrary Mesh Interface (AMI)
29 
30 SourceFiles
31  cyclicAMIFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicAMIFvPatch_H
36 #define cyclicAMIFvPatch_H
37 
38 #include "coupledFvPatch.H"
39 #include "cyclicAMILduInterface.H"
40 #include "cyclicAMIPolyPatch.H"
41 #include "fvBoundaryMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cyclicAMIFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class cyclicAMIFvPatch
53 :
54  public coupledFvPatch,
56 {
57  // Private data
58 
60 
61 
62 protected:
63 
64  // Protected Member functions
65 
66  //- Make patch weighting factors
67  void makeWeights(scalarField&) const;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName(cyclicAMIPolyPatch::typeName_());
74 
75 
76  // Constructors
77 
78  //- Construct from polyPatch
80  :
81  coupledFvPatch(patch, bm),
84  {}
85 
86 
87  // Member functions
88 
89  // Access
90 
91  //- Return local reference cast into the cyclic patch
92  const cyclicAMIPolyPatch& cyclicAMIPatch() const
93  {
94  return cyclicAMIPolyPatch_;
95  }
96 
97  //- Return neighbour
98  virtual label neighbPatchID() const
99  {
101  }
102 
103  virtual bool owner() const
104  {
105  return cyclicAMIPolyPatch_.owner();
106  }
107 
108  //- Return processor number
109  virtual const cyclicAMIFvPatch& neighbPatch() const
110  {
111  return refCast<const cyclicAMIFvPatch>
112  (
113  this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
114  );
115  }
116 
117  //- Return a reference to the AMI interpolator
118  virtual const AMIPatchToPatchInterpolation& AMI() const
119  {
120  return cyclicAMIPolyPatch_.AMI();
121  }
122 
123  //- Return true if applying the low weight correction
124  virtual bool applyLowWeightCorrection() const
125  {
127  }
128 
129 
130  //- Are the cyclic planes parallel
131  virtual bool parallel() const
132  {
133  return cyclicAMIPolyPatch_.parallel();
134  }
135 
136  //- Return face transformation tensor
137  virtual const tensorField& forwardT() const
138  {
139  return cyclicAMIPolyPatch_.forwardT();
140  }
141 
142  //- Return neighbour-cell transformation tensor
143  virtual const tensorField& reverseT() const
144  {
145  return cyclicAMIPolyPatch_.reverseT();
146  }
147 
148  const cyclicAMIFvPatch& neighbFvPatch() const
149  {
150  return refCast<const cyclicAMIFvPatch>
151  (
152  this->boundaryMesh()[cyclicAMIPolyPatch_.neighbPatchID()]
153  );
154  }
155 
156  //- Return true if this patch is coupled. This is equivalent
157  // to the coupledPolyPatch::coupled() if parallel running or
158  // both sides present, false otherwise
159  virtual bool coupled() const;
160 
161  //- Return delta (P to N) vectors across coupled patch
162  virtual tmp<vectorField> delta() const;
163 
164  template<class Type>
166  (
167  const Field<Type>& fld,
168  const UList<Type>& defaultValues = UList<Type>()
169  ) const
170  {
171  return cyclicAMIPolyPatch_.interpolate(fld, defaultValues);
172  }
173 
174  template<class Type>
176  (
177  const tmp<Field<Type> >& tFld,
178  const UList<Type>& defaultValues = UList<Type>()
179  ) const
180  {
181  return cyclicAMIPolyPatch_.interpolate(tFld, defaultValues);
182  }
183 
184 
185  // Interface transfer functions
186 
187  //- Return the values of the given internal data adjacent to
188  // the interface as a field
190  (
191  const labelUList& internalData
192  ) const;
193 
194  //- Return neighbour field
196  (
197  const Pstream::commsTypes commsType,
198  const labelUList& internalData
199  ) const;
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
Foam::cyclicAMIFvPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicAMIFvPatch.H:97
Foam::cyclicAMIFvPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Definition: cyclicAMIFvPatch.H:165
Foam::cyclicAMIFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicAMIFvPatch.C:166
Foam::cyclicAMIPolyPatch::owner
virtual bool owner() const
Does this side own the patch?
Definition: cyclicAMIPolyPatch.C:738
Foam::cyclicAMIFvPatch::AMI
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIFvPatch.H:117
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::cyclicAMIFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicAMIFvPatch.C:97
Foam::cyclicAMILduInterface
An abstract base class for cyclic AMI coupled interfaces.
Definition: cyclicAMILduInterface.H:49
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:294
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:300
Foam::cyclicAMIFvPatch::neighbPatch
virtual const cyclicAMIFvPatch & neighbPatch() const
Return processor number.
Definition: cyclicAMIFvPatch.H:108
Foam::cyclicAMIFvPatch::neighbFvPatch
const cyclicAMIFvPatch & neighbFvPatch() const
Definition: cyclicAMIFvPatch.H:147
Foam::cyclicAMIFvPatch::applyLowWeightCorrection
virtual bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
Definition: cyclicAMIFvPatch.H:123
coupledFvPatch.H
Foam::cyclicAMIFvPatch::cyclicAMIPolyPatch_
const cyclicAMIPolyPatch & cyclicAMIPolyPatch_
Definition: cyclicAMIFvPatch.H:58
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::cyclicAMIFvPatch::TypeName
TypeName(cyclicAMIPolyPatch::typeName_())
Runtime type information.
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::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::cyclicAMIFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicAMIFvPatch.H:142
Foam::cyclicAMIPolyPatch::interpolate
tmp< Field< Type > > interpolate(const Field< Type > &fld, const UList< Type > &defaultValues=UList< Type >()) const
Interpolate field.
fvBoundaryMesh.H
Foam::cyclicAMIFvPatch::coupled
virtual bool coupled() const
Return true if this patch is coupled. This is equivalent.
Definition: cyclicAMIFvPatch.C:49
Foam::cyclicAMIPolyPatch::neighbPatchID
virtual label neighbPatchID() const
Neighbour patch ID.
Definition: cyclicAMIPolyPatch.C:702
fld
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
cyclicAMIPolyPatch.H
Foam::cyclicAMIPolyPatch::AMI
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
Definition: cyclicAMIPolyPatch.C:783
Foam::cyclicAMIFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: cyclicAMIFvPatch.C:157
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::cyclicAMIFvPatch::owner
virtual bool owner() const
Definition: cyclicAMIFvPatch.H:102
Foam::cyclicAMIPolyPatch::applyLowWeightCorrection
bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
Definition: cyclicAMIPolyPatch.C:801
Foam::cyclicAMIFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicAMIFvPatch.C:55
Foam::AMIInterpolation
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Definition: AMIInterpolation.H:77
Foam::UList< Type >
Foam::cyclicAMIFvPatch::cyclicAMIFvPatch
cyclicAMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: cyclicAMIFvPatch.H:78
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
Foam::cyclicAMIFvPatch::cyclicAMIPatch
const cyclicAMIPolyPatch & cyclicAMIPatch() const
Return local reference cast into the cyclic patch.
Definition: cyclicAMIFvPatch.H:91
Foam::cyclicAMIFvPatch
Cyclic patch for Arbitrary Mesh Interface (AMI)
Definition: cyclicAMIFvPatch.H:51
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:51
cyclicAMILduInterface.H
Foam::cyclicAMIFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicAMIFvPatch.H:136
Foam::cyclicAMIFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: cyclicAMIFvPatch.H:130
Foam::cyclicAMIPolyPatch
Cyclic patch for Arbitrary Mesh Interface (AMI)
Definition: cyclicAMIPolyPatch.H:51