processorFvPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::processorFvPatch
26 
27 Description
28  Processor patch.
29 
30 SourceFiles
31  processorFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorFvPatch_H
36 #define processorFvPatch_H
37 
38 #include "coupledFvPatch.H"
39 #include "processorLduInterface.H"
40 #include "processorPolyPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class processorFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class processorFvPatch
52 :
53  public coupledFvPatch,
55 {
56  // Private Data
57 
58  const processorPolyPatch& procPolyPatch_;
59 
60 
61 protected:
62 
63  // Protected Member functions
64 
65  //- Make patch weighting factors
66  void makeWeights(scalarField&) const;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName(processorPolyPatch::typeName_());
73 
74 
75  // Constructors
76 
77  //- Construct from components
79  :
80  coupledFvPatch(patch, bm),
81  procPolyPatch_(refCast<const processorPolyPatch>(patch))
82  {}
83 
84 
85  // Member Functions
86 
87  //- Return communicator used for comms
88  virtual label comm() const
89  {
90  return procPolyPatch_.comm();
91  }
92 
93  //- Return processor number
94  virtual int myProcNo() const
95  {
96  return procPolyPatch_.myProcNo();
97  }
98 
99  //- Return neighbour processor number
100  virtual int neighbProcNo() const
101  {
102  return procPolyPatch_.neighbProcNo();
103  }
104 
105  //- Return message tag used for sending
106  virtual int tag() const
107  {
108  return UPstream::msgType();
109  }
110 
111  //- Return true if running parallel
112  virtual bool coupled() const
113  {
114  if (Pstream::parRun())
115  {
116  return true;
117  }
118  else
119  {
120  return false;
121  }
122  }
124  const processorPolyPatch& procPolyPatch() const
125  {
126  return procPolyPatch_;
127  }
128 
129  //- Return transformation between the coupled patches
130  virtual const transformer& transform() const
131  {
132  return procPolyPatch_.transform();
133  }
134 
135  //- Return delta (P to N) vectors across coupled patch
136  virtual tmp<vectorField> delta() const;
137 
138 
139  // Interface transfer functions
140 
141  //- Return the values of the given internal data adjacent to
142  // the interface as a field
144  (
145  const labelUList& internalData
146  ) const;
147 
148  //- Inherit initInternalFieldTransfer from coupledFvPatch
150 
151  //- Initialise neighbour field transfer
152  virtual void initInternalFieldTransfer
153  (
154  const Pstream::commsTypes commsType,
155  const labelUList& internalData
156  ) const;
157 
158  //- Return neighbour field
160  (
161  const Pstream::commsTypes commsType,
162  const labelUList& internalData
163  ) const;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Vector-tensor class used to perform translations and rotations in 3D space.
Definition: transformer.H:83
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
commsTypes
Types of communications.
Definition: UPstream.H:64
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
virtual int myProcNo() const
Return processor number.
An abstract base class for patches that couple regions of the computational domain e...
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:476
int myProcNo() const
Return processor number.
const processorPolyPatch & procPolyPatch() const
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 label comm() const
Return communicator used for communication.
void makeWeights(scalarField &) const
Make patch weighting factors.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:137
Processor patch.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
int neighbProcNo() const
Return neighbour processor number.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
An abstract base class for processor coupled interfaces.
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual const transformer & transform() const
Return null transform between processor patches.
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:399
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::fvBoundaryMesh.
A class for managing temporary objects.
Definition: PtrList.H:53
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual int tag() const
Return message tag used for sending.
virtual bool coupled() const
Return true if running parallel.
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.