uggridfactory.hh

Go to the documentation of this file.
00001 #ifndef DUNE_UGGRID_FACTORY_HH
00002 #define DUNE_UGGRID_FACTORY_HH
00003 
00009 #include <vector>
00010 
00011 #include <dune/common/fvector.hh>
00012 
00013 #include <dune/grid/common/boundarysegment.hh>
00014 #include <dune/grid/common/gridfactory.hh>
00015 #include <dune/grid/uggrid.hh>
00016 
00017 namespace Dune {
00018 
00145     template <int dimworld>
00146     class GridFactory<UGGrid<dimworld> > : public GridFactoryInterface<UGGrid<dimworld> > {
00147 
00149         typedef typename UGGrid<dimworld>::ctype ctype;
00150 
00151         // UGGrid only in 2d and 3d
00152         dune_static_assert(dimworld==2 || dimworld || 3, "UGGrid only in 2d and 3d");
00153 
00154     public:
00155 
00157         GridFactory();
00158 
00169         GridFactory(UGGrid<dimworld>* grid);
00170         
00172         ~GridFactory();
00173 
00175         virtual void insertVertex(const FieldVector<ctype,dimworld>& pos);
00176 
00181         virtual void insertElement(const GeometryType& type,
00182                                    const std::vector<unsigned int>& vertices);
00183 
00189         void insertBoundarySegment(const std::vector<unsigned int> vertices,
00190                                    const BoundarySegment<dimworld>* boundarySegment);
00191 
00192 
00197         virtual UGGrid<dimworld>* createGrid();
00198 
00199     private:
00200         // Pointer to the grid being built
00201         UGGrid<dimworld>* grid_;
00202 
00203         // True if the factory allocated the grid itself, false if the
00204         // grid was handed over from the outside
00205         bool factoryOwnsGrid_;
00206 
00207     };
00208 
00209 }
00210 
00211 #endif

Generated on Tue Jul 28 22:28:21 2009 for dune-grid by  doxygen 1.5.6