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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::processorFvPatch
28 
29 Description
30  Processor patch.
31 
32 SourceFiles
33  processorFvPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef processorFvPatch_H
38 #define processorFvPatch_H
39 
40 #include "coupledFvPatch.H"
41 #include "processorLduInterface.H"
42 #include "processorPolyPatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class processorFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class processorFvPatch
54 :
55  public coupledFvPatch,
57 {
58  // Private Data
59 
60  const processorPolyPatch& procPolyPatch_;
61 
62 
63 protected:
64 
65  // Protected Member functions
66 
67  //- Make patch weighting factors
68  void makeWeights(scalarField&) const;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName(processorPolyPatch::typeName_());
75 
76 
77  // Constructors
78 
79  //- Construct from components
81  :
82  coupledFvPatch(patch, bm),
83  procPolyPatch_(refCast<const processorPolyPatch>(patch))
84  {}
85 
86 
87  // Member functions
88 
89  //- Return communicator used for comms
90  virtual label comm() const
91  {
92  return procPolyPatch_.comm();
93  }
94 
95  //- Return processor number
96  virtual int myProcNo() const
97  {
98  return procPolyPatch_.myProcNo();
99  }
100 
101  //- Return neighbour processor number
102  virtual int neighbProcNo() const
103  {
104  return procPolyPatch_.neighbProcNo();
105  }
106 
107  //- Return message tag used for sending
108  virtual int tag() const
109  {
110  return UPstream::msgType();
111  }
112 
113  //- Return true if running parallel
114  virtual bool coupled() const
115  {
116  if (Pstream::parRun())
117  {
118  return true;
119  }
120  else
121  {
122  return false;
123  }
124  }
125 
126  const processorPolyPatch& procPolyPatch() const
127  {
128  return procPolyPatch_;
129  }
130 
131  //- Are the cyclic planes parallel
132  virtual bool parallel() const
133  {
134  return procPolyPatch_.parallel();
135  }
136 
137  //- Return face transformation tensor
138  virtual const tensorField& forwardT() const
139  {
140  return procPolyPatch_.forwardT();
141  }
142 
143  //- Return neighbour-cell transformation tensor.
144  virtual const tensorField& reverseT() const
145  {
146  return procPolyPatch_.reverseT();
147  }
148 
149  //- Return delta (P to N) vectors across coupled patch
150  virtual tmp<vectorField> delta() const;
151 
152 
153  // Interface transfer functions
154 
155  //- Return the values of the given internal data adjacent to
156  // the interface as a field
158  (
159  const labelUList& internalData
160  ) const;
161 
162  //- Inherit initInternalFieldTransfer from coupledFvPatch
164 
165  //- Initialise neighbour field transfer
166  virtual void initInternalFieldTransfer
167  (
168  const Pstream::commsTypes commsType,
169  const labelUList& internalData
170  ) const;
171 
172  //- Return neighbour field
174  (
175  const Pstream::commsTypes commsType,
176  const labelUList& internalData
177  ) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::coupledFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
Definition: coupledFvPatch.H:137
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::processorFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: processorFvPatch.H:131
Foam::processorLduInterface
An abstract base class for processor coupled interfaces.
Definition: processorLduInterface.H:53
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:296
Foam::UPstream::parRun
static bool & parRun()
Test if this a parallel run, or allow modify access.
Definition: UPstream.H:434
Foam::processorFvPatch::processorFvPatch
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
Definition: processorFvPatch.H:79
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:302
Foam::processorFvPatch
Processor patch.
Definition: processorFvPatch.H:52
Foam::processorPolyPatch::neighbProcNo
int neighbProcNo() const
Return neighbour processor number.
Definition: processorPolyPatch.H:274
Foam::processorFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: processorFvPatch.C:124
processorLduInterface.H
coupledFvPatch.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:56
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:290
Foam::processorFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorFvPatch.H:137
Foam::processorFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
Definition: processorFvPatch.C:114
Foam::processorFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: processorFvPatch.H:143
Foam::Field< scalar >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::processorFvPatch::procPolyPatch
const processorPolyPatch & procPolyPatch() const
Definition: processorFvPatch.H:125
Foam::processorFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: processorFvPatch.C:43
Foam::processorFvPatch::neighbProcNo
virtual int neighbProcNo() const
Return neighbour processor number.
Definition: processorFvPatch.H:101
Foam::processorFvPatch::TypeName
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::processorPolyPatch
Neighbour processor patch.
Definition: processorPolyPatch.H:58
Foam::processorFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: processorFvPatch.C:69
processorPolyPatch.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Foam::processorFvPatch::comm
virtual label comm() const
Return communicator used for comms.
Definition: processorFvPatch.H:89
Foam::UPstream::msgType
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:541
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::processorFvPatch::coupled
virtual bool coupled() const
Return true if running parallel.
Definition: processorFvPatch.H:113
Foam::processorPolyPatch::comm
virtual label comm() const
Return communicator used for communication.
Definition: processorPolyPatch.H:330
Foam::UList< label >
Foam::processorFvPatch::tag
virtual int tag() const
Return message tag used for sending.
Definition: processorFvPatch.H:107
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:161
Foam::processorPolyPatch::myProcNo
int myProcNo() const
Return processor number.
Definition: processorPolyPatch.H:268
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:53
Foam::processorFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: processorFvPatch.C:105
Foam::processorFvPatch::myProcNo
virtual int myProcNo() const
Return processor number.
Definition: processorFvPatch.H:95