OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide 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-2009 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     Foam::coupledFvPatch
00027 
00028 Description
00029     An abstract base class for patches that couple regions of the
00030     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 Pstream::commsTypes commsType,
00149                 const unallocLabelList& interfaceData
00150             ) const
00151             {}
00152 
00153             //- Transfer and return neighbour field
00154             virtual tmp<labelField> transfer
00155             (
00156                 const Pstream::commsTypes commsType,
00157                 const unallocLabelList& interfaceData
00158             ) const = 0;
00159 
00160             //- Initialise neighbour field transfer
00161             virtual void initInternalFieldTransfer
00162             (
00163                 const Pstream::commsTypes commsType,
00164                 unallocLabelList& iF
00165             ) const
00166             {}
00167 
00168             //- Return neighbour field
00169             virtual tmp<labelField> internalFieldTransfer
00170             (
00171                 const Pstream::commsTypes commsType,
00172                 const unallocLabelList& iF
00173             ) const = 0;
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd