3 #ifndef DUNE_GRID_COMMON_GRIDFACTORY_HH
4 #define DUNE_GRID_COMMON_GRIDFACTORY_HH
13 #include <dune/common/function.hh>
14 #include <dune/common/fvector.hh>
15 #include <dune/common/to_unique_ptr.hh>
16 #include <dune/common/parallel/mpihelper.hh>
18 #include <dune/geometry/type.hh>
68 template <
class Gr
idType>
80 typedef typename GridType::ctype
ctype;
98 virtual void insertVertex(
const FieldVector<ctype,dimworld>& pos) = 0;
108 const std::vector<unsigned int>& vertices) = 0;
119 const std::vector<unsigned int>& vertices,
120 const std::shared_ptr<VirtualFunction<FieldVector<ctype,dimension>,FieldVector<ctype,dimworld> > >& elementParametrization)
122 DUNE_THROW(
GridError,
"This grid does not support parametrized elements!");
150 DUNE_THROW(
GridError,
"This grid does not support parametrized boundary segments!");
177 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
198 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
223 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
241 wasInserted (
const typename GridType::LeafIntersection &intersection )
const
243 DUNE_THROW( NotImplemented,
"insertion indices have not yet been implemented." );
246 using Communication = Dune::CollectiveCommunication<typename MPIHelper::MPICommunicator>;
268 template <
class Gr
idType>
274 enum {dimworld = GridType::dimensionworld};
277 typedef typename GridType::ctype
ctype;
286 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
291 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
302 const std::vector<unsigned int>& vertices) {
303 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
320 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
328 DUNE_THROW(
GridError,
"There is no grid factory for this grid type!");
Base class for grid boundary segments of arbitrary geometry.
Include standard header files.
Definition: agrid.hh:59
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:180
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:92
Base class for exceptions in Dune grid modules.
Definition: exceptions.hh:18
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:70
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:147
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
obtain an element's insertion index
Definition: common/gridfactory.hh:175
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)=0
Insert an element into the coarse grid.
@ dimworld
Definition: common/gridfactory.hh:77
virtual ToUniquePtr< GridType > createGrid()=0
Finalize grid creation and hand over the grid.
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices)=0
insert a boundary segment
virtual ~GridFactoryInterface()
virtual destructor
Definition: common/gridfactory.hh:94
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)=0
Insert a vertex into the coarse grid.
static const int dimension
dimension of the grid
Definition: common/gridfactory.hh:74
virtual unsigned int insertionIndex(const typename GridType::LeafIntersection &intersection) const
obtain a boundary's insertion index
Definition: common/gridfactory.hh:221
GridType::ctype ctype
Type used by the grid for coordinates.
Definition: common/gridfactory.hh:80
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:118
GridFactoryInterface()
Default constructor.
Definition: common/gridfactory.hh:90
Communication comm() const
Return the Communication used by the grid factory.
Definition: common/gridfactory.hh:252
virtual unsigned int insertionIndex(const typename Codim< dimension >::Entity &entity) const
obtain a vertex' insertion index
Definition: common/gridfactory.hh:196
Dune::CollectiveCommunication< typename MPIHelper::MPICommunicator > Communication
Definition: common/gridfactory.hh:246
virtual bool wasInserted(const typename GridType::LeafIntersection &intersection) const
determine whether an intersection was inserted
Definition: common/gridfactory.hh:241
Definition: common/gridfactory.hh:85
GridType::template Codim< codim >::Entity Entity
Definition: common/gridfactory.hh:86
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:269
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
Insert an element into the coarse grid.
Definition: common/gridfactory.hh:301
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
Insert a vertex into the coarse grid.
Definition: common/gridfactory.hh:290
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices)
insert a boundary segment
Definition: common/gridfactory.hh:319
GridFactory()
Default constructor.
Definition: common/gridfactory.hh:285
virtual ToUniquePtr< GridType > createGrid()
Finalize grid creation and hand over the grid.
Definition: common/gridfactory.hh:327
Different resources needed by all grid implementations.