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 | Copyright (C) 2011-2015 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 neigbour 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  //- Are the cyclic planes parallel
130  virtual bool parallel() const
131  {
132  return procPolyPatch_.parallel();
133  }
134 
135  //- Return face transformation tensor
136  virtual const tensorField& forwardT() const
137  {
138  return procPolyPatch_.forwardT();
139  }
140 
141  //- Return neighbour-cell transformation tensor.
142  virtual const tensorField& reverseT() const
143  {
144  return procPolyPatch_.reverseT();
145  }
146 
147  //- Return delta (P to N) vectors across coupled patch
148  virtual tmp<vectorField> delta() const;
149 
150 
151  // Interface transfer functions
152 
153  //- Return the values of the given internal data adjacent to
154  // the interface as a field
156  (
157  const labelUList& internalData
158  ) const;
159 
160  //- Inherit initInternalFieldTransfer from coupledFvPatch
162 
163  //- Initialise neighbour field transfer
164  virtual void initInternalFieldTransfer
165  (
166  const Pstream::commsTypes commsType,
167  const labelUList& internalData
168  ) const;
169 
170  //- Return neighbour field
172  (
173  const Pstream::commsTypes commsType,
174  const labelUList& internalData
175  ) const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
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
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
commsTypes
Types of communications.
Definition: UPstream.H:64
int neighbProcNo() const
Return neigbour processor number.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
An abstract base class for patches that couple regions of the computational domain e...
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:464
virtual bool parallel() const
Are the cyclic planes parallel.
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
int myProcNo() const
Return processor number.
Neighbour processor patch.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual int neighbProcNo() const
Return neigbour processor number.
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
const processorPolyPatch & procPolyPatch() const
Processor patch.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
virtual bool parallel() const
Are the cyclic planes parallel.
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 tensorField & forwardT() const
Return face transformation tensor.
virtual int myProcNo() const
Return processor number.
virtual int tag() const
Return message tag used for sending.
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:393
virtual label comm() const
Return communicator used for comms.
TypeName(processorPolyPatch::typeName_())
Runtime type information.
void makeWeights(scalarField &) const
Make patch weighting factors.
Foam::fvBoundaryMesh.
virtual label comm() const
Return communicator used for communication.
virtual const tensorField & forwardT() const
Return face transformation tensor.
A class for managing temporary objects.
Definition: PtrList.H:54
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
virtual bool coupled() const
Return true if running parallel.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Namespace for OpenFOAM.