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