cyclicFaPatch.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) 2016-2017 Wikki Ltd
9 Copyright (C) 2019-2022 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::cyclicFaPatch
29
30Description
31 Cyclic-plane patch.
32
33Author
34 Zeljko Tukovic, FMENA
35 Hrvoje Jasak, Wikki Ltd.
36
37SourceFiles
38 cyclicFaPatch.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef Foam_cyclicFaPatch_H
43#define Foam_cyclicFaPatch_H
44
45#include "coupledFaPatch.H"
46#include "cyclicLduInterface.H"
47#include "cyclicPolyPatch.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54/*---------------------------------------------------------------------------*\
55 Class cyclicFaPatch Declaration
56\*---------------------------------------------------------------------------*/
58class cyclicFaPatch
59:
60 public coupledFaPatch,
62{
63 // Private Member Functions
64
65 void calcTransforms();
66
67protected:
68
69 // Protected Static Data
70
71 //- Relative tolerance (for geometric matching). Is factor of
72 // maximum edge length per face.
73 static const scalar matchTol_;
74
75
76 // Protected Member functions
77
78 //- Make patch weighting factors
79 void makeWeights(scalarField&) const;
80
81 //- Make patch face - neighbour cell distances
82 void makeDeltaCoeffs(scalarField&) const;
83
84
85public:
86
87 //- Runtime type information
88 TypeName("cyclic");
89
90
91 // Constructors
92
93 //- Construct from dictionary
95 (
96 const word& name,
97 const dictionary& dict,
98 const label index,
99 const faBoundaryMesh& bm,
100 const word& patchType
101 );
102
103
104 //- Destructor
105 virtual ~cyclicFaPatch() = default;
106
107
108 // Member Functions
109
110 // Access
111
112 //- Does this side own the patch ?
113 //- Yes: it contains both sets of faces
114 virtual bool owner() const
115 {
116 return true;
117 }
118
119 //- Return neighbour
120 virtual label neighbPatchID() const
121 {
123 return index();
124 }
125
126 //- Return processor number
127 virtual const cyclicLduInterface& neighbPatch() const
128 {
130 return *this;
131 }
132
133 //- Return face transformation tensor
134 virtual const tensorField& forwardT() const
135 {
137 }
138
139 //- Return neighbour-cell transformation tensor
140 virtual const tensorField& reverseT() const
141 {
143 }
144
145 //- Initialise the calculation of the patch geometry
146 virtual void initGeometry(PstreamBuffers&);
147
148 //- Calculate the patch geometry
149 virtual void calcGeometry(PstreamBuffers&);
150
151 //- Initialise the patches for moving points
152 virtual void initMovePoints(PstreamBuffers&, const pointField&);
153
154 //- Correct patches after moving points
155 virtual void movePoints(PstreamBuffers&, const pointField&);
156
157 //- Return delta (P to N) vectors across coupled patch
158 virtual tmp<vectorField> delta() const;
159
160
161 // Interface transfer functions
162
163 //- Return the values of the given internal data adjacent to
164 //- the interface as a field
166 (
167 const labelUList& internalData
168 ) const;
169
170
171 //- Return the values of the given internal data adjacent to
172 //- the interface as a field using edgeFace mapping
174 (
175 const labelUList& internalData,
176 const labelUList& edgeFaces
177 ) const;
178
179
180 //- Transfer and return neighbour field
182 (
183 const Pstream::commsTypes commsType,
184 const labelUList& interfaceData
185 ) const;
186
187 //- Return neighbour field
189 (
190 const Pstream::commsTypes commsType,
191 const labelUList& internalData
192 ) const;
193
194
195 //- Return neighbour field using edgeCells mapping
197 (
198 const Pstream::commsTypes commsType,
199 const labelUList& internalData,
200 const labelUList& edgeCells
201 ) const;
202};
203
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207} // End namespace Foam
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211#endif
212
213// ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
commsTypes
Types of communications.
Definition: UPstream.H:67
coupledFaPatch is an abstract base class for patches that couple regions of the computational domain ...
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
const tensorField & forwardT() const
Return face transformation tensor.
Cyclic-plane patch.
Definition: cyclicFaPatch.H:61
virtual const cyclicLduInterface & neighbPatch() const
Return processor number.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
virtual bool owner() const
void makeWeights(scalarField &) const
Make patch weighting factors.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual label neighbPatchID() const
Return neighbour.
void makeDeltaCoeffs(scalarField &) const
Make patch face - neighbour cell distances.
virtual tmp< labelField > transfer(const Pstream::commsTypes commsType, const labelUList &interfaceData) const
Transfer and return neighbour field.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
static const scalar matchTol_
Relative tolerance (for geometric matching). Is factor of.
Definition: cyclicFaPatch.H:72
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual ~cyclicFaPatch()=default
Destructor.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
TypeName("cyclic")
Runtime type information.
virtual const tensorField & forwardT() const
Return face transformation tensor.
An abstract base class for cyclic coupled interfaces.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Finite area boundary mesh.
const labelUList & edgeFaces() const
Return edge-face addressing.
Definition: faPatch.C:429
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73