OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

coupledFvPatch.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     coupledFvPatch
00027 
00028 Description
00029     coupledFvPatch is an abstract base class for patches that couple regions
00030     of the computational domain e.g. cyclic and processor-processor links.
00031 
00032 SourceFiles
00033     coupledFvPatch.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef coupledFvPatch_H
00038 #define coupledFvPatch_H
00039 
00040 #include "fvPatch.H"
00041 #include "lduInterface.H"
00042 #include "coupledPolyPatch.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                          Class coupledFvPatch Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class coupledFvPatch
00054 :
00055     public lduInterface,
00056     public fvPatch
00057 {
00058     // Private data
00059 
00060         const coupledPolyPatch& coupledPolyPatch_;
00061 
00062 
00063 protected:
00064 
00065     // Protected Member Functions
00066 
00067         //- Make patch weighting factors
00068         virtual void makeWeights(scalarField&) const = 0;
00069 
00070         //- Make patch face - neighbour cell distances
00071         virtual void makeDeltaCoeffs(scalarField&) const = 0;
00072 
00073 
00074 public:
00075 
00076     friend class surfaceInterpolation;
00077 
00078 
00079     //- Runtime type information
00080     TypeName(coupledPolyPatch::typeName_());
00081 
00082 
00083     // Constructors
00084 
00085         //- Construct from polyPatch
00086         coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
00087         :
00088             fvPatch(patch, bm),
00089             coupledPolyPatch_(refCast<const coupledPolyPatch>(patch))
00090         {}
00091 
00092 
00093     // Destructor
00094 
00095         virtual ~coupledFvPatch();
00096 
00097 
00098     // Member Functions
00099 
00100         // Access
00101 
00102             //- Return true because this patch is coupled
00103             virtual bool coupled() const
00104             {
00105                 return coupledPolyPatch_.coupled();
00106             }
00107 
00108             //- Return face transformation tensor
00109             const tensorField& forwardT() const
00110             {
00111                 return coupledPolyPatch_.forwardT();
00112             }
00113 
00114             //- Return neighbour-cell transformation tensor
00115             const tensorField& reverseT() const
00116             {
00117                 return coupledPolyPatch_.reverseT();
00118             }
00119 
00120             //- Are the cyclic planes parallel
00121             bool parallel() const
00122             {
00123                 return coupledPolyPatch_.parallel();
00124             }
00125 
00126             //- Return faceCell addressing
00127             virtual const unallocLabelList& faceCells() const
00128             {
00129                 return fvPatch::faceCells();
00130             }
00131 
00132             //- Return delta (P to N) vectors across coupled patch
00133             virtual tmp<vectorField> delta() const = 0;
00134 
00135 
00136         // Interface transfer functions
00137 
00138             //- Return the values of the given internal data adjacent to
00139             //  the interface as a field
00140             virtual tmp<labelField> interfaceInternalField
00141             (
00142                 const unallocLabelList& internalData
00143             ) const = 0;
00144 
00145             //- Initialise interface data transfer
00146             virtual void initTransfer
00147             (
00148                 const unallocLabelList& interfaceData,
00149                 const bool bufferedTransfer
00150             ) const
00151             {}
00152 
00153             //- Transfer and return neighbour field
00154             virtual tmp<labelField> transfer
00155             (
00156                 const unallocLabelList& interfaceData
00157             ) const = 0;
00158 
00159             //- Initialise neighbour field transfer
00160             virtual void initInternalFieldTransfer
00161             (
00162                 unallocLabelList& iF,
00163                 const bool bufferedTransfer
00164             ) const
00165             {}
00166 
00167             //- Return neighbour field
00168             virtual tmp<labelField> internalFieldTransfer
00169             (
00170                 const unallocLabelList& iF
00171             ) const = 0;
00172 };
00173 
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 } // End namespace Foam
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #endif
00182 
00183 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd