processorFvPatch.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) 2011-2015 OpenFOAM Foundation
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::processorFvPatch
29 
30 Description
31  Processor patch.
32 
33 SourceFiles
34  processorFvPatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef processorFvPatch_H
39 #define processorFvPatch_H
40 
41 #include "coupledFvPatch.H"
42 #include "processorLduInterface.H"
43 #include "processorPolyPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class processorFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class processorFvPatch
55 :
56  public coupledFvPatch,
58 {
59  // Private Data
60 
61  const processorPolyPatch& procPolyPatch_;
62 
63 
64 protected:
65 
66  // Protected Member functions
67 
68  //- Make patch weighting factors
69  void makeWeights(scalarField&) const;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName(processorPolyPatch::typeName_());
76 
77 
78  // Constructors
79 
80  //- Construct from components
82  :
83  coupledFvPatch(patch, bm),
84  procPolyPatch_(refCast<const processorPolyPatch>(patch))
85  {}
86 
87 
88  // Member functions
89 
90  //- Return communicator used for comms
91  virtual label comm() const
92  {
93  return procPolyPatch_.comm();
94  }
95 
96  //- Return processor number
97  virtual int myProcNo() const
98  {
99  return procPolyPatch_.myProcNo();
100  }
101 
102  //- Return neighbour processor number
103  virtual int neighbProcNo() const
104  {
105  return procPolyPatch_.neighbProcNo();
106  }
107 
108  //- Return message tag used for sending
109  virtual int tag() const
110  {
111  return UPstream::msgType();
112  }
113 
114  //- Return true if running parallel
115  virtual bool coupled() const
116  {
117  return Pstream::parRun();
118  }
119 
120  const processorPolyPatch& procPolyPatch() const
121  {
122  return procPolyPatch_;
123  }
124 
125  //- Are the cyclic planes parallel
126  virtual bool parallel() const
127  {
128  return procPolyPatch_.parallel();
129  }
130 
131  //- Return face transformation tensor
132  virtual const tensorField& forwardT() const
133  {
134  return procPolyPatch_.forwardT();
135  }
136 
137  //- Return neighbour-cell transformation tensor.
138  virtual const tensorField& reverseT() const
139  {
140  return procPolyPatch_.reverseT();
141  }
142 
143  //- Return delta (P to N) vectors across coupled patch
144  virtual tmp<vectorField> delta() const;
145 
146 
147  // Interface transfer functions
148 
149  //- Return the values of the given internal data adjacent to
150  //- the interface as a field
152  (
153  const labelUList& internalData
154  ) const;
155 
156  //- Return the values of the given internal data adjacent to
157  //- the interface as a field using a mapping faceCell
159  (
160  const labelUList& internalData,
161  const labelUList& faceCells
162  ) const;
163 
164  //- Inherit initInternalFieldTransfer from coupledFvPatch
166 
167  //- Initialise neighbour field transfer
168  virtual void initInternalFieldTransfer
169  (
170  const Pstream::commsTypes commsType,
171  const labelUList& internalData
172  ) const;
173 
174  //- Initialise neighbour field transfer using faceCells map
175  virtual void initInternalFieldTransfer
176  (
177  const Pstream::commsTypes commsType,
178  const labelUList& iF,
179  const labelUList& faceCells
180  ) const;
181 
182  //- Return neighbour field
184  (
185  const Pstream::commsTypes commsType,
186  const labelUList& internalData
187  ) const;
188 
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
Foam::coupledFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
Definition: coupledFvPatch.H:146
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::processorFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: processorFvPatch.H:125
Foam::processorLduInterface
An abstract base class for processor coupled interfaces.
Definition: processorLduInterface.H:53
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:301
Foam::processorFvPatch::processorFvPatch
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
Definition: processorFvPatch.H:80
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:307
Foam::processorFvPatch
Processor patch.
Definition: processorFvPatch.H:53
Foam::processorPolyPatch::neighbProcNo
int neighbProcNo() const
Return neighbour processor number.
Definition: processorPolyPatch.H:274
Foam::processorFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: processorFvPatch.C:146
processorLduInterface.H
coupledFvPatch.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:57
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:295
Foam::processorFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorFvPatch.H:131
Foam::processorFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
Definition: processorFvPatch.C:125
Foam::processorFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: processorFvPatch.H:137
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::processorFvPatch::procPolyPatch
const processorPolyPatch & procPolyPatch() const
Definition: processorFvPatch.H:119
Foam::processorFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: processorFvPatch.C:44
Foam::processorFvPatch::neighbProcNo
virtual int neighbProcNo() const
Return neighbour processor number.
Definition: processorFvPatch.H:102
Foam::processorFvPatch::TypeName
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::processorPolyPatch
Neighbour processor patch.
Definition: processorPolyPatch.H:58
Foam::processorFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: processorFvPatch.C:70
processorPolyPatch.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::processorFvPatch::comm
virtual label comm() const
Return communicator used for comms.
Definition: processorFvPatch.H:90
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::UPstream::msgType
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:540
Foam::processorFvPatch::coupled
virtual bool coupled() const
Return true if running parallel.
Definition: processorFvPatch.H:114
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
Foam::processorPolyPatch::comm
virtual label comm() const
Return communicator used for communication.
Definition: processorPolyPatch.H:330
Foam::UList< label >
Foam::processorFvPatch::tag
virtual int tag() const
Return message tag used for sending.
Definition: processorFvPatch.H:108
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
Foam::processorPolyPatch::myProcNo
int myProcNo() const
Return processor number.
Definition: processorPolyPatch.H:268
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::processorFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Definition: processorFvPatch.C:106
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::processorFvPatch::myProcNo
virtual int myProcNo() const
Return processor number.
Definition: processorFvPatch.H:96