Loading...
Searching...
No Matches
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{
54/*---------------------------------------------------------------------------*\
55 Class cyclicFaPatch Declaration
56\*---------------------------------------------------------------------------*/
57
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 geodesic distance between P and N
82 void makeLPN(scalarField&) const;
83
84 //- Make patch face - neighbour cell distances
85 void makeDeltaCoeffs(scalarField&) const;
86
87 //- Make non-orthogonality correction vectors
88 void makeCorrectionVectors(vectorField& cv) const { cv = Zero; }
89
90
91public:
92
93 //- Runtime type information
94 TypeName("cyclic");
95
96
97 // Constructors
98
99 //- Construct from dictionary
101 (
102 const word& name,
103 const dictionary& dict,
104 const label index,
105 const faBoundaryMesh& bm,
106 const word& patchType
107 );
108
109
110 //- Destructor
111 virtual ~cyclicFaPatch() = default;
112
113
114 // Member Functions
115
116 // Access
117
118 //- Does this side own the patch ?
119 //- Yes: it contains both sets of faces
120 virtual bool owner() const
121 {
122 return true;
124
125 //- Return neighbour
126 virtual label neighbPatchID() const
127 {
129 return index();
130 }
131
132 //- Return processor number
133 virtual const cyclicLduInterface& neighbPatch() const
136 return *this;
137 }
138
139 //- Return face transformation tensor
140 virtual const tensorField& forwardT() const
141 {
143 }
144
145 //- Return neighbour-cell transformation tensor
146 virtual const tensorField& reverseT() const
147 {
149 }
150
151 //- Initialise the calculation of the patch geometry
152 virtual void initGeometry(PstreamBuffers&);
153
154 //- Calculate the patch geometry
155 virtual void calcGeometry(PstreamBuffers&);
156
157 //- Initialise the patches for moving points
158 virtual void initMovePoints(PstreamBuffers&, const pointField&);
159
160 //- Correct patches after moving points
161 virtual void movePoints(PstreamBuffers&, const pointField&);
162
163 //- Return delta (P to N) vectors across coupled patch
164 virtual tmp<vectorField> delta() const;
165
166
167 // Interface transfer functions
169 //- Return the values of the given internal data adjacent to
170 //- the interface as a field
172 (
173 const labelUList& internalData
174 ) const;
175
176
177 //- Return the values of the given internal data adjacent to
178 //- the interface as a field using edgeFace mapping
180 (
181 const labelUList& internalData,
182 const labelUList& edgeFaces
183 ) const;
184
185
186 //- Transfer and return neighbour field
188 (
189 const Pstream::commsTypes commsType,
190 const labelUList& interfaceData
191 ) const;
192
193 //- Return neighbour field
195 (
196 const Pstream::commsTypes commsType,
197 const labelUList& internalData
198 ) const;
199
200
201 //- Return neighbour field using edgeCells mapping
203 (
204 const Pstream::commsTypes commsType,
205 const labelUList& internalData,
206 const labelUList& edgeCells
207 ) const;
208};
209
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213} // End namespace Foam
214
215// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216
217#endif
218
219// ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
commsTypes
Communications types.
Definition UPstream.H:81
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
const tensorField & forwardT() const
Return face transformation tensor.
coupledFaPatch(const word &name, const labelUList &edgeLabels, const label index, const faBoundaryMesh &bm, const label nbrPolyPatchIndex, const word &patchType)
Construct from components.
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
Does this side own the patch ? Yes: it contains both sets of faces.
void makeWeights(scalarField &) const
Make patch weighting factors.
cyclicFaPatch(const word &name, const dictionary &dict, const label index, const faBoundaryMesh &bm, const word &patchType)
Construct from dictionary.
void makeLPN(scalarField &) const
Make patch geodesic distance between P and N.
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.
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
Return the values of the given internal data adjacent to the interface as a field.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
TypeName("cyclic")
Runtime type information.
void makeCorrectionVectors(vectorField &cv) const
Make non-orthogonality correction vectors.
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicLduInterface() noexcept=default
Default construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Finite area boundary mesh, which is a faPatch list with registered IO, a reference to the associated ...
const labelUList & edgeFaces() const
Return edge-face addressing.
Definition faPatch.C:424
label index() const noexcept
The index of this patch in the boundaryMesh.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68