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-2024 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  //- Reference to the processor polyPatch
59  const processorPolyPatch& procPolyPatch_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName(processorPolyPatch::typeName_());
66 
67 
68  // Constructors
69 
70  //- Construct from components
72  :
73  coupledFvPatch(patch, bm),
74  procPolyPatch_(refCast<const processorPolyPatch>(patch))
75  {}
76 
77 
78  // Member Functions
79 
80  //- Return communicator used for comms
81  virtual label comm() const
82  {
83  return procPolyPatch_.comm();
84  }
85 
86  //- Return processor number
87  virtual int myProcNo() const
88  {
89  return procPolyPatch_.myProcNo();
90  }
91 
92  //- Return neighbour processor number
93  virtual int neighbProcNo() const
94  {
95  return procPolyPatch_.neighbProcNo();
96  }
97 
98  //- Return message tag used for sending
99  virtual int tag() const
100  {
101  return UPstream::msgType();
102  }
103 
104  //- Return true if running parallel
105  virtual bool coupled() const
106  {
107  if (Pstream::parRun())
108  {
109  return true;
110  }
111  else
112  {
113  return false;
114  }
115  }
116 
117  //- Return transformation between the coupled patches
118  virtual const transformer& transform() const
119  {
120  return procPolyPatch_.transform();
121  }
122 
123  //- Make patch weighting factors
124  virtual void makeWeights(scalarField& w) const;
125 
126  //- Return delta (P to N) vectors across coupled patch
127  virtual tmp<vectorField> delta() const;
128 
129 
130  // Interface transfer functions
131 
132  //- Return the values of the given internal data adjacent to
133  // the interface as a field
135  (
136  const labelUList& internalData
137  ) const;
138 
139  //- Inherit initInternalFieldTransfer from coupledFvPatch
141 
142  //- Initialise neighbour field transfer
143  virtual void initInternalFieldTransfer
144  (
145  const Pstream::commsTypes commsType,
146  const labelUList& internalData
147  ) const;
148 
149  //- Return neighbour field
151  (
152  const Pstream::commsTypes commsType,
153  const labelUList& internalData
154  ) const;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:65
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:399
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:476
An abstract base class for patches that couple regions of the computational domain e....
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Inherit initInternalFieldTransfer from lduInterface.
Definition: lduInterface.H:95
Foam::fvBoundaryMesh.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:120
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual void makeWeights(scalarField &w) const
Make patch weighting factors.
virtual bool coupled() const
Return true if running parallel.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Inherit initInternalFieldTransfer from coupledFvPatch.
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
virtual const transformer & transform() const
Return transformation between the coupled patches.
virtual int myProcNo() const
Return processor number.
virtual label comm() const
Return communicator used for comms.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
virtual int tag() const
Return message tag used for sending.
virtual int neighbProcNo() const
Return neighbour processor number.
An abstract base class for processor coupled interfaces.
Neighbour processor patch.
int myProcNo() const
Return processor number.
int neighbProcNo() const
Return neighbour processor number.
virtual const transformer & transform() const
Return null transform between processor patches.
virtual label comm() const
Return communicator used for communication.
A class for managing temporary objects.
Definition: tmp.H:55
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
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
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129