MOAB: Mesh Oriented datABase
(version 5.4.1)
|
00001 /* ***************************************************************** 00002 MESQUITE -- The Mesh Quality Improvement Toolkit 00003 00004 Copyright 2006 Lawrence Livermore National Laboratory. Under 00005 the terms of Contract B545069 with the University of Wisconsin -- 00006 Madison, Lawrence Livermore National Laboratory retains certain 00007 rights in this software. 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 (lgpl.txt) along with this library; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00023 (2006) [email protected] 00024 00025 ***************************************************************** */ 00026 00027 #ifndef MSQ_VERTEX_PATCHES_HPP 00028 #define MSQ_VERTEX_PATCHES_HPP 00029 00030 /** \file VertexPatches.hpp 00031 * \brief 00032 * \author Jason Kraftcheck 00033 */ 00034 00035 #include "Mesquite.hpp" 00036 #include "PatchSet.hpp" 00037 00038 namespace MBMesquite 00039 { 00040 00041 /**\brief A PatchSet representing a decomposition of the mesh 00042 * into patches containing a single free vertex and the 00043 * adjacent elements 00044 */ 00045 class VertexPatches : public PatchSet 00046 { 00047 public: 00048 /**\brief constructor 00049 *\param num_layers Number of layers of elements adjacent to each vertex 00050 *\param free_vertices_only Skip fixed vertices if true. 00051 */ 00052 inline VertexPatches( unsigned p_num_layers = 1, bool p_free_vertices_only = true ) 00053 : numLayers( p_num_layers ), freeVertices( p_free_vertices_only ) 00054 { 00055 } 00056 00057 MESQUITE_EXPORT 00058 ~VertexPatches(); 00059 00060 /**\brief Set number of layers of elements adjacent to each vertex */ 00061 inline void set_num_layers( unsigned num_layers ) 00062 { 00063 numLayers = num_layers; 00064 } 00065 00066 /**\brief Get number of layers of elements adjacent to each vertex */ 00067 inline unsigned get_num_layers() const 00068 { 00069 return numLayers; 00070 } 00071 00072 /**\brief Skip fixed vertices if true. */ 00073 inline void free_vertices_only( bool yesno ) 00074 { 00075 freeVertices = yesno; 00076 } 00077 00078 /**\brief Skip fixed vertices if true. */ 00079 inline bool free_vertices_only() const 00080 { 00081 return freeVertices; 00082 } 00083 00084 /**\brief Get a list of handles, one for each patch */ 00085 MESQUITE_EXPORT 00086 virtual void get_patch_handles( std::vector< PatchHandle >& patch_handles_out, MsqError& err ); 00087 00088 /**\brief Get the mesh entities in a patch 00089 * 00090 * Given one of the handles returned by get_patch_handles(), 00091 * return the mesh entities in the corresponding patch. If 00092 * only free vertices are to be returned, this funtion will return 00093 * empty lists for culled vertices. 00094 * 00095 *\param patch_handle one of the handles returned by get_patch_handles() 00096 *\param elem_handles_out the list of elements in the mesh 00097 *\param free_vertices_out the list of vertices interior to the patch 00098 */ 00099 MESQUITE_EXPORT 00100 virtual void get_patch( PatchHandle patch_handle, 00101 std::vector< Mesh::ElementHandle >& elem_handles_out, 00102 std::vector< Mesh::VertexHandle >& free_vertices_out, 00103 MsqError& err ); 00104 00105 private: 00106 std::vector< size_t > junk; 00107 00108 unsigned numLayers; //!< number of layers of adjacent elements 00109 bool freeVertices; //!< skip fixed vertices if true 00110 }; 00111 00112 } // namespace MBMesquite 00113 00114 #endif