Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / finiteVolume / fvMesh / fvPatches / constraint / processor / processorFvPatch.H
blob27dfcd843a8b06542aebdba7cf0a6897acbb681c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::processorFvPatch
27 Description
28     Processor patch.
30 SourceFiles
31     processorFvPatch.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef processorFvPatch_H
36 #define processorFvPatch_H
38 #include "coupledFvPatch.H"
39 #include "processorLduInterface.H"
40 #include "processorPolyPatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                            Class processorFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 class processorFvPatch
53     public coupledFvPatch,
54     public processorLduInterface
56     // Private Data
58         const processorPolyPatch& procPolyPatch_;
61 protected:
63     // Protected Member functions
65         //- Make patch weighting factors
66         void makeWeights(scalarField&) const;
68         //- Make patch face - neighbour cell distances
69         void makeDeltaCoeffs(scalarField&) const;
72 public:
74     //- Runtime type information
75     TypeName(processorPolyPatch::typeName_());
78     // Constructors
80         //- Construct from components
81         processorFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
82         :
83             coupledFvPatch(patch, bm),
84             procPolyPatch_(refCast<const processorPolyPatch>(patch))
85         {}
88     // Member functions
90         //- Return processor number
91         int myProcNo() const
92         {
93             return procPolyPatch_.myProcNo();
94         }
96         //- Return neigbour processor number
97         int neighbProcNo() const
98         {
99             return procPolyPatch_.neighbProcNo();
100         }
102         //- Return message tag used for sending
103         virtual int tag() const
104         {
105             return UPstream::msgType();
106         }
108         //- Return true if running parallel
109         virtual bool coupled() const
110         {
111             if (Pstream::parRun())
112             {
113                 return true;
114             }
115             else
116             {
117                 return false;
118             }
119         }
121         const processorPolyPatch& procPolyPatch() const
122         {
123             return procPolyPatch_;
124         }
126         //- Are the cyclic planes parallel
127         virtual bool parallel() const
128         {
129             return procPolyPatch_.parallel();
130         }
132         //- Return face transformation tensor
133         virtual const tensorField& forwardT() const
134         {
135             return procPolyPatch_.forwardT();
136         }
138         //- Return neighbour-cell transformation tensor.
139         virtual const tensorField& reverseT() const
140         {
141             return procPolyPatch_.reverseT();
142         }
144         //- Return delta (P to N) vectors across coupled patch
145         virtual tmp<vectorField> delta() const;
148         // Interface transfer functions
150             //- Return the values of the given internal data adjacent to
151             //  the interface as a field
152             virtual tmp<labelField> interfaceInternalField
153             (
154                 const labelUList& internalData
155             ) const;
157             //- Initialise neighbour field transfer
158             virtual void initInternalFieldTransfer
159             (
160                 const Pstream::commsTypes commsType,
161                 const labelUList& internalData
162             ) const;
164             //- Return neighbour field
165             virtual tmp<labelField> internalFieldTransfer
166             (
167                 const Pstream::commsTypes commsType,
168                 const labelUList& internalData
169             ) const;
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //