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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::cyclicFaPatch
29 
30 Description
31  Cyclic-plane patch.
32 
33 Author
34  Zeljko Tukovic, FMENA
35  Hrvoje Jasak, Wikki Ltd.
36 
37 SourceFiles
38  cyclicFaPatch.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef cyclicFaPatch_H
43 #define cyclicFaPatch_H
44 
45 #include "coupledFaPatch.H"
46 #include "cyclicLduInterface.H"
47 #include "cyclicPolyPatch.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class cyclicFaPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class cyclicFaPatch
59 :
60  public coupledFaPatch,
61  public cyclicLduInterface
62 {
63  // Private member functions
64 
65  void calcTransforms();
66 
67 protected:
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 
85 public:
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  )
101  :
103  {}
104 
105 
106  //- Destructor
107  virtual ~cyclicFaPatch() = default;
108 
109 
110  // Member functions
111 
112  // Access
113 
114  //- Is this the master side? Yes: it contains both sets of faces
115  virtual bool master() const
116  {
117  return true;
118  }
119 
120  //- Return neighbour
121  virtual label neighbPatchID() const
122  {
124  return index();
125  }
126 
127  virtual bool owner() const
128  {
129  return master();
130  }
131 
132  //- Return processor number
133  virtual const cyclicLduInterface& neighbPatch() const
134  {
136  return *this;
137  }
138 
139  //- Return face transformation tensor
140  virtual const tensorField& forwardT() const
141  {
142  return coupledFaPatch::forwardT();
143  }
144 
145  //- Return neighbour-cell transformation tensor
146  virtual const tensorField& reverseT() const
147  {
148  return coupledFaPatch::reverseT();
149  }
150 
151  //- Initialise the calculation of the patch geometry
152  virtual void initGeometry();
153 
154  //- Calculate the patch geometry
155  virtual void calcGeometry();
156 
157  //- Initialise the patches for moving points
158  virtual void initMovePoints(const pointField&);
159 
160  //- Correct patches after moving points
161  virtual void movePoints(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
168 
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
187  virtual tmp<labelField> transfer
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 // ************************************************************************* //
Foam::cyclicFaPatch::initMovePoints
virtual void initMovePoints(const pointField &)
Initialise the patches for moving points.
Definition: cyclicFaPatch.C:236
Foam::cyclicFaPatch::calcGeometry
virtual void calcGeometry()
Calculate the patch geometry.
Definition: cyclicFaPatch.C:229
Foam::cyclicFaPatch::owner
virtual bool owner() const
Definition: cyclicFaPatch.H:126
Foam::cyclicFaPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: cyclicFaPatch.C:152
coupledFaPatch.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
cyclicPolyPatch.H
Foam::cyclicFaPatch::cyclicFaPatch
cyclicFaPatch(const word &name, const dictionary &dict, const label index, const faBoundaryMesh &bm)
Construct from dictionary.
Definition: cyclicFaPatch.H:94
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::cyclicFaPatch::makeDeltaCoeffs
void makeDeltaCoeffs(scalarField &) const
Make patch face - neighbour cell distances.
Definition: cyclicFaPatch.C:207
Foam::coupledFaPatch::coupledFaPatch
coupledFaPatch(const word &name, const labelList &edgeLabels, const label index, const faBoundaryMesh &bm, const label ngbPolyPatchIndex)
Construct from components.
Definition: coupledFaPatch.H:112
cyclicLduInterface.H
Foam::faPatch::edgeFaces
const labelUList & edgeFaces() const
Return edge-face addressing.
Definition: faPatch.C:358
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::faBoundaryMesh
Finite area boundary mesh.
Definition: faBoundaryMesh.H:65
Foam::coupledFaPatch::reverseT
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledFaPatch.H:185
Foam::Field< scalar >
Foam::coupledFaPatch
coupledFaPatch is an abstract base class for patches that couple regions of the computational domain ...
Definition: coupledFaPatch.H:56
Foam::cyclicFaPatch::~cyclicFaPatch
virtual ~cyclicFaPatch()=default
Destructor.
Foam::cyclicFaPatch::TypeName
TypeName("cyclic")
Runtime type information.
Foam::cyclicFaPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: cyclicFaPatch.C:286
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::cyclicFaPatch::matchTol_
static const scalar matchTol_
Relative tolerance (for geometric matching). Is factor of.
Definition: cyclicFaPatch.H:72
Foam::cyclicFaPatch::initGeometry
virtual void initGeometry()
Initialise the calculation of the patch geometry.
Definition: cyclicFaPatch.C:223
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::cyclicFaPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: cyclicFaPatch.H:139
Foam::coupledFaPatch::forwardT
const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledFaPatch.H:172
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchIdentifier::index
label index() const noexcept
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:147
Foam::cyclicFaPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: cyclicFaPatch.H:145
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::cyclicFaPatch::transfer
virtual tmp< labelField > transfer(const Pstream::commsTypes commsType, const labelUList &interfaceData) const
Transfer and return neighbour field.
Definition: cyclicFaPatch.C:305
Foam::cyclicFaPatch::movePoints
virtual void movePoints(const pointField &)
Correct patches after moving points.
Definition: cyclicFaPatch.C:242
Foam::UList< label >
Foam::cyclicFaPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: cyclicFaPatch.C:249
Foam::cyclicFaPatch
Cyclic-plane patch.
Definition: cyclicFaPatch.H:57
Foam::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
Foam::cyclicFaPatch::neighbPatch
virtual const cyclicLduInterface & neighbPatch() const
Return processor number.
Definition: cyclicFaPatch.H:132
Foam::cyclicFaPatch::neighbPatchID
virtual label neighbPatchID() const
Return neighbour.
Definition: cyclicFaPatch.H:120
Foam::cyclicFaPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: cyclicFaPatch.C:326
Foam::cyclicLduInterface
An abstract base class for cyclic coupled interfaces.
Definition: cyclicLduInterface.H:52
Foam::cyclicFaPatch::master
virtual bool master() const
Is this the master side? Yes: it contains both sets of faces.
Definition: cyclicFaPatch.H:114