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 
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),
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  }
123 
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 // ************************************************************************* //
Foam::coupledFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, labelUList &iF) const
Initialise neighbour field transfer.
Definition: coupledFvPatch.H:135
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::processorFvPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: processorFvPatch.H:129
Foam::processorLduInterface
An abstract base class for processor coupled interfaces.
Definition: processorLduInterface.H:50
Foam::coupledPolyPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: coupledPolyPatch.H:294
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:377
Foam::processorFvPatch::processorFvPatch
processorFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from components.
Definition: processorFvPatch.H:77
Foam::coupledPolyPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: coupledPolyPatch.H:300
Foam::processorFvPatch
Processor patch.
Definition: processorFvPatch.H:50
Foam::processorPolyPatch::neighbProcNo
int neighbProcNo() const
Return neigbour processor number.
Definition: processorPolyPatch.H:255
Foam::processorFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
Definition: processorFvPatch.C:122
processorLduInterface.H
coupledFvPatch.H
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:52
Foam::coupledPolyPatch::parallel
virtual bool parallel() const
Are the cyclic planes parallel.
Definition: coupledPolyPatch.H:288
Foam::processorFvPatch::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: processorFvPatch.H:135
Foam::processorFvPatch::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Initialise neighbour field transfer.
Definition: processorFvPatch.C:112
Foam::label
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
Foam::processorFvPatch::reverseT
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
Definition: processorFvPatch.H:141
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::processorFvPatch::procPolyPatch
const processorPolyPatch & procPolyPatch() const
Definition: processorFvPatch.H:123
Foam::processorFvPatch::makeWeights
void makeWeights(scalarField &) const
Make patch weighting factors.
Definition: processorFvPatch.C:41
Foam::processorFvPatch::neighbProcNo
virtual int neighbProcNo() const
Return neigbour processor number.
Definition: processorFvPatch.H:99
Foam::processorFvPatch::TypeName
TypeName(processorPolyPatch::typeName_())
Runtime type information.
Foam::processorPolyPatch
Neighbour processor patch.
Definition: processorPolyPatch.H:55
Foam::processorFvPatch::delta
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
Definition: processorFvPatch.C:67
processorPolyPatch.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Foam::processorFvPatch::comm
virtual label comm() const
Return communicator used for comms.
Definition: processorFvPatch.H:87
Foam::UPstream::msgType
static int & msgType()
Message tag of standard messages.
Definition: UPstream.H:452
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::processorFvPatch::coupled
virtual bool coupled() const
Return true if running parallel.
Definition: processorFvPatch.H:111
Foam::processorPolyPatch::comm
virtual label comm() const
Return communicator used for communication.
Definition: processorPolyPatch.H:303
Foam::UList
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
Foam::processorFvPatch::tag
virtual int tag() const
Return message tag used for sending.
Definition: processorFvPatch.H:105
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
Foam::processorPolyPatch::myProcNo
int myProcNo() const
Return processor number.
Definition: processorPolyPatch.H:249
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:51
Foam::processorFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: processorFvPatch.C:103
Foam::processorFvPatch::procPolyPatch_
const processorPolyPatch & procPolyPatch_
Definition: processorFvPatch.H:57
Foam::processorFvPatch::myProcNo
virtual int myProcNo() const
Return processor number.
Definition: processorFvPatch.H:93