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 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::cyclicACMIFvPatch
29
30Description
31 Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
32
33SourceFiles
34 cyclicACMIFvPatch.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef cyclicACMIFvPatch_H
39#define cyclicACMIFvPatch_H
40
41#include "coupledFvPatch.H"
43#include "cyclicACMIPolyPatch.H"
44#include "fvBoundaryMesh.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class cyclicACMIFvPatch Declaration
53\*---------------------------------------------------------------------------*/
56:
57 public coupledFvPatch,
59{
60 // Private data
61
62 const cyclicACMIPolyPatch& cyclicACMIPolyPatch_;
63
64 //- Flag to detect whether AMI is up to date with mesh points
65 mutable uniformDimensionedScalarField areaTime_;
66
67
68
69protected:
70
71 // Protected Member functions
72
73 //- Update the AMI and patch areas. Return true if anything updated
74 virtual bool updateAreas() const;
75
76 //- Helper function to reset the FV patch areas from the primitive patch
77 void resetPatchAreas(const fvPatch& fvp) const;
78
79 //- Make patch weighting factors
80 void makeWeights(scalarField&) const;
81
82 //- Correct patches after moving points
83 virtual void movePoints();
84
85
86public:
87
88 //- Runtime type information
89 TypeName(cyclicACMIPolyPatch::typeName_());
90
91
92 // Constructors
93
94 //- Construct from polyPatch
96
97
98 // Member functions
99
100// // Implicit treatment functions
101//
102// //- Return number of new internal sub-faces and new proc faces
103// virtual void newInternalProcFaces(label&, label&) const;
104//
105// //- Return collocated faces
106// virtual refPtr<labelListList> mapCollocatedFaces() const;
107
108
109 // Access
110
111 //- Return local reference cast into the cyclic patch
113 {
114 return cyclicACMIPolyPatch_;
115 }
116
117 //- Return neighbour
118 virtual label neighbPatchID() const
119 {
120 return cyclicACMIPolyPatch_.neighbPatchID();
121 }
123 virtual bool owner() const
124 {
125 return cyclicACMIPolyPatch_.owner();
126 }
127
128 //- Return neighbour fvPatch
129 virtual const cyclicACMIFvPatch& neighbPatch() const
130 {
131 return refCast<const cyclicACMIFvPatch>
132 (
133 this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
134 );
135 }
136
137 //- Return neighbour
138 virtual label nonOverlapPatchID() const
139 {
140 return cyclicACMIPolyPatch_.nonOverlapPatchID();
141 }
142
143 //- Return non-overlapping fvPatch
144 virtual const fvPatch& nonOverlapPatch() const
145 {
146 return this->boundaryMesh()[nonOverlapPatchID()];
147 }
148
149 //- Return a reference to the AMI interpolator
150 virtual const AMIPatchToPatchInterpolation& AMI() const
151 {
152 return cyclicACMIPolyPatch_.AMI();
153 }
154
155 //- Are the cyclic planes parallel
156 virtual bool parallel() const
157 {
158 return cyclicACMIPolyPatch_.parallel();
159 }
160
161 //- Return face transformation tensor
162 virtual const tensorField& forwardT() const
163 {
164 return cyclicACMIPolyPatch_.forwardT();
165 }
166
167 //- Return neighbour-cell transformation tensor
168 virtual const tensorField& reverseT() const
169 {
170 return cyclicACMIPolyPatch_.reverseT();
171 }
173 const cyclicACMIFvPatch& neighbFvPatch() const
174 {
175 return refCast<const cyclicACMIFvPatch>
176 (
177 this->boundaryMesh()[cyclicACMIPolyPatch_.neighbPatchID()]
178 );
179 }
180
181 //- Return true if this patch is coupled.
182 // This is equivalent to coupledPolyPatch::coupled()
183 // if parallel running or both sides present, false otherwise
184 virtual bool coupled() const;
185
186 //- Return delta (P to N) vectors across coupled patch
187 virtual tmp<vectorField> delta() const;
188
189 //- Interpolate (make sure to have uptodate areas)
190 template<class Type>
192 (
193 const Field<Type>& fld
194 ) const
195 {
196 // Make sure areas are up-to-date
197 updateAreas();
198
199 return
200 cyclicACMIPolyPatch_.cyclicAMIPolyPatch::interpolate
201 (
202 fld
203 );
204 }
205
206 //- Interpolate (make sure to have up-to-date areas)
207 template<class Type>
209 (
210 const tmp<Field<Type>>& tfld
211 ) const
212 {
213 return interpolate(tfld());
214 }
215
216
217 // Interface transfer functions
218
219 //- Return the values of the given internal data adjacent to
220 //- the interface as a field
222 (
223 const labelUList& internalData
224 ) const;
225
226 //- Return the values of the given internal data adjacent to
227 //- the interface as a field using a mapping faceCell
229 (
230 const labelUList& internalData,
231 const labelUList& faceCells
232 ) const;
233
234 //- Return neighbour field
236 (
237 const Pstream::commsTypes commsType,
238 const labelUList& internalData
239 ) const;
240
241};
242
243
244// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245
246} // End namespace Foam
247
248// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249
250#endif
251
252// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
commsTypes
Types of communications.
Definition: UPstream.H:67
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:63
An abstract base class for patches that couple regions of the computational domain e....
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
const cyclicACMIFvPatch & neighbFvPatch() const
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
tmp< Field< Type > > interpolate(const tmp< Field< Type > > &tfld) const
Interpolate (make sure to have up-to-date areas)
void resetPatchAreas(const fvPatch &fvp) const
Helper function to reset the FV patch areas from the primitive patch.
virtual bool owner() const
void makeWeights(scalarField &) const
Make patch weighting factors.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual label neighbPatchID() const
Return neighbour.
virtual void movePoints()
Correct patches after moving points.
TypeName(cyclicACMIPolyPatch::typeName_())
Runtime type information.
virtual bool coupled() const
Return true if this patch is coupled.
virtual bool parallel() const
Are the cyclic planes parallel.
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
virtual bool updateAreas() const
Update the AMI and patch areas. Return true if anything updated.
virtual label nonOverlapPatchID() const
Return neighbour.
tmp< Field< Type > > interpolate(const Field< Type > &fld) const
Interpolate (make sure to have uptodate areas)
virtual const tensorField & forwardT() const
Return face transformation tensor.
An abstract base class for cyclic ACMI coupled interfaces.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
virtual label nonOverlapPatchID() const
Non-overlapping patch ID.
virtual bool owner() const
Does this side own the patch?
const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
virtual label neighbPatchID() const
Neighbour patch ID.
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
Foam::fvBoundaryMesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:167
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73