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::pointMesh 00026 00027 Description 00028 Mesh representing a set of points created from polyMesh. 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #ifndef pointMesh_H 00033 #define pointMesh_H 00034 00035 #include <OpenFOAM/GeoMesh.H> 00036 #include <OpenFOAM/MeshObject.H> 00037 #include <OpenFOAM/polyMesh.H> 00038 #include <OpenFOAM/pointBoundaryMesh.H> 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class pointMesh Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 class pointMesh 00050 : 00051 public MeshObject<polyMesh, pointMesh>, 00052 public GeoMesh<polyMesh> 00053 { 00054 // Permanent data 00055 00056 //- Boundary mesh 00057 pointBoundaryMesh boundary_; 00058 00059 00060 // Private Member Functions 00061 00062 //- Map all fields 00063 void mapFields(const mapPolyMesh&); 00064 00065 //- Disallow default bitwise copy construct 00066 pointMesh(const pointMesh&); 00067 00068 //- Disallow default bitwise assignment 00069 void operator=(const pointMesh&); 00070 00071 00072 public: 00073 00074 typedef pointMesh Mesh; 00075 typedef pointBoundaryMesh BoundaryMesh; 00076 00077 00078 // Constructors 00079 00080 //- Construct from polyMesh 00081 explicit pointMesh 00082 ( 00083 const polyMesh& pMesh, 00084 bool alwaysConstructGlobalPatch = false 00085 ); 00086 00087 00088 // Member Functions 00089 00090 //- Return number of points 00091 label size() const 00092 { 00093 return size(*this); 00094 } 00095 00096 //- Return number of points 00097 static label size(const Mesh& mesh) 00098 { 00099 return mesh.GeoMesh<polyMesh>::mesh_.nPoints(); 00100 } 00101 00102 //- Return reference to boundary mesh 00103 const pointBoundaryMesh& boundary() const 00104 { 00105 return boundary_; 00106 } 00107 00108 //- Return parallel info 00109 const globalMeshData& globalData() const 00110 { 00111 return GeoMesh<polyMesh>::mesh_.globalData(); 00112 } 00113 00114 //- Return database. For now is its polyMesh. 00115 const objectRegistry& thisDb() const 00116 { 00117 return GeoMesh<polyMesh>::mesh_.thisDb(); 00118 } 00119 00120 00121 // Mesh motion 00122 00123 //- Move points, returns volumes swept by faces in motion 00124 void movePoints(const pointField&); 00125 00126 //- Update the mesh corresponding to given map 00127 void updateMesh(const mapPolyMesh& mpm); 00128 00129 00130 // Member Operators 00131 00132 bool operator!=(const pointMesh& pm) const 00133 { 00134 return &pm != this; 00135 } 00136 00137 bool operator==(const pointMesh& pm) const 00138 { 00139 return &pm == this; 00140 } 00141 }; 00142 00143 00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00145 00146 } // End namespace Foam 00147 00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00149 00150 #endif 00151 00152 // ************************ vim: set sw=4 sts=4 et: ************************ //