Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2006 Lawrence Livermore National Laboratory. Under
5 : : the terms of Contract B545069 with the University of Wisconsin --
6 : : Madison, Lawrence Livermore National Laboratory retains certain
7 : : rights in this software.
8 : :
9 : : This library is free software; you can redistribute it and/or
10 : : modify it under the terms of the GNU Lesser General Public
11 : : License as published by the Free Software Foundation; either
12 : : version 2.1 of the License, or (at your option) any later version.
13 : :
14 : : This library is distributed in the hope that it will be useful,
15 : : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : : Lesser General Public License for more details.
18 : :
19 : : You should have received a copy of the GNU Lesser General Public License
20 : : (lgpl.txt) along with this library; if not, write to the Free Software
21 : : Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : :
23 : : (2006) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : #ifndef MSQ_PATCH_SET_HPP
28 : : #define MSQ_PATCH_SET_HPP
29 : :
30 : : /** \file PatchSet.hpp
31 : : * \brief
32 : : * \author Jason Kraftcheck
33 : : */
34 : :
35 : : #include <vector>
36 : :
37 : : #include "Mesquite.hpp"
38 : : #include "MeshInterface.hpp"
39 : :
40 : : namespace MBMesquite
41 : : {
42 : :
43 : : class MsqError;
44 : :
45 : : /**\brief Specify a division of the Mesh into working patches
46 : : *
47 : : * This class provides an interface for specifying how Mesquite
48 : : * will divide the active mesh into working patches.
49 : : */
50 : : class MESQUITE_EXPORT PatchSet
51 : : {
52 : : public:
53 : : typedef void* PatchHandle;
54 : :
55 : 634 : inline PatchSet() {}
56 : :
57 : : /**\brief Declare destructor virtual */
58 : : virtual ~PatchSet();
59 : :
60 : : /**\brief Specify the working Mesh */
61 : 447 : inline void set_mesh( Mesh* mesh )
62 : : {
63 : 447 : myMesh = mesh;
64 : 447 : }
65 : :
66 : : /**\brief Get a list of handles, one for each patch */
67 : : virtual void get_patch_handles( std::vector< PatchHandle >& patch_handles_out, MsqError& err ) = 0;
68 : :
69 : : /**\brief Get the mesh entities in a patch
70 : : *
71 : : * Given one of the handles returned by get_patch_handles(),
72 : : * return the mesh entities in the corresponding patch.
73 : : *\param patch_handle one of the handles returned by get_patch_handles()
74 : : *\param elem_handles_out the list of elements in the mesh
75 : : *\param free_vertices_out The list of vertices interior to the patch
76 : : * If this list is empty, it is assumed that all
77 : : * vertices in the closure of the elements are
78 : : * free.
79 : : */
80 : : virtual void get_patch( PatchHandle patch_handle, std::vector< Mesh::ElementHandle >& elem_handles_out,
81 : : std::vector< Mesh::VertexHandle >& free_vertices_out, MsqError& err ) = 0;
82 : :
83 : : /**\brief get the Mesh object passed to set_mesh() */
84 : 1758460 : inline Mesh* get_mesh() const
85 : : {
86 : 1758460 : return myMesh;
87 : : }
88 : :
89 : : private:
90 : : /**\brief disallow copying*/
91 : : PatchSet( const PatchSet& );
92 : : /**\brief disallow assignment*/
93 : : PatchSet& operator=( const PatchSet& );
94 : :
95 : : Mesh* myMesh;
96 : : };
97 : :
98 : : } // namespace MBMesquite
99 : :
100 : : #endif
|