dune-mmesh 1.4.1-git
Loading...
Searching...
No Matches
interface/connectedcomponent.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_MMESH_INTERFACE_CONNECTEDCOMPONENT_HH
4#define DUNE_MMESH_INTERFACE_CONNECTEDCOMPONENT_HH
5
10#include <set>
11
12// Dune includes
13#include <dune/grid/common/grid.hh>
14
15// MMesh includes
18
19namespace Dune {
20
21//**********************************************************************
22//
23// --MMeshInterfaceConnectedComponent
24//
30template <class GridImp>
32 template <class GridImp_>
34
35 template <class GridImp_>
37
38 template <class GridImp_>
40
41 private:
42 // this type
44
45 // type of scalars
46 typedef typename GridImp::ctype ctype;
47
48 // type of the host grid
49 typedef typename GridImp::HostGridType HostGrid;
50
51 // equivalent interface entity in the host grid as pointer
52 typedef typename GridImp::template Codim<0>::Entity Element;
53
54 // vertex in the host grid as object
55 typedef typename GridImp::HostGridType::Vertex HostGridVertex;
56
57 // type of caching entity
58 using CachingEntity =
60
61 // id type
63
64 // vertex storage
66
67 public:
68 typedef MMeshInterfaceGridGeometry<GridImp::dimension, GridImp::dimension + 1,
69 GridImp>
71
73
75 explicit MMeshInterfaceConnectedComponent(const Element& element) {
76 children_.emplace_back(element);
77 }
78
80 void add(const Element& element) {
81 children_.emplace_back(element);
82 assert(children_.size() <=
83 2); // at the moment, more children are not supported
84 }
85
87 const std::vector<CachingEntity>& children() const { return children_; }
88
90 const std::size_t size() const { return children_.size(); }
91
92 private:
95};
96
97} // namespace Dune
98
99#endif
Definition multiid.hh:15
Definition interface/cachingentity.hh:22
The implementation of connected components in a MMeshInterfaceGridThe connected component copies the ...
Definition interface/connectedcomponent.hh:31
friend class MMeshInterfaceGridLocalIdSet
Definition interface/connectedcomponent.hh:36
void add(const Element &element)
Add element to connected component.
Definition interface/connectedcomponent.hh:80
const std::vector< CachingEntity > & children() const
Return list of caching entities in this component.
Definition interface/connectedcomponent.hh:87
MMeshInterfaceConnectedComponent()
Definition interface/connectedcomponent.hh:72
MMeshInterfaceConnectedComponent(const Element &element)
Construct connected component with a single element.
Definition interface/connectedcomponent.hh:75
MMeshInterfaceGridGeometry< GridImp::dimension, GridImp::dimension+1, GridImp > Geometry
Definition interface/connectedcomponent.hh:70
const std::size_t size() const
Return number of caching entities in this component.
Definition interface/connectedcomponent.hh:90
Geometry.
Definition interface/geometry.hh:27
Definition interface/indexsets.hh:18
Definition interface/indexsets.hh:355
The MMeshInterfaceCachingEntity class.
The MMeshInterfaceGridGeometry class and its specializations Inherits from Dune::AffineGeometry.