3 #ifndef DUNE_GRID_FACTORY_HH 4 #define DUNE_GRID_FACTORY_HH 13 #include <dune/common/function.hh> 14 #include <dune/common/fvector.hh> 16 #include <dune/geometry/type.hh> 72 template <
class Gr
idType>
84 typedef typename GridType::ctype
ctype;
102 virtual void insertVertex(
const FieldVector<ctype,dimworld>& pos) = 0;
112 const std::vector<unsigned int>& vertices) = 0;
123 const std::vector<unsigned int>& vertices,
124 const std::shared_ptr<VirtualFunction<FieldVector<ctype,dimension>,FieldVector<ctype,dimworld> > >& elementParametrization)
126 DUNE_THROW(
GridError,
"This grid does not support parametrized elements!");
154 DUNE_THROW(
GridError,
"This grid does not support parametrized boundary segments!");
181 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
202 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
227 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
245 wasInserted (
const typename GridType::LeafIntersection &intersection )
const 247 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
262 template <
class Gr
idType>
266 enum {
dimworld = GridType::dimensionworld};
269 typedef typename GridType::ctype
ctype;
275 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
280 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
291 const std::vector<unsigned int>& vertices) {
292 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
309 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
317 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:16
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:263
Definition: common/gridfactory.hh:81
Base class for grid boundary segments of arbitrary geometry.
virtual unsigned int insertionIndex(const typename Codim< dimension >::Entity &entity) const
obtain a vertex' insertion index
Definition: common/gridfactory.hh:200
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
Insert an element into the coarse grid.
Definition: common/gridfactory.hh:290
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
virtual GridType * createGrid()=0
Finalize grid creation and hand over the grid.
virtual unsigned int insertionIndex(const typename GridType::LeafIntersection &intersection) const
obtain a boundary's insertion index
Definition: common/gridfactory.hh:225
static const int dimension
dimension of the grid
Definition: common/gridfactory.hh:78
virtual GridType * createGrid()
Finalize grid creation and hand over the grid.
Definition: common/gridfactory.hh:316
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)=0
Insert an element into the coarse grid.
GridFactoryInterface()
Default constructor.
Definition: common/gridfactory.hh:94
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
obtain an element's insertion index
Definition: common/gridfactory.hh:179
virtual ~GridFactoryInterface()
virtual destructor
Definition: common/gridfactory.hh:98
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)=0
Insert a vertex into the coarse grid.
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices)
insert a boundary segment
Definition: common/gridfactory.hh:308
GridFactory()
Default constructor.
Definition: common/gridfactory.hh:274
Include standard header files.
Definition: agrid.hh:59
GridType::ctype ctype
Type used by the grid for coordinates.
Definition: common/gridfactory.hh:84
Definition: common/gridfactory.hh:88
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
Insert a vertex into the coarse grid.
Definition: common/gridfactory.hh:279
GridType::template Codim< codim >::Entity Entity
Definition: common/gridfactory.hh:90
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:29
virtual bool wasInserted(const typename GridType::LeafIntersection &intersection) const
determine whether an intersection was inserted
Definition: common/gridfactory.hh:245
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices, const std::shared_ptr< VirtualFunction< FieldVector< ctype, dimension >, FieldVector< ctype, dimworld > > > &elementParametrization)
Insert a parametrized element into the coarse grid.
Definition: common/gridfactory.hh:122
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices, const std::shared_ptr< BoundarySegment< dimension, dimworld > > &boundarySegment)
insert an arbitrarily shaped boundary segment
Definition: common/gridfactory.hh:151
Different resources needed by all grid implementations.
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices)=0
insert a boundary segment
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:73