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::facePointPatch 00026 00027 Description 00028 A pointPatch based on a polyPatch 00029 00030 SourceFiles 00031 facePointPatch.C 00032 facePointPatchM.C 00033 newPointPatch.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef facePointPatch_H 00038 #define facePointPatch_H 00039 00040 #include <OpenFOAM/pointPatch.H> 00041 #include <OpenFOAM/polyPatch.H> 00042 #include <OpenFOAM/autoPtr.H> 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 class processorPointPatch; 00050 class cyclicPointPatch; 00051 00052 /*---------------------------------------------------------------------------*\ 00053 Class facePointPatch Declaration 00054 \*---------------------------------------------------------------------------*/ 00055 00056 class facePointPatch 00057 : 00058 public pointPatch 00059 { 00060 protected: 00061 00062 // Protected data 00063 00064 //- Reference to the underlying polyPatch 00065 const polyPatch& polyPatch_; 00066 00067 // Optional data used if the pointPatch has points not associated 00068 // with faces, i.e. not accessible via polyPatch 00069 00070 mutable labelList meshPoints_; 00071 mutable pointField localPoints_; 00072 mutable vectorField pointNormals_; 00073 00074 00075 // Protected Member Functions 00076 00077 //- Initialise the calculation of the patch geometry 00078 virtual void initGeometry(); 00079 00080 //- Calculate the patch geometry 00081 virtual void calcGeometry(); 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 private: 00097 00098 // Private Member Functions 00099 00100 //- Disallow default bitwise copy construct 00101 facePointPatch(const facePointPatch&); 00102 00103 //- Disallow default bitwise assignment 00104 void operator=(const facePointPatch&); 00105 00106 00107 public: 00108 00109 // Declare friendship with the coupledPointPatches to allow them to extend 00110 // the set of points with those not associated with faces 00111 friend class processorPointPatch; 00112 friend class cyclicPointPatch; 00113 00114 00115 //- Runtime type information 00116 TypeName(polyPatch::typeName_()); 00117 00118 00119 // Declare run-time constructor selection tables 00120 00121 declareRunTimeSelectionTable 00122 ( 00123 autoPtr, 00124 facePointPatch, 00125 polyPatch, 00126 (const polyPatch& patch, const pointBoundaryMesh& bm), 00127 (patch, bm) 00128 ); 00129 00130 00131 // Constructors 00132 00133 //- Construct from polyPatch 00134 facePointPatch 00135 ( 00136 const polyPatch&, 00137 const pointBoundaryMesh& 00138 ); 00139 00140 00141 // Selectors 00142 00143 //- Return a pointer to a new patch created on freestore from polyPatch 00144 static autoPtr<facePointPatch> New 00145 ( 00146 const polyPatch&, 00147 const pointBoundaryMesh& 00148 ); 00149 00150 00151 // Destructor 00152 00153 virtual ~facePointPatch() 00154 {} 00155 00156 00157 // Member Functions 00158 00159 //- Return the polyPatch 00160 const polyPatch& patch() const 00161 { 00162 return polyPatch_; 00163 } 00164 00165 //- Return name 00166 virtual const word& name() const 00167 { 00168 return polyPatch_.name(); 00169 } 00170 00171 //- Return size 00172 virtual label size() const 00173 { 00174 return meshPoints().size(); 00175 } 00176 00177 //- Return the index of this patch in the pointBoundaryMesh 00178 virtual label index() const 00179 { 00180 return polyPatch_.index(); 00181 } 00182 00183 //- Return mesh points 00184 virtual const labelList& meshPoints() const; 00185 00186 //- Return pointField of points in patch 00187 virtual const pointField& localPoints() const; 00188 00189 //- Return point unit normals 00190 virtual const vectorField& pointNormals() const; 00191 }; 00192 00193 00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00195 00196 } // End namespace Foam 00197 00198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00199 00200 #endif 00201 00202 // ************************ vim: set sw=4 sts=4 et: ************************ //