1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::processorFvPatch
34 \*---------------------------------------------------------------------------*/
36 #ifndef processorFvPatch_H
37 #define processorFvPatch_H
39 #include "coupledFvPatch.H"
40 #include "processorLduInterface.H"
41 #include "processorPolyPatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class processorFvPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class processorFvPatch
54 public coupledFvPatch,
55 public processorLduInterface
59 const processorPolyPatch& procPolyPatch_;
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;
75 //- Runtime type information
76 TypeName(processorPolyPatch::typeName_());
81 //- Construct from components
82 processorFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
84 coupledFvPatch(patch, bm),
85 procPolyPatch_(refCast<const processorPolyPatch>(patch))
91 //- Return processor number
94 return procPolyPatch_.myProcNo();
97 //- Return neigbour processor number
98 int neighbProcNo() const
100 return procPolyPatch_.neighbProcNo();
103 //- Return true if running parallel
104 virtual bool coupled() const
106 if (Pstream::parRun())
116 //- Return face transformation tensor
117 virtual const tensorField& forwardT() const
119 return procPolyPatch_.forwardT();
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
132 const unallocLabelList& internalData
135 //- Initialise interface data transfer
136 virtual void initTransfer
138 const Pstream::commsTypes commsType,
139 const unallocLabelList& interfaceData
142 //- Transfer and return neighbour field
143 virtual tmp<labelField> transfer
145 const Pstream::commsTypes commsType,
146 const unallocLabelList& interfaceData
149 //- Initialise neighbour field transfer
150 virtual void initInternalFieldTransfer
152 const Pstream::commsTypes commsType,
153 const unallocLabelList& internalData
156 //- Return neighbour field
157 virtual tmp<labelField> internalFieldTransfer
159 const Pstream::commsTypes commsType,
160 const unallocLabelList& internalData
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 // ************************************************************************* //