Go to the documentation of this file.
4 #ifndef DUNE_UGGRID_FACTORY_HH
5 #define DUNE_UGGRID_FACTORY_HH
16 #include <dune/common/fvector.hh>
17 #include <dune/common/to_unique_ptr.hh>
161 template <
int dimworld>
168 static_assert(dimworld==2 || dimworld == 3,
"UGGrid only in 2d and 3d");
191 virtual void insertVertex(
const FieldVector<ctype,dimworld>& pos);
198 const std::vector<unsigned int>& vertices);
220 virtual ToUniquePtr<UGGrid<dimworld>>
createGrid();
224 template<
int codim >
237 return UG_NS<dimension>::levelIndex(entity.impl().target_);
247 return UG_NS<dimension>::levelIndex(entity.impl().target_);
257 return intersection.boundarySegmentIndex();
264 return (
insertionIndex( intersection ) < boundarySegmentVertices_.size());
275 return grid_->comm();
288 bool factoryOwnsGrid_;
291 std::vector<std::array<int, dimworld*2-2> > boundarySegmentVertices_;
295 std::vector<unsigned char> elementTypes_;
299 std::vector<unsigned int> elementVertices_;
302 std::vector<FieldVector<double, dimworld> > vertexPositions_;
typename UGGrid< dimworld >::CollectiveCommunication Communication
Definition: uggridfactory.hh:267
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:35
Front-end for the grid manager of the finite element toolbox UG.
Definition: uggrid.hh:226
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:269
UGGrid< dimworld >::template Codim< codim >::Entity Entity
Definition: uggridfactory.hh:227
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
Return the number of the element in the order of insertion into the factory.
Definition: uggridfactory.hh:235
virtual unsigned int insertionIndex(const typename Codim< 0 >::Entity &entity) const
obtain an element's insertion index
Definition: common/gridfactory.hh:175
Provide a generic factory class for unstructured grids.
virtual unsigned int insertionIndex(const typename UGGrid< dimworld >::LeafIntersection &intersection) const
Return the number of the intersection in the order of insertion into the factory.
Definition: uggridfactory.hh:255
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 bool wasInserted(const typename UGGrid< dimworld >::LeafIntersection &intersection) const
Return true if the intersection has been explictily insterted into the factory.
Definition: uggridfactory.hh:262
static const int dimension
dimension of the grid
Definition: common/gridfactory.hh:74
virtual unsigned int insertionIndex(const typename Codim< dimension >::Entity &entity) const
Return the number of the vertex in the order of insertion into the factory.
Definition: uggridfactory.hh:245
virtual ToUniquePtr< GridType > createGrid()
Finalize grid creation and hand over the grid.
Definition: common/gridfactory.hh:327
GridFactory()
Default constructor.
Definition: common/gridfactory.hh:285
Communication comm() const
Return the Communication used by the grid factory.
Definition: uggridfactory.hh:273
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:69
virtual void insertBoundarySegment(const std::vector< unsigned int > &vertices)
insert a boundary segment
Definition: common/gridfactory.hh:319
Base class for grid boundary segments of arbitrary geometry.
Include standard header files.
Definition: agrid.hh:58
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
Insert a vertex into the coarse grid.
Definition: common/gridfactory.hh:290
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:180