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 UPstream::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;
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 // ************************************************************************* //
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to the interface as a field.
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
commsTypes
Communications types.
Definition: UPstream.H:72
virtual bool parallel() const
Are the cyclic planes parallel.
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
Definition: typeInfo.H:159
virtual int myProcNo() const
Return processor number.
An abstract base class for patches that couple regions of the computational domain e...
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1049
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:1229
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:52
const processorPolyPatch & procPolyPatch() const
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual int neighbProcNo() const
Return neighbour processor number.
Neighbour processor patch.
virtual bool parallel() const
Are the cyclic planes parallel.
virtual label comm() const
Return communicator used for communication.
void makeWeights(scalarField &) const
Make patch weighting factors.
Processor patch.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual const tensorField & forwardT() const
Return face transformation tensor.
An abstract base class for processor coupled interfaces.
int neighbProcNo() const noexcept
Return neighbour processor number.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::fvBoundaryMesh.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
const polyPatch & patch() const noexcept
Return the polyPatch.
Definition: fvPatch.H:202
virtual int tag() const
Return message tag used for sending.
virtual bool coupled() const
Return true if running parallel.
int myProcNo() const noexcept
Return processor number.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
virtual label comm() const
Return communicator used for comms.
Namespace for OpenFOAM.