initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fvMesh / fvPatches / constraint / processor / processorFvPatch.H
blob39113d3a5d3ef9b30f568101c3744de5ba158e08
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::processorFvPatch
28 Description
29     Processor patch.
31 SourceFiles
32     processorFvPatch.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef processorFvPatch_H
37 #define processorFvPatch_H
39 #include "coupledFvPatch.H"
40 #include "processorLduInterface.H"
41 #include "processorPolyPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class processorFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class processorFvPatch
54     public coupledFvPatch,
55     public processorLduInterface
57     // Private Data
59         const processorPolyPatch& procPolyPatch_;
62 protected:
64     // Protected Member functions
66         //- Make patch weighting factors
67         void makeWeights(scalarField&) const;
69         //- Make patch face - neighbour cell distances
70         void makeDeltaCoeffs(scalarField&) const;
73 public:
75     //- Runtime type information
76     TypeName(processorPolyPatch::typeName_());
79     // Constructors
81         //- Construct from components
82         processorFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
83         :
84             coupledFvPatch(patch, bm),
85             procPolyPatch_(refCast<const processorPolyPatch>(patch))
86         {}
89     // Member functions
91         //- Return processor number
92         int myProcNo() const
93         {
94             return procPolyPatch_.myProcNo();
95         }
97         //- Return neigbour processor number
98         int neighbProcNo() const
99         {
100             return procPolyPatch_.neighbProcNo();
101         }
103         //- Return true if running parallel
104         virtual bool coupled() const
105         {
106             if (Pstream::parRun())
107             {
108                 return true;
109             }
110             else
111             {
112                 return false;
113             }
114         }
116         //- Return face transformation tensor
117         virtual const tensorField& forwardT() const
118         {
119             return procPolyPatch_.forwardT();
120         }
122         //- Return delta (P to N) vectors across coupled patch
123         tmp<vectorField> delta() const;
126         // Interface transfer functions
128             //- Return the values of the given internal data adjacent to
129             //  the interface as a field
130             virtual tmp<labelField> interfaceInternalField
131             (
132                 const unallocLabelList& internalData
133             ) const;
135             //- Initialise interface data transfer
136             virtual void initTransfer
137             (
138                 const Pstream::commsTypes commsType,
139                 const unallocLabelList& interfaceData
140             ) const;
142             //- Transfer and return neighbour field
143             virtual tmp<labelField> transfer
144             (
145                 const Pstream::commsTypes commsType,
146                 const unallocLabelList& interfaceData
147             ) const;
149             //- Initialise neighbour field transfer
150             virtual void initInternalFieldTransfer
151             (
152                 const Pstream::commsTypes commsType,
153                 const unallocLabelList& internalData
154             ) const;
156             //- Return neighbour field
157             virtual tmp<labelField> internalFieldTransfer
158             (
159                 const Pstream::commsTypes commsType,
160                 const unallocLabelList& internalData
161             ) const;
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 #endif
173 // ************************************************************************* //