4 #ifndef DUNE_UGGRID_FACTORY_HH
5 #define DUNE_UGGRID_FACTORY_HH
16 #include <dune/common/fvector.hh>
160 template <
int dimworld>
167 static_assert(dimworld==2 || dimworld == 3,
"UGGrid only in 2d and 3d");
196 const std::vector<unsigned int>& vertices);
222 template<
int codim >
235 return UG_NS<dimension>::levelIndex(entity.impl().target_);
245 return UG_NS<dimension>::levelIndex(entity.impl().target_);
255 return intersection.boundarySegmentIndex();
262 return (
insertionIndex( intersection ) < boundarySegmentVertices_.size());
273 return grid_->comm();
286 bool factoryOwnsGrid_;
289 std::vector<std::array<int, dimworld*2-2> > boundarySegmentVertices_;
293 std::vector<unsigned char> elementTypes_;
297 std::vector<unsigned int> elementVertices_;
300 std::vector<FieldVector<double, dimworld> > vertexPositions_;
Base class for grid boundary segments of arbitrary geometry.
Include standard header files.
Definition: agrid.hh:58
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
Base class for classes implementing geometries of boundary segments.
Definition: boundarysegment.hh:92
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:71
virtual unsigned int insertionIndex([[maybe_unused]] const typename Codim< 0 >::Entity &entity) const
obtain an element's insertion index
Definition: common/gridfactory.hh:218
static const int dimension
dimension of the grid
Definition: common/gridfactory.hh:75
Provide a generic factory class for unstructured grids.
Definition: common/gridfactory.hh:312
Front-end for the grid manager of the finite element toolbox UG3.
Definition: uggrid.hh:205
virtual std::unique_ptr< UGGrid< dimworld > > createGrid()
Finalize grid creation and hand over the grid.
void insertBoundarySegment(const std::vector< unsigned int > &vertices, const std::shared_ptr< BoundarySegment< dimworld > > &boundarySegment)
Method to insert an arbitrarily shaped boundary segment into a coarse grid.
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
Insert a vertex into the coarse grid.
~GridFactory()
Destructor.
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:233
virtual void insertElement(const GeometryType &type, const std::vector< unsigned int > &vertices)
Insert an element into the coarse grid.
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:243
typename UGGrid< dimworld >::CollectiveCommunication Communication
Definition: uggridfactory.hh:265
GridFactory()
Default constructor.
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:260
Communication comm() const
Return the Communication used by the grid factory.
Definition: uggridfactory.hh:271
GridFactory(UGGrid< dimworld > *grid)
Constructor for a given grid object.
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:253
void insertBoundarySegment(const std::vector< unsigned int > &vertices)
Method to insert a boundary segment into a coarse grid.
UGGrid< dimworld >::template Codim< codim >::Entity Entity
Definition: uggridfactory.hh:225
Provide a generic factory class for unstructured grids.