dune-mmesh (unstable)

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_>
33 friend class MMeshInterfaceGridLeafIndexSet;
34
35 template <class GridImp_>
36 friend class MMeshInterfaceGridLocalIdSet;
37
38 template <class GridImp_>
39 friend class MMeshInterfaceGridGlobalIdSet;
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 =
59 MMeshInterfaceCachingEntity<0, GridImp::dimension, const GridImp>;
60
61 // id type
62 using IdType = MMeshImpl::MultiId;
63
64 // vertex storage
65 using Vertices = std::array<HostGridVertex, GridImp::dimension + 1>;
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:
94 std::vector<CachingEntity> children_;
95};
96
97} // namespace Dune
98
99#endif
The implementation of connected components in a MMeshInterfaceGridThe connected component copies the ...
Definition: connectedcomponent.hh:31
void add(const Element &element)
Add element to connected component.
Definition: connectedcomponent.hh:80
const std::vector< CachingEntity > & children() const
Return list of caching entities in this component.
Definition: connectedcomponent.hh:87
MMeshInterfaceConnectedComponent(const Element &element)
Construct connected component with a single element.
Definition: connectedcomponent.hh:75
const std::size_t size() const
Return number of caching entities in this component.
Definition: connectedcomponent.hh:90
Geometry.
Definition: geometry.hh:27
The MMeshInterfaceCachingEntity class.
The MMeshInterfaceGridGeometry class and its specializations Inherits from Dune::AffineGeometry.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Mar 17, 23:30, 2025)