4 #ifndef DUNE_UGGRID_FACTORY_HH
5 #define DUNE_UGGRID_FACTORY_HH
14 #include <dune/common/fvector.hh>
158 template <
int dimworld>
165 static_assert(dimworld==2 || dimworld || 3,
"UGGrid only in 2d and 3d");
188 virtual void insertVertex(
const FieldVector<ctype,dimworld>& pos);
195 const std::vector<unsigned int>& vertices);
221 template<
int codim >
232 insertionIndex (
const typename Codim< 0 >::Entity &entity )
const
234 return UG_NS<dimension>::levelIndex(grid_->getRealImplementation(entity).target_);
242 insertionIndex (
const typename Codim< dimension >::Entity &entity )
const
244 return UG_NS<dimension>::levelIndex(grid_->getRealImplementation(entity).target_);
254 return intersection.boundarySegmentIndex();
261 return (
insertionIndex( intersection ) < boundarySegmentVertices_.size());
274 bool factoryOwnsGrid_;
277 std::vector<array<int, dimworld*2-2> > boundarySegmentVertices_;
281 std::vector<unsigned char> elementTypes_;
285 std::vector<unsigned int> elementVertices_;
288 std::vector<FieldVector<double, dimworld> > vertexPositions_;
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
obtain an element's insertion index
Definition: common/gridfactory.hh:179
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:263
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:73
virtual GridType * createGrid()
Finalize grid creation and hand over the grid.
Definition: common/gridfactory.hh:316
static const int dimension
dimension of the grid
Definition: common/gridfactory.hh:78
GridType::template Codim< codim >::Entity Entity
Definition: common/gridfactory.hh:90
GridFactory()
Default constructor.
Definition: common/gridfactory.hh:274
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 insertBoundarySegment(const std::vector< unsigned int > &vertices)
insert a boundary segment
Definition: common/gridfactory.hh:308
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
Insert a vertex into the coarse grid.
Definition: common/gridfactory.hh:279
GridFamily::Traits::LeafIntersection LeafIntersection
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimensio...
Definition: common/grid.hh:486
Provide a generic factory class for unstructured grids.
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
Insert an element into the coarse grid.
Definition: common/gridfactory.hh:290
ct ctype
Define type used for coordinates in grid module.
Definition: common/grid.hh:548
Include standard header files.
Definition: agrid.hh:59
Base class for grid boundary segments of arbitrary geometry.
Front-end for the grid manager of the finite element toolbox UG.
Definition: uggrid.hh:207
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178