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::processorPointPatch 00026 00027 Description 00028 Processor patch boundary needs to be such that the ordering of 00029 points in the patch is the same on both sides. 00030 00031 Looking at the creation of the faces on both sides of the processor 00032 patch they need to be identical on both sides with the normals pointing 00033 in opposite directions. This is achieved by calling the reverseFace 00034 function in the decomposition. It is therefore possible to re-create 00035 the ordering of patch points on the slave side by reversing all the 00036 patch faces of the owner. 00037 00038 SourceFiles 00039 processorPointPatch.C 00040 00041 \*---------------------------------------------------------------------------*/ 00042 00043 #ifndef processorPointPatch_H 00044 #define processorPointPatch_H 00045 00046 #include <OpenFOAM/coupledFacePointPatch.H> 00047 #include <OpenFOAM/processorPolyPatch.H> 00048 00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00050 00051 namespace Foam 00052 { 00053 00054 /*---------------------------------------------------------------------------*\ 00055 Class processorPointPatch Declaration 00056 \*---------------------------------------------------------------------------*/ 00057 00058 class processorPointPatch 00059 : 00060 public coupledFacePointPatch 00061 { 00062 // Private data 00063 00064 const processorPolyPatch& procPolyPatch_; 00065 00066 00067 // Private Member Functions 00068 00069 //- Initialise the calculation of the patch geometry 00070 virtual void initGeometry(); 00071 00072 //- Calculate the patch geometry 00073 virtual void calcGeometry(); 00074 00075 //- Initialise the points on this patch which are should also be 00076 // on a neighbouring patch but are not part of faces of that patch 00077 void initPatchPatchPoints(); 00078 00079 //- Calculate the points on this patch which are should also be 00080 // on a neighbouring patch but are not part of faces of that patch 00081 void calcPatchPatchPoints(); 00082 00083 //- Initialise the patches for moving points 00084 virtual void initMovePoints(const pointField&); 00085 00086 //- Correct patches after moving points 00087 virtual void movePoints(const pointField&); 00088 00089 //- Initialise the update of the patch topology 00090 virtual void initUpdateMesh(); 00091 00092 //- Update of the patch topology 00093 virtual void updateMesh(); 00094 00095 00096 //- Disallow default construct as copy 00097 processorPointPatch(const processorPointPatch&); 00098 00099 //- Disallow default assignment 00100 void operator=(const processorPointPatch&); 00101 00102 public: 00103 00104 //- Runtime type information 00105 TypeName(processorPolyPatch::typeName_()); 00106 00107 00108 // Constructors 00109 00110 //- Construct from components 00111 processorPointPatch 00112 ( 00113 const polyPatch& patch, 00114 const pointBoundaryMesh& bm 00115 ); 00116 00117 00118 // Destructor 00119 00120 virtual ~processorPointPatch(); 00121 00122 00123 // Member functions 00124 00125 //- Return true if running parallel 00126 virtual bool coupled() const 00127 { 00128 if (Pstream::parRun()) 00129 { 00130 return true; 00131 } 00132 else 00133 { 00134 return false; 00135 } 00136 } 00137 00138 //- Return processor number 00139 int myProcNo() const 00140 { 00141 return procPolyPatch_.myProcNo(); 00142 } 00143 00144 //- Return neigbour processor number 00145 int neighbProcNo() const 00146 { 00147 return procPolyPatch_.neighbProcNo(); 00148 } 00149 00150 //- Is this a master patch 00151 bool isMaster() const 00152 { 00153 return myProcNo() < neighbProcNo(); 00154 } 00155 00156 //- Is this a slave patch 00157 bool isSlave() const 00158 { 00159 return !isMaster(); 00160 } 00161 00162 //- Return the underlying processorPolyPatch 00163 const processorPolyPatch& procPolyPatch() const 00164 { 00165 return procPolyPatch_; 00166 } 00167 }; 00168 00169 00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00171 00172 } // End namespace Foam 00173 00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00175 00176 #endif 00177 00178 // ************************ vim: set sw=4 sts=4 et: ************************ //