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-2022 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  virtual void makeWeights(scalarField& w) 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  }
123 
124  //- Return transformation between the coupled patches
125  virtual const transformer& transform() const
126  {
127  return procPolyPatch_.transform();
128  }
129 
130  //- Return delta (P to N) vectors across coupled patch
131  virtual tmp<vectorField> delta() const;
132 
133 
134  // Interface transfer functions
135 
136  //- Return the values of the given internal data adjacent to
137  // the interface as a field
139  (
140  const labelUList& internalData
141  ) const;
142 
143  //- Inherit initInternalFieldTransfer from coupledFvPatch
145 
146  //- Initialise neighbour field transfer
147  virtual void initInternalFieldTransfer
148  (
149  const Pstream::commsTypes commsType,
150  const labelUList& internalData
151  ) const;
152 
153  //- Return neighbour field
155  (
156  const Pstream::commsTypes commsType,
157  const labelUList& internalData
158  ) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Vector-tensor class used to perform translations, rotations and scaling operations 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.
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.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:139
Processor patch.
virtual void makeWeights(scalarField &w) const
Make patch weighting factors.
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.