![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 processorFaPatch 00027 00028 Description 00029 Processor patch. 00030 00031 SourceFiles 00032 processorFaPatch.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef processorFaPatch_H 00037 #define processorFaPatch_H 00038 00039 #include "coupledFaPatch.H" 00040 #include "processorPolyPatch.H" 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 /*---------------------------------------------------------------------------*\ 00048 Class processorFaPatch Declaration 00049 \*---------------------------------------------------------------------------*/ 00050 00051 class processorFaPatch 00052 : 00053 public coupledFaPatch 00054 { 00055 // Private data 00056 00057 int myProcNo_; 00058 int neighbProcNo_; 00059 00060 //- Processor-neighbbour patch edge centres 00061 vectorField neighbEdgeCentres_; 00062 00063 //- Processor-neighbbour patch edge lengths 00064 vectorField neighbEdgeLengths_; 00065 00066 //- Processor-neighbbour patch neighbour face centres 00067 vectorField neighbEdgeFaceCentres_; 00068 00069 00070 protected: 00071 00072 // Protected Member functions 00073 00074 //- Make patch weighting factors 00075 void makeWeights(scalarField&) const; 00076 00077 //- Make patch face - neighbour cell distances 00078 void makeDeltaCoeffs(scalarField&) const; 00079 00080 00081 protected: 00082 00083 // Protected Member functions 00084 00085 //- Initialise the calculation of the patch geometry 00086 void initGeometry(); 00087 00088 //- Calculate the patch geometry 00089 void calcGeometry(); 00090 00091 //- Initialise the patches for moving points 00092 void initMovePoints(const pointField&); 00093 00094 //- Correct patches after moving points 00095 void movePoints(const pointField&); 00096 00097 00098 public: 00099 00100 //- Runtime type information 00101 TypeName(processorPolyPatch::typeName_()); 00102 00103 00104 // Constructors 00105 00106 //- Construct from dictionary 00107 processorFaPatch 00108 ( 00109 const word& name, 00110 const dictionary& dict, 00111 const label index, 00112 const faBoundaryMesh& bm 00113 ) 00114 : 00115 coupledFaPatch(name, dict, index, bm), 00116 myProcNo_(readLabel(dict.lookup("myProcNo"))), 00117 neighbProcNo_(readLabel(dict.lookup("neighbProcNo"))) 00118 00119 {} 00120 00121 00122 // Member functions 00123 00124 //- Return processor number 00125 int myProcNo() const 00126 { 00127 return myProcNo_; 00128 } 00129 00130 //- Return neigbour processor number 00131 int neighbProcNo() const 00132 { 00133 return neighbProcNo_; 00134 } 00135 00136 //- Return true if running parallel 00137 virtual bool coupled() const 00138 { 00139 if (Pstream::parRun()) 00140 { 00141 return true; 00142 } 00143 else 00144 { 00145 return false; 00146 } 00147 } 00148 00149 //- Return processor-neighbbour patch edge centres 00150 const vectorField& neighbEdgeCentres() const 00151 { 00152 return neighbEdgeCentres_; 00153 } 00154 00155 //- Return processor-neighbbour patch edge lengths 00156 const vectorField& neighbEdgeLengths() const 00157 { 00158 return neighbEdgeLengths_; 00159 } 00160 00161 //- Return processor-neighbbour patch neighbour face centres 00162 const vectorField& neighbEdgeFaceCentres() const 00163 { 00164 return neighbEdgeFaceCentres_; 00165 } 00166 00167 00168 //- Return delta (P to N) vectors across coupled patch 00169 tmp<vectorField> delta() const; 00170 }; 00171 00172 00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00174 00175 } // End namespace Foam 00176 00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00178 00179 #endif 00180 00181 // ************************************************************************* //