MOAB: Mesh Oriented datABase  (version 5.4.1)
PatchSet.hpp
Go to the documentation of this file.
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_PATCH_SET_HPP
00028 #define MSQ_PATCH_SET_HPP
00029 
00030 /** \file PatchSet.hpp
00031  *  \brief
00032  *  \author Jason Kraftcheck
00033  */
00034 
00035 #include <vector>
00036 
00037 #include "Mesquite.hpp"
00038 #include "MeshInterface.hpp"
00039 
00040 namespace MBMesquite
00041 {
00042 
00043 class MsqError;
00044 
00045 /**\brief Specify a division of the Mesh into working patches
00046  *
00047  * This class provides an interface for specifying how Mesquite
00048  * will divide the active mesh into working patches.
00049  */
00050 class MESQUITE_EXPORT PatchSet
00051 {
00052   public:
00053     typedef void* PatchHandle;
00054 
00055     inline PatchSet() {}
00056 
00057     /**\brief Declare destructor virtual */
00058     virtual ~PatchSet();
00059 
00060     /**\brief Specify the working Mesh */
00061     inline void set_mesh( Mesh* mesh )
00062     {
00063         myMesh = mesh;
00064     }
00065 
00066     /**\brief Get a list of handles, one for each patch */
00067     virtual void get_patch_handles( std::vector< PatchHandle >& patch_handles_out, MsqError& err ) = 0;
00068 
00069     /**\brief Get the mesh entities in a patch
00070      *
00071      * Given one of the handles returned by get_patch_handles(),
00072      * return the mesh entities in the corresponding patch.
00073      *\param patch_handle one of the handles returned by get_patch_handles()
00074      *\param elem_handles_out the list of elements in the mesh
00075      *\param free_vertices_out The list of vertices interior to the patch
00076      *                         If this list is empty, it is assumed that all
00077      *                         vertices in the closure of the elements are
00078      *                         free.
00079      */
00080     virtual void get_patch( PatchHandle patch_handle,
00081                             std::vector< Mesh::ElementHandle >& elem_handles_out,
00082                             std::vector< Mesh::VertexHandle >& free_vertices_out,
00083                             MsqError& err ) = 0;
00084 
00085     /**\brief get the Mesh object passed to set_mesh() */
00086     inline Mesh* get_mesh() const
00087     {
00088         return myMesh;
00089     }
00090 
00091   private:
00092     /**\brief disallow copying*/
00093     PatchSet( const PatchSet& );
00094     /**\brief disallow assignment*/
00095     PatchSet& operator=( const PatchSet& );
00096 
00097     Mesh* myMesh;
00098 };
00099 
00100 }  // namespace MBMesquite
00101 
00102 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines