|
|
|
facePointPatch.CGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 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 \*---------------------------------------------------------------------------*/ 00026 00027 #include "facePointPatch.H" 00028 #include "pointBoundaryMesh.H" 00029 #include "pointMesh.H" 00030 #include "demandDrivenData.H" 00031 #include "boolList.H" 00032 #include "addToRunTimeSelectionTable.H" 00033 00034 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00035 00036 namespace Foam 00037 { 00038 00039 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 00040 00041 defineTypeNameAndDebug(facePointPatch, 0); 00042 defineRunTimeSelectionTable(facePointPatch, polyPatch); 00043 00044 addToRunTimeSelectionTable 00045 ( 00046 facePointPatch, 00047 facePointPatch, 00048 polyPatch 00049 ); 00050 00051 00052 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // 00053 00054 void facePointPatch::initGeometry() 00055 { 00056 meshPoints_.setSize(0); 00057 localPoints_.setSize(0); 00058 pointNormals_.setSize(0); 00059 } 00060 00061 00062 void facePointPatch::calcGeometry() 00063 {} 00064 00065 00066 void facePointPatch::initMovePoints(const pointField&) 00067 {} 00068 00069 00070 void facePointPatch::movePoints(const pointField&) 00071 {} 00072 00073 00074 void facePointPatch::initUpdateMesh() 00075 { 00076 facePointPatch::initGeometry(); 00077 } 00078 00079 00080 void facePointPatch::updateMesh() 00081 {} 00082 00083 00084 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 00085 00086 facePointPatch::facePointPatch 00087 ( 00088 const polyPatch& p, 00089 const pointBoundaryMesh& bm 00090 ) 00091 : 00092 pointPatch(bm), 00093 polyPatch_(p) 00094 {} 00095 00096 00097 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00098 00099 const labelList& facePointPatch::meshPoints() const 00100 { 00101 if (meshPoints_.size()) 00102 { 00103 return meshPoints_; 00104 } 00105 else 00106 { 00107 return polyPatch_.meshPoints(); 00108 } 00109 } 00110 00111 00112 const pointField& facePointPatch::localPoints() const 00113 { 00114 if (meshPoints_.size()) 00115 { 00116 if (localPoints_.size() != meshPoints_.size()) 00117 { 00118 const labelList& meshPts = meshPoints(); 00119 00120 localPoints_.setSize(meshPts.size()); 00121 const pointField& points = polyPatch_.points(); 00122 00123 forAll (meshPts, pointi) 00124 { 00125 localPoints_[pointi] = points[meshPts[pointi]]; 00126 } 00127 } 00128 00129 return localPoints_; 00130 } 00131 else 00132 { 00133 return polyPatch_.localPoints(); 00134 } 00135 } 00136 00137 00138 const vectorField& facePointPatch::pointNormals() const 00139 { 00140 if (pointNormals_.size()) 00141 { 00142 return pointNormals_; 00143 } 00144 else 00145 { 00146 return polyPatch_.pointNormals(); 00147 } 00148 } 00149 00150 00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00152 00153 } // End namespace Foam 00154 00155 // ************************************************************************* // |