![]() |
|
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 processorPointPatch 00027 00028 Description 00029 Processor patch boundary needs to be such that the ordering of 00030 points in the patch is the same on both sides. Looking at the 00031 creation of the faces on both sides of the processor patch they 00032 need to be identical on both sides with the normals pointing in 00033 opposite directions. This is achieved by calling the reverseFace 00034 function in the decomposition. It is therefore possible to 00035 re-create the ordering of patch points on the slave side by 00036 reversing all the patch faces of the owner. Warning: this will 00037 work only with the FOAM parallel decomposition tools - enforce the 00038 same in all other decomposition tools. 00039 00040 00041 SourceFiles 00042 processorPointPatch.C 00043 calcProcessorPointPatchAddr.C 00044 calcProcessorPointPatchPointAddr.C 00045 00046 \*---------------------------------------------------------------------------*/ 00047 00048 #ifndef processorPointPatch_H 00049 #define processorPointPatch_H 00050 00051 #include "facePointPatch.H" 00052 #include "processorPolyPatch.H" 00053 00054 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00055 00056 namespace Foam 00057 { 00058 00059 /*---------------------------------------------------------------------------*\ 00060 Class processorPointPatch Declaration 00061 \*---------------------------------------------------------------------------*/ 00062 00063 class processorPointPatch 00064 : 00065 public facePointPatch 00066 { 00067 // Private data 00068 00069 const processorPolyPatch& procPolyPatch_; 00070 00071 00072 // Calculation of point addressing is based on the master 00073 // patch. 00074 00075 // Demand driven private data 00076 00077 //- Mesh points 00078 mutable labelList* meshPointsPtr_; 00079 00080 00081 // Private Member Functions 00082 00083 //- Disallow default construct as copy 00084 processorPointPatch(const processorPointPatch&); 00085 00086 //- Disallow default assignment 00087 void operator=(const processorPointPatch&); 00088 00089 00090 // Construction of demand-driven data 00091 00092 //- Calculate mesh points 00093 void calcMeshPoints() const; 00094 00095 00096 public: 00097 00098 typedef pointBoundaryMesh BoundaryMesh; 00099 00100 00101 //- Runtime type information 00102 TypeName(processorPolyPatch::typeName_()); 00103 00104 00105 // Constructors 00106 00107 //- Construct from components 00108 processorPointPatch 00109 ( 00110 const polyPatch& patch, 00111 const pointBoundaryMesh& bm 00112 ); 00113 00114 00115 // Destructor 00116 00117 virtual ~processorPointPatch(); 00118 00119 00120 // Member functions 00121 00122 //- Return size 00123 virtual label size() const 00124 { 00125 return meshPoints().size(); 00126 } 00127 00128 //- Return true if running parallel 00129 virtual bool coupled() const 00130 { 00131 if (Pstream::parRun()) 00132 { 00133 return true; 00134 } 00135 else 00136 { 00137 return false; 00138 } 00139 } 00140 00141 //- Return processor number 00142 int myProcNo() const 00143 { 00144 return procPolyPatch_.myProcNo(); 00145 } 00146 00147 //- Return neigbour processor number 00148 int neighbProcNo() const 00149 { 00150 return procPolyPatch_.neighbProcNo(); 00151 } 00152 00153 //- Is this a master patch 00154 bool isMaster() const 00155 { 00156 return myProcNo() < neighbProcNo(); 00157 } 00158 00159 //- Is this a slave patch 00160 bool isSlave() const 00161 { 00162 return !isMaster(); 00163 } 00164 00165 // Access functions for demand driven data 00166 00167 //- Return mesh points 00168 virtual const labelList& meshPoints() const; 00169 00170 //- Return pointField of points in patch. Not impelemented. 00171 virtual const pointField& localPoints() const; 00172 00173 //- Return point unit normals. Not impelemented. 00174 virtual const vectorField& pointNormals() const; 00175 00176 //- Return list of edge indices for edges local to the patch 00177 // (i.e. connecting points within the patch) 00178 virtual const labelList& localEdgeIndices() const; 00179 00180 //- Return list of edge indices for cut edges 00181 // (i.e. connecting points within the patch ot points outside it) 00182 virtual const labelList& cutEdgeIndices() const; 00183 00184 00185 // Cut edge addressing 00186 00187 //- Return cut edge owner edge indices 00188 const labelList& cutEdgeOwnerIndices() const; 00189 00190 //- Return cut edge owner edge starts 00191 const labelList& cutEdgeOwnerStart() const; 00192 00193 //- Return cut edge neighbour edge indices 00194 const labelList& cutEdgeNeighbourIndices() const; 00195 00196 //- Return cut edge neighbour edge starts 00197 const labelList& cutEdgeNeighbourStart() const; 00198 00199 //- Return doubly cut edge indices 00200 const labelList& doubleCutEdgeIndices() const; 00201 00202 //- Return doubly cut edge owner addressing 00203 // into current patch 00204 const labelList& doubleCutOwner() const; 00205 00206 //- Return doubly cut edge neighbour addressing 00207 // into current patch 00208 const labelList& doubleCutNeighbour() const; 00209 00210 //- Return cut edge multiplication mask 00211 const scalarField& ownNeiDoubleMask() const; 00212 }; 00213 00214 00215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00216 00217 } // End namespace Foam 00218 00219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00220 00221 #endif 00222 00223 // ************************************************************************* //