Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (1.4)

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 //
24 // --MMeshInterfaceConnectedComponent
25 //
31 template<class GridImp>
33 {
34 template <class GridImp_>
35 friend class MMeshInterfaceGridLeafIndexSet;
36
37 template <class GridImp_>
38 friend class MMeshInterfaceGridLocalIdSet;
39
40 template <class GridImp_>
41 friend class MMeshInterfaceGridGlobalIdSet;
42
43 private:
44 // this type
46
47 // type of scalars
48 typedef typename GridImp::ctype ctype;
49
50 // type of the host grid
51 typedef typename GridImp::HostGridType HostGrid;
52
53 // equivalent interface entity in the host grid as pointer
54 typedef typename GridImp::template Codim<0>::Entity Element;
55
56 // vertex in the host grid as object
57 typedef typename GridImp::HostGridType::Vertex HostGridVertex;
58
59 // type of caching entity
60 using CachingEntity = MMeshInterfaceCachingEntity< 0, GridImp::dimension, const GridImp >;
61
62 // id type
63 using IdType = MMeshImpl::MultiId;
64
65 // vertex storage
66 using Vertices = std::array<HostGridVertex, GridImp::dimension+1>;
67
68 public:
70
72
74 explicit MMeshInterfaceConnectedComponent(const Element& element)
75 {
76 children_.emplace_back( element );
77 }
78
80 void add (const Element& element)
81 {
82 children_.emplace_back( element );
83 assert( children_.size() <= 2 ); // at the moment, more children are not supported
84 }
85
87 const std::vector<CachingEntity>& children() const
88 {
89 return children_;
90 }
91
93 const std::size_t size() const
94 {
95 return children_.size();
96 }
97
98 private:
100 std::vector< CachingEntity > children_;
101
102 };
103
104} // namespace Dune
105
106#endif
The implementation of connected components in a MMeshInterfaceGridThe connected component copies the ...
Definition: connectedcomponent.hh:33
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:74
const std::size_t size() const
Return number of caching entities in this component.
Definition: connectedcomponent.hh:93
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 (Apr 13, 22:42, 2025)