00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 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 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your 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, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::coupledFvPatch 00026 00027 Description 00028 An abstract base class for patches that couple regions of the 00029 computational domain e.g. cyclic and processor-processor links. 00030 00031 SourceFiles 00032 coupledFvPatch.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef coupledFvPatch_H 00037 #define coupledFvPatch_H 00038 00039 #include <finiteVolume/fvPatch.H> 00040 #include <OpenFOAM/lduInterface.H> 00041 #include <OpenFOAM/coupledPolyPatch.H> 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class coupledFvPatch Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 class coupledFvPatch 00053 : 00054 public lduInterface, 00055 public fvPatch 00056 { 00057 // Private data 00058 00059 const coupledPolyPatch& coupledPolyPatch_; 00060 00061 00062 protected: 00063 00064 // Protected Member Functions 00065 00066 //- Make patch weighting factors 00067 virtual void makeWeights(scalarField&) const = 0; 00068 00069 //- Make patch face - neighbour cell distances 00070 virtual void makeDeltaCoeffs(scalarField&) const = 0; 00071 00072 00073 public: 00074 00075 friend class surfaceInterpolation; 00076 00077 00078 //- Runtime type information 00079 TypeName(coupledPolyPatch::typeName_()); 00080 00081 00082 // Constructors 00083 00084 //- Construct from polyPatch 00085 coupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) 00086 : 00087 fvPatch(patch, bm), 00088 coupledPolyPatch_(refCast<const coupledPolyPatch>(patch)) 00089 {} 00090 00091 00092 // Destructor 00093 00094 virtual ~coupledFvPatch(); 00095 00096 00097 // Member Functions 00098 00099 // Access 00100 00101 //- Return true because this patch is coupled 00102 virtual bool coupled() const 00103 { 00104 return coupledPolyPatch_.coupled(); 00105 } 00106 00107 //- Return face transformation tensor 00108 const tensorField& forwardT() const 00109 { 00110 return coupledPolyPatch_.forwardT(); 00111 } 00112 00113 //- Return neighbour-cell transformation tensor 00114 const tensorField& reverseT() const 00115 { 00116 return coupledPolyPatch_.reverseT(); 00117 } 00118 00119 //- Are the cyclic planes parallel 00120 bool parallel() const 00121 { 00122 return coupledPolyPatch_.parallel(); 00123 } 00124 00125 //- Return faceCell addressing 00126 virtual const unallocLabelList& faceCells() const 00127 { 00128 return fvPatch::faceCells(); 00129 } 00130 00131 //- Return delta (P to N) vectors across coupled patch 00132 virtual tmp<vectorField> delta() const = 0; 00133 00134 00135 // Interface transfer functions 00136 00137 //- Return the values of the given internal data adjacent to 00138 // the interface as a field 00139 virtual tmp<labelField> interfaceInternalField 00140 ( 00141 const unallocLabelList& internalData 00142 ) const = 0; 00143 00144 //- Initialise interface data transfer 00145 virtual void initTransfer 00146 ( 00147 const Pstream::commsTypes commsType, 00148 const unallocLabelList& interfaceData 00149 ) const 00150 {} 00151 00152 //- Transfer and return neighbour field 00153 virtual tmp<labelField> transfer 00154 ( 00155 const Pstream::commsTypes commsType, 00156 const unallocLabelList& interfaceData 00157 ) const = 0; 00158 00159 //- Initialise neighbour field transfer 00160 virtual void initInternalFieldTransfer 00161 ( 00162 const Pstream::commsTypes commsType, 00163 unallocLabelList& iF 00164 ) const 00165 {} 00166 00167 //- Return neighbour field 00168 virtual tmp<labelField> internalFieldTransfer 00169 ( 00170 const Pstream::commsTypes commsType, 00171 const unallocLabelList& iF 00172 ) const = 0; 00173 }; 00174 00175 00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00177 00178 } // End namespace Foam 00179 00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00181 00182 #endif 00183 00184 // ************************ vim: set sw=4 sts=4 et: ************************ //