coupledFvPatch.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::coupledFvPatch
26 
27 Description
28  An abstract base class for patches that couple regions of the
29  computational domain e.g. cyclic and processor-processor links.
30 
31 SourceFiles
32  coupledFvPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef coupledFvPatch_H
37 #define coupledFvPatch_H
38 
39 #include "fvPatch.H"
40 #include "lduInterface.H"
41 #include "coupledPolyPatch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class coupledFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class coupledFvPatch
53 :
54  public lduInterface,
55  public fvPatch
56 {
57  // Private data
58 
60 
61 
62 protected:
63 
64  // Protected Member Functions
65 
66  //- Make patch weighting factors
67  virtual void makeWeights(scalarField&) const = 0;
68 
69 
70 public:
71 
72  friend class surfaceInterpolation;
73 
74 
75  //- Runtime type information
76  TypeName(coupledPolyPatch::typeName_());
77 
78 
79  // Constructors
80 
81  //- Construct from polyPatch
82  coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
83  :
84  fvPatch(patch, bm),
86  {}
87 
88 
89  //- Destructor
90  virtual ~coupledFvPatch();
91 
92 
93  // Member Functions
94 
95  // Access
96 
97  //- Return true because this patch is coupled
98  virtual bool coupled() const
99  {
100  return coupledPolyPatch_.coupled();
101  }
102 
103  //- Are the cyclic planes parallel.
104  virtual bool parallel() const = 0;
105 
106  //- Return face transformation tensor.
107  virtual const tensorField& forwardT() const = 0;
108 
109  //- Return neighbour-cell transformation tensor.
110  virtual const tensorField& reverseT() const = 0;
111 
112  //- Return faceCell addressing
113  virtual const labelUList& faceCells() const
114  {
115  return fvPatch::faceCells();
116  }
117 
118  //- Return delta (P to N) vectors across coupled patch
119  virtual tmp<vectorField> delta() const = 0;
120 
121 
122  // Interface transfer functions
123 
124  //- Return the values of the given internal data adjacent to
125  // the interface as a field
127  (
128  const labelUList& internalData
129  ) const = 0;
130 
131  //- Inherit initInternalFieldTransfer from lduInterface
133 
134  //- Initialise neighbour field transfer
136  (
137  const Pstream::commsTypes commsType,
138  labelUList& iF
139  ) const
140  {}
141 
142  //- Return neighbour field
144  (
145  const Pstream::commsTypes commsType,
146  const labelUList& iF
147  ) const = 0;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
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::coupledFvPatch::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const =0
Return the values of the given internal data adjacent to.
Foam::coupledFvPatch::TypeName
TypeName(coupledPolyPatch::typeName_())
Runtime type information.
Foam::coupledFvPatch::delta
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
Definition: coupledFvPatch.C:44
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:53
Foam::coupledFvPatch::~coupledFvPatch
virtual ~coupledFvPatch()
Destructor.
Definition: coupledFvPatch.C:38
Foam::coupledFvPatch::parallel
virtual bool parallel() const =0
Are the cyclic planes parallel.
Foam::coupledFvPatch::coupledFvPatch
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
Definition: coupledFvPatch.H:81
Foam::coupledFvPatch::coupledPolyPatch_
const coupledPolyPatch & coupledPolyPatch_
Definition: coupledFvPatch.H:58
Foam::coupledPolyPatch
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
Definition: coupledPolyPatch.H:51
Foam::lduInterface::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise transfer of internal field adjacent to the interface.
Definition: lduInterface.H:100
Foam::fvBoundaryMesh
Foam::fvBoundaryMesh.
Definition: fvBoundaryMesh.H:52
Foam::coupledFvPatch::coupled
virtual bool coupled() const
Return true because this patch is coupled.
Definition: coupledFvPatch.H:97
coupledPolyPatch.H
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::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::coupledFvPatch::forwardT
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
Foam::coupledFvPatch::makeWeights
virtual void makeWeights(scalarField &) const =0
Make patch weighting factors.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::refCast
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:106
Foam::coupledFvPatch::reverseT
virtual const tensorField & reverseT() const =0
Return neighbour-cell transformation tensor.
Foam::coupledFvPatch::faceCells
virtual const labelUList & faceCells() const
Return faceCell addressing.
Definition: coupledFvPatch.H:112
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
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::surfaceInterpolation
Cell to surface interpolation scheme. Included in fvMesh.
Definition: surfaceInterpolation.H:52
Foam::coupledPolyPatch::coupled
virtual bool coupled() const
Return true because this patch is coupled.
Definition: coupledPolyPatch.H:241
Foam::fvPatch::faceCells
virtual const labelUList & faceCells() const
Return faceCells.
Definition: fvPatch.C:93
Foam::fvPatch::patch
const polyPatch & patch() const
Return the polyPatch.
Definition: fvPatch.H:143
fvPatch.H
Foam::coupledFvPatch
An abstract base class for patches that couple regions of the computational domain e....
Definition: coupledFvPatch.H:51
lduInterface.H
Foam::coupledFvPatch::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const =0
Return neighbour field.