HyperHDG
hdg_hypergraph.hxx
Go to the documentation of this file.
1 #pragma once // Ensure that file is included only once in a single compilation.
2 
3 #include <HyperHDG/hy_assert.hxx>
6 
7 #include <memory>
8 
9 /*!*************************************************************************************************
10  * \brief Empty class as defaultd data class.
11  **************************************************************************************************/
12 class EmptyC
13 {
14 };
15 
16 /*!*************************************************************************************************
17  * \brief The class template uniting topology and geometry of a hypergraph with the topology of
18  * the skeleton space of the HDG method.
19  *
20  * The main class representing a hypergraph. It uses a class \c Topology to represent the collection
21  * of nodes and edges as well as a class \c Geometry presenting the physical coordinates of the
22  * edges. It behaves like a random access container of hyperedges and has additional access to its
23  * nodes.
24  *
25  * In our abstraction, nodes only carry degrees of freedom. Thus, they can be obtained from one
26  * object \c HyperNodeFactory for any graph. Their location, if such a notion is reasonable, must be
27  * determined by that of the boundaries of an edge. The meaning of their degrees of freedom is
28  * decided by the local solvers of the HDG method applied. The \c Geometry class may use degrees of
29  * freedom of the nodes as well.
30  *
31  * \tparam n_dofs_per_nodeT The number of degrees of freedom of a single hypernode which is assumed
32  * to be the same for all hypernodes.
33  * \tparam TopoT Class that contains the topology of the hypergraph. This class is needs
34  * to provide a getter function to the topological information of a
35  * hyperedge of given index and can be arbitrarily implemented.
36  * \tparam GeomT Class that contains the topology of the hypergraph. This class is needs
37  * to provide a getter function to the topological information of a
38  * hyperedge of given index and can be arbitrarily implemented.
39  * \tparam NodeDescT Class that contains the descriptions of hyperedges' faces.
40  * \tparam hyEdge_index_t Unsigned integer type specification. Default is unsigned int.
41  *
42  * \authors Guido Kanschat, Heidelberg University, 2019--2020.
43  * \authors Andreas Rupp, Heidelberg University, 2019--2020.
44  **************************************************************************************************/
45 template <unsigned int n_dofs_per_nodeT,
46  class TopoT,
47  class GeomT,
48  class NodeT,
49  class DataT = EmptyC,
50  typename hyEdge_index_t = unsigned int>
52 {
53  /*!***********************************************************************************************
54  * \brief The type for a hyperedge returned by \c operator[].
55  *
56  * This \c typedef \c struct is returned by the \c operator[] of an \c HDGHyperGraph. It contains
57  * topological and geometrical information about a single hyperedge. It is therefore defined as
58  * the \c value_type of class \c HDGHyperGraph.
59  ************************************************************************************************/
60  typedef struct hyEdge
61  {
62  /*!*********************************************************************************************
63  * \brief Topological information of a hyperedge.
64  *
65  * A \c TopoT::value_type comprising the topological information of a hyperedge.
66  **********************************************************************************************/
67  typename TopoT::value_type topology;
68  /*!*********************************************************************************************
69  * \brief Geometrical information of a hyperedge.
70  *
71  * A \c TopoT::value_type comprising the geometrical information of a hyperedge.
72  **********************************************************************************************/
73  typename GeomT::value_type geometry;
74  /*!*********************************************************************************************
75  * \brief Type of nodes information of a hyperedge.
76  *
77  * A \c NodeDescT::value_type comprising the information about faces of a hyperedge.
78  **********************************************************************************************/
79  typename NodeT::value_type node_descriptor;
80  /*!*********************************************************************************************
81  * \brief Type of nodes information of a hyperedge.
82  *
83  * A \c NodeDescT::value_type comprising the information about faces of a hyperedge.
84  **********************************************************************************************/
85  DataT& data;
86  /*!*********************************************************************************************
87  * \brief Construct the \c struct that contains geometrical and topological information on a
88  * hyperedge.
89  *
90  * Construct a \c struct \c HyperEdge which is the value type of a \c HDGHyperGraph and contains
91  * topolopgical and geometrical information on a hyperedge.
92  *
93  * \param topo Topological information of a hyperedge.
94  * \param geom Geometrical information of a hyperedge.
95  * \param node Nodal information of a hyperedge.
96  * \param dat Data of a hyperedge.
97  **********************************************************************************************/
98  hyEdge(const typename TopoT::value_type& topo,
99  const typename GeomT::value_type& geom,
100  const typename NodeT::value_type& node,
101  DataT& dat)
102  : topology(topo), geometry(geom), node_descriptor(node), data(dat)
103  {
104  }
105  } value_type; // end of typedef struct hyEdge
106 
107  /*!***********************************************************************************************
108  * \brief Iterator for \c struct \c hyEdge returned by \c operator[].
109  *
110  * Iterator that allows to go through the hyperedges of a hypergraph forwards and backwards. This
111  * iterator fulfills the preconditions to allow the use of \c std::for_each on the set of
112  * hyperedges that are contained in the \c HDGHyperGraph.
113  ************************************************************************************************/
114  class iterator
115  {
116  private:
117  /*!*********************************************************************************************
118  * \brief Reference to the \c HDGHyperGraph of the iterator.
119  *
120  * The \c hyEdge is characterized via its respective \c HDGHypergraph (of which the
121  * reference is saved) and its index who need to be members of the \c iterator.
122  **********************************************************************************************/
124  /*!*********************************************************************************************
125  * \brief Index of the \c hyEdge of the iterator.
126  *
127  * The \c hyEdge is characterized via its respective \c HDGHypergraph (of which the
128  * reference is saved) and its index who need to be members of the \c iterator.
129  **********************************************************************************************/
130  hyEdge_index_t index_;
131 
132  public:
133  /*!*********************************************************************************************
134  * \brief Construct an iterator from an \c HDGHyperGraph and an index.
135  *
136  * Construct \c HDGHyperGraph::iterator by passing over an \c HDGHyperGraph object and the
137  * index the iterator is supposed to dot at.
138  *
139  * \param hyGraph The \c HDGHyperGraph, the iterator refers to.
140  * \param index Index of the object, the iterator dots at.
141  **********************************************************************************************/
142  iterator(HDGHyperGraph& hyGraph, const hyEdge_index_t index) : hyGraph_(hyGraph), index_(index)
143  {
144  }
145  /*!*********************************************************************************************
146  * \brief Copy--construct an iterator from another iterator.
147  *
148  * Construct \c HDGHyperGraph::iterator as copy of another one.
149  *
150  * \param other Other \c iterator which is copied.
151  **********************************************************************************************/
152  iterator(const iterator& other) : hyGraph_(other.hyGraph_), index_(other.index_) {}
153  /*!*********************************************************************************************
154  * \brief Copy--assign an iterator from another iterator.
155  *
156  * Asign a given \c HDGHyperGraph::iterator to be a copy of another one
157  *
158  * \param other Other \c iterator which is copied.
159  **********************************************************************************************/
160  iterator& operator=(const iterator& other) = default;
161  /*!*********************************************************************************************
162  * \brief Increment iterator and return incremented iterator.
163  *
164  * This function incements the iterator and returns the incremented iterator. Thus, no new
165  * iterator needs to be constructed and only a reference needs to be returned. This makes the
166  * function more performant compared to \c iterator \c operator++(int).
167  * It is executed using \c ++iterator and \b not \c iterator++.
168  *
169  * \retval incemented The incremented iterator.
170  **********************************************************************************************/
172  {
173  ++index_;
174  return *this;
175  }
176  /*!*********************************************************************************************
177  * \brief Decrement iterator and return incremented iterator.
178  *
179  * This function decements the iterator and returns the decremented iterator. Thus, no new
180  * iterator needs to be constructed and only a reference needs to be returned. This makes the
181  * function more performant compared to \c iterator \c operator--(int).
182  * It is executed using \c --iterator and \b not \c iterator--.
183  *
184  * \retval decemented The decremented iterator.
185  **********************************************************************************************/
187  {
188  --index_;
189  return *this;
190  }
191  /*!*********************************************************************************************
192  * \brief Increment iterator and return old iterator.
193  *
194  * This function incements the iterator and returns the old iterator. Thus, a new iterator
195  * needs to be constructed and only a reference needs to be returned. This makes the function
196  * less performant compared to \c iterator \c operator++().
197  * It is executed using \c iterator++ and \b not \c ++iterator.
198  *
199  * \retval incemented The incremented iterator.
200  **********************************************************************************************/
202  /*!*********************************************************************************************
203  * \brief Decrement iterator and return old iterator.
204  *
205  * This function decements the iterator and returns the old iterator. Thus, a new iterator
206  * needs to be constructed and only a reference needs to be returned. This makes the function
207  * less performant compared to \c iterator \c operator--().
208  * It is executed using \c iterator-- and \b not \c --iterator.
209  *
210  * \retval decemented The decremented iterator.
211  **********************************************************************************************/
213  /*!*********************************************************************************************
214  * \brief Dereference \c iterator to \c hyEdge.
215  *
216  * This function dereferences the iterator and returns the \c hyEdge this iterator dots at.
217  *
218  * \retval hyEdge The hyperedge described by the iterator.
219  **********************************************************************************************/
221  /*!*********************************************************************************************
222  * \brief Check for equality with another iterator.
223  *
224  * This function checks whether the current iterator is equal to anoother \c iterator. In this
225  * context equal means that they refer to the same \c HDGHyperGraph and have the same index.
226  *
227  * \param other \c iterator which is checked to be equal.
228  * \retval is_equal \c boolean which is true if both iterators are equal and false
229  * otherwise.
230  **********************************************************************************************/
231  bool operator==(const iterator& other)
232  {
233  return index_ == other.index_ && std::addressof(hyGraph_) == std::addressof(other.hyGraph_);
234  }
235  }; // end of class iterator
236 
237  public:
238  /*!***********************************************************************************************
239  * \brief Returns the template parameter representing the dimension of a hyperedge.
240  *
241  * \retval hyEdge_dim The dimension of a hyperedge.
242  ************************************************************************************************/
243  static constexpr unsigned int hyEdge_dim() { return TopoT::hyEdge_dim(); }
244  /*!***********************************************************************************************
245  * \brief Returns the template parameter representing the dimension of the space.
246  *
247  * \retval space_dim The dimension of the space.
248  ************************************************************************************************/
249  static constexpr unsigned int space_dim() { return TopoT::space_dim(); }
250  /*!***********************************************************************************************
251  * \brief Returns the template parameter representing the amount of dofs per node.
252  *
253  * \retval n_dofs_per_nodeT The amount of degrees of freedom per node.
254  ************************************************************************************************/
255  static constexpr unsigned int n_dofs_per_node() { return n_dofs_per_nodeT; }
256 
257  private:
258  /*!***********************************************************************************************
259  * \brief Topology of the hypergraph.
260  *
261  * This object contains the topology of the hypergraph, i.e., it encodes which hyperedges
262  * connect which hypernodes.
263  ************************************************************************************************/
264  std::shared_ptr<TopoT> hyGraph_topology_;
265  /*!***********************************************************************************************
266  * \brief Geometry of the hypergraph.
267  *
268  * This object contains the geometry of the hypergraph, i.e., it encodes the geometry of the
269  * various hyperedges.
270  ************************************************************************************************/
271  std::shared_ptr<GeomT> hyGraph_geometry_;
272  /*!***********************************************************************************************
273  * \brief Node descriptions of the hypergraph.
274  *
275  * This object contains the nodal information of the hypergraph.
276  ************************************************************************************************/
277  std::shared_ptr<NodeT> hyGraph_node_des_;
278  /*!***********************************************************************************************
279  * \brief Hypernode factory administrating the access to degrees of freedom.
280  *
281  * A \c HyperNodeFactory allowing to connect nodes of the hypergraph to degrees of freedom which
282  * are located in some \c std::vector. Note that this HyperNodeFactory has the same index type
283  * for the hypernodes as this class for the hyperedges.
284  ************************************************************************************************/
286  /*!***********************************************************************************************
287  * \brief Hypernode factory administrating the access to degrees of freedom.
288  *
289  * A \c HyperNodeFactory allowing to connect nodes of the hypergraph to degrees of freedom which
290  * are located in some \c std::vector. Note that this HyperNodeFactory has the same index type
291  * for the hypernodes as this class for the hyperedges.
292  ************************************************************************************************/
294 
295  public:
296  /*!***********************************************************************************************
297  * \brief Construct HDGHyperGraph from \c constructor_value_type.
298  *
299  * This is one of two standard ways of constructing a hypergraph.
300  * That is, a hypergraph is constructed by providing the necessary data in form of the
301  * respective \c constructor_value_type.
302  *
303  * \param construct_topo Information needed to deduce topological and geometrical data
304  * to construct a \c HDGHyperGraph.
305  ************************************************************************************************/
306  HDGHyperGraph(const typename TopoT::constructor_value_type& construct_topo)
307  : hyGraph_topology_(std::make_shared<TopoT>(construct_topo)),
308  hyGraph_geometry_(std::make_shared<GeomT>(*hyGraph_topology_)),
309  hyGraph_node_des_(std::make_shared<NodeT>(*hyGraph_topology_)),
312  {
313  static_assert(TopoT::hyEdge_dim() == GeomT::hyEdge_dim(),
314  "The dimension of topology and geometry should be equal!");
315  hy_assert(hyNode_factory_.n_hyNodes() == hyGraph_topology_->n_hyNodes(),
316  "The amount of hypernodes known to the hypernode factory is "
317  << hyNode_factory_.n_hyNodes() << ", which is not equal to the amount that the"
318  << " hypergraph assumes, i.e., " << hyGraph_topology_->n_hyNodes() << ".");
319  hy_assert(hyNode_factory_.n_hyNodes() >= 2,
320  "A hypergraph is assumed to consist of at least two hypernodes. This graph only "
321  << "consists of " << hyNode_factory_.n_hyNodes() << " hypernodes.");
322  hy_assert(hyGraph_topology_->n_hyEdges() > 0,
323  "A hypergraph is supposed to consist of at least one hyperedge. This graph "
324  << "consists of " << hyGraph_topology_->n_hyEdges() << " hyperedges.");
325  }
326  /*!***********************************************************************************************
327  * \brief Construct HDGHyperGraph from \c constructor_value_type.
328  *
329  * This is one of two standard ways of constructing a hypergraph.
330  * That is, a hypergraph is constructed by providing the necessary data to construct its
331  * topology and its geometry seperately in form of the respective \c constructor_value_type
332  * (plural, two).
333  *
334  * \param construct_topo Information needed to deduce topological data.
335  * \param construct_geom Information needed to deduce geometrical data.
336  ************************************************************************************************/
337  HDGHyperGraph(const typename TopoT::constructor_value_type& construct_topo,
338  const typename GeomT::constructor_value_type& construct_geom)
339  : hyGraph_topology_(std::make_shared<TopoT>(construct_topo)),
340  hyGraph_geometry_(std::make_shared<GeomT>(construct_geom)),
341  hyGraph_node_des_(std::make_shared<NodeT>(*hyGraph_topology_)),
344  {
345  static_assert(TopoT::hyEdge_dim() == GeomT::hyEdge_dim(),
346  "The dimension of topology and geometry should be equal!");
347  hy_assert(hyNode_factory_.n_hyNodes() == hyGraph_topology_->n_hyNodes(),
348  "The amount of hypernodes known to the hypernode factory is "
349  << hyNode_factory_.n_hyNodes() << ", which is not equal to the amount that the"
350  << " hypergraph assumes, i.e., " << hyGraph_topology_->n_hyNodes() << ".");
351  hy_assert(hyNode_factory_.n_hyNodes() >= 2,
352  "A hypergraph is assumed to consist of at least two hypernodes. This graph only "
353  << "consists of " << hyNode_factory_.n_hyNodes() << " hypernodes.");
354  hy_assert(hyGraph_topology_->n_hyEdges() > 0,
355  "A hypergraph is supposed to consist of at least one hyperedge. This graph "
356  << "consists of " << hyGraph_topology_->n_hyEdges() << " hyperedges.");
357  }
358  /*!***********************************************************************************************
359  * \brief Construct HDGHyperGraph from existing topology and geometry
360  *
361  * This is one of two standard ways of constructing a hypergraph.
362  * That is, a hypergraph is constructed by providing the necessary data to construct its
363  * topology and its geometry seperately in form of the respective \c constructor_value_type
364  * (plural, two).
365  *
366  * \param topo Information needed to deduce topological data.
367  * \param geom Information needed to deduce geometrical data.
368  * \param node Information needed to deduce nodal data.
369  ************************************************************************************************/
370  HDGHyperGraph(std::shared_ptr<TopoT> topo,
371  std::shared_ptr<GeomT> geom,
372  std::shared_ptr<NodeT> node)
373  : hyGraph_topology_(topo),
374  hyGraph_geometry_(geom),
375  hyGraph_node_des_(node),
378  {
379  static_assert(TopoT::hyEdge_dim() == GeomT::hyEdge_dim(),
380  "The dimension of topology and geometry should be equal!");
381  hy_assert(hyNode_factory_.n_hyNodes() == hyGraph_topology_->n_hyNodes(),
382  "The amount of hypernodes known to the hypernode factory is "
383  << hyNode_factory_.n_hyNodes() << ", which is not equal to the amount that the"
384  << " hypergraph assumes, i.e., " << hyGraph_topology_->n_hyNodes() << ".");
385  hy_assert(hyNode_factory_.n_hyNodes() >= 2,
386  "A hypergraph is assumed to consist of at least two hypernodes. This graph only "
387  << "consists of " << hyNode_factory_.n_hyNodes() << " hypernodes.");
388  hy_assert(hyGraph_topology_->n_hyEdges() > 0,
389  "A hypergraph is supposed to consist of at least one hyperedge. This graph "
390  << "consists of " << hyGraph_topology_->n_hyEdges() << " hyperedges.");
391  }
392  /*!***********************************************************************************************
393  * \brief Subscript operator of a HDGHyperGraph.
394  *
395  * The subscript operator takes an index referring to an hyperedge and returns the respective
396  * hyEdge containing its topological and geometrical information. Thus, this operator can be
397  * bypassed by using the functions \c hyEdge_topology (only returning the topological data) and
398  * hyEdge_geometry (ony returning the geometrical data).
399  *
400  * \param index Index of the \c hyEdge to be returned.
401  * \retval hyEdge The \c hyEdge of the given index.
402  ************************************************************************************************/
403  value_type operator[](const hyEdge_index_t index)
404  {
406  hyEdge_data(index));
407  }
408  /*!***********************************************************************************************
409  * \brief Return iterator to first hyEdge of HDGHyperGraph.
410  *
411  * This function returns an HDGHyperGraph::iterator that refers to the first \c hyEdge of the
412  * hypergraph (index = 0). Thus, it can be used to mark the starting point in \c for_each loops.
413  *
414  * \retval hyEdge Iterator referring to first \c hyEdge.
415  ************************************************************************************************/
418  {
420  *this, 0);
421  }
422  /*!***********************************************************************************************
423  * \brief Return iterator to the end of hyEdge list.
424  *
425  * This function returns an HDGHyperGraph::iterator that refers to the position of an (non-
426  * existing) \c hyEdge of the hypergraph (index = n_hyEdges), i.e., the position directly
427  * after the last valid entry of the HDGHyperGraph. Thus, it can be used to mark the ending point
428  * in \c for_each loops.
429  *
430  * \retval hyEdge Iterator referring to position behind last \c hyEdge.
431  ************************************************************************************************/
433  end()
434  {
436  *this, n_hyEdges());
437  }
438  /*!***********************************************************************************************
439  * \brief Return const reference to HyperNodeFactory.
440  *
441  * This function returns an \c HyperNodeFactory handling the access to the degrees of freedom
442  * encoded in some vector type.
443  *
444  * \retval hypernode_factory The \c HyperNodeFactory belonging the hypergraph.
445  ************************************************************************************************/
447  {
448  return hyNode_factory_;
449  }
450  /*!***********************************************************************************************
451  * \brief Topological information of prescribed hyperedge.
452  *
453  * Return the topological information of a specific hyperedge identified via its index. This
454  * function can be used to bypass the subscript operator which returns topological and geometric
455  * information about a hyperedge of given index.
456  *
457  * \param index Index of the hyperedge to be returned.
458  * \retval hyEdge_topology Topological information about hyperedge.
459  ************************************************************************************************/
460  const typename TopoT::value_type hyEdge_topology(const hyEdge_index_t index) const
461  {
462  return hyGraph_topology_->operator[](index);
463  }
464  /*!***********************************************************************************************
465  * \brief Geometrical information of prescribed hyperedge.
466  *
467  * Return the geometrical information of a specific hyperedge identified via its index. This
468  * function can be used to bypass the subscript operator which returns topological and geometric
469  * information about a hyperedge of given index.
470  *
471  * \param index Index of the hyperedge to be returned.
472  * \retval hyEdge_geometry Geometrical information about hyperedge.
473  ************************************************************************************************/
474  const typename GeomT::value_type hyEdge_geometry(const hyEdge_index_t index) const
475  {
476  return hyGraph_geometry_->operator[](index);
477  }
478  /*!***********************************************************************************************
479  * \brief Nodal information of prescribed hyperedge.
480  *
481  * \param index Index of the hyperedge to be returned.
482  * \retval hyEdge_nodedescriptor Node types of nodes of a hyperedge.
483  ************************************************************************************************/
484  const typename NodeT::value_type hyNode_descriptor(const hyEdge_index_t index) const
485  {
486  return hyGraph_node_des_->operator[](index);
487  }
488  /*!***********************************************************************************************
489  * \brief Data of prescribed hyperedge.
490  *
491  * \param index Index of the hyperedge to be returned.
492  * \retval hyEdge_data The data saved with respect to a hyperede.
493  ************************************************************************************************/
494  DataT& hyEdge_data(const hyEdge_index_t index) { return hyData_cont_.operator[](index); }
495  /*!***********************************************************************************************
496  * \brief Return the number of hyperedges making up the hypergraph.
497  *
498  * \retval n_hyEdges The total amount of hyperedges of a hypergraph.
499  ************************************************************************************************/
500  const hyEdge_index_t n_hyEdges() const { return hyGraph_topology_->n_hyEdges(); }
501  /*!***********************************************************************************************
502  * \brief Return the number of hypernodes making up the hypergraph.
503  *
504  * \retval n_hypernodes The total amount of hypernodes of a hypergraph.
505  ************************************************************************************************/
506  const hyEdge_index_t n_hyNodes() const { return hyNode_factory_.n_hyNodes(); }
507  /*!***********************************************************************************************
508  * \brief Returns the total amount of degrees of freedom in the considered hypergraph.
509  *
510  * \retval n_global_dofs The total amount of degreees of freedom in the considered
511  * hypergraph.
512  ************************************************************************************************/
513  template <typename dof_index_t = unsigned int>
514  const dof_index_t n_global_dofs() const
515  {
516  return hyNode_factory_.n_global_dofs();
517  }
518  /*!***********************************************************************************************
519  * \brief Return the refinement level of the hypergraph.
520  ************************************************************************************************/
521  unsigned int get_refinement() const { return hyGraph_topology_->get_refinement(); }
522  /*!***********************************************************************************************
523  * \brief Set the refinement level of the hypergraph.
524  ************************************************************************************************/
525  void set_refinement(unsigned int level)
526  {
527  hyGraph_topology_->set_refinement(level);
528  hyGraph_geometry_->set_refinement(level);
529  hyGraph_node_des_->set_refinement(level);
533  }
534 }; // end of class HDGHyperGraph
HDGHyperGraph::hyGraph_topology_
std::shared_ptr< TopoT > hyGraph_topology_
Topology of the hypergraph.
Definition: hdg_hypergraph.hxx:264
hy_assert.hxx
This file provides the function hy_assert.
HDGHyperGraph::hyGraph_geometry_
std::shared_ptr< GeomT > hyGraph_geometry_
Geometry of the hypergraph.
Definition: hdg_hypergraph.hxx:271
HDGHyperGraph::n_global_dofs
const dof_index_t n_global_dofs() const
Returns the total amount of degrees of freedom in the considered hypergraph.
Definition: hdg_hypergraph.hxx:514
HDGHyperGraph::HDGHyperGraph
HDGHyperGraph(std::shared_ptr< TopoT > topo, std::shared_ptr< GeomT > geom, std::shared_ptr< NodeT > node)
Construct HDGHyperGraph from existing topology and geometry.
Definition: hdg_hypergraph.hxx:370
HDGHyperGraph::iterator::operator*
HDGHyperGraph::value_type operator*()
Dereference iterator to hyEdge.
Definition: hdg_hypergraph.hxx:220
HDGHyperGraph::hyNode_factory_
HyperNodeFactory< n_dofs_per_nodeT, hyEdge_index_t > hyNode_factory_
Hypernode factory administrating the access to degrees of freedom.
Definition: hdg_hypergraph.hxx:285
HDGHyperGraph::get_refinement
unsigned int get_refinement() const
Return the refinement level of the hypergraph.
Definition: hdg_hypergraph.hxx:521
HDGHyperGraph::set_refinement
void set_refinement(unsigned int level)
Set the refinement level of the hypergraph.
Definition: hdg_hypergraph.hxx:525
check_push_test.index
index
Definition: check_push_test.py:10
HDGHyperGraph::hyEdge::hyEdge
hyEdge(const typename TopoT::value_type &topo, const typename GeomT::value_type &geom, const typename NodeT::value_type &node, DataT &dat)
Construct the struct that contains geometrical and topological information on a hyperedge.
Definition: hdg_hypergraph.hxx:98
HDGHyperGraph::HDGHyperGraph
HDGHyperGraph(const typename TopoT::constructor_value_type &construct_topo, const typename GeomT::constructor_value_type &construct_geom)
Construct HDGHyperGraph from constructor_value_type.
Definition: hdg_hypergraph.hxx:337
HDGHyperGraph::iterator::iterator
iterator(const iterator &other)
Copy–construct an iterator from another iterator.
Definition: hdg_hypergraph.hxx:152
HDGHyperGraph::end
HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator end()
Return iterator to the end of hyEdge list.
Definition: hdg_hypergraph.hxx:433
HDGHyperGraph
The class template uniting topology and geometry of a hypergraph with the topology of the skeleton sp...
Definition: hdg_hypergraph.hxx:51
hy_data_container.hxx
HDGHyperGraph::n_dofs_per_node
static constexpr unsigned int n_dofs_per_node()
Returns the template parameter representing the amount of dofs per node.
Definition: hdg_hypergraph.hxx:255
HDGHyperGraph::iterator::hyGraph_
HDGHyperGraph & hyGraph_
Reference to the HDGHyperGraph of the iterator.
Definition: hdg_hypergraph.hxx:123
HDGHyperGraph::iterator::operator++
iterator operator++(int)
Increment iterator and return old iterator.
Definition: hdg_hypergraph.hxx:201
HDGHyperGraph::hyData_cont_
HyDataContainer< DataT > hyData_cont_
Hypernode factory administrating the access to degrees of freedom.
Definition: hdg_hypergraph.hxx:293
hypernodefactory.hxx
HDGHyperGraph::iterator::operator--
iterator & operator--()
Decrement iterator and return incremented iterator.
Definition: hdg_hypergraph.hxx:186
HDGHyperGraph::hyEdge_geometry
const GeomT::value_type hyEdge_geometry(const hyEdge_index_t index) const
Geometrical information of prescribed hyperedge.
Definition: hdg_hypergraph.hxx:474
HDGHyperGraph::hyNode_descriptor
const NodeT::value_type hyNode_descriptor(const hyEdge_index_t index) const
Nodal information of prescribed hyperedge.
Definition: hdg_hypergraph.hxx:484
HDGHyperGraph::iterator::operator==
bool operator==(const iterator &other)
Check for equality with another iterator.
Definition: hdg_hypergraph.hxx:231
HDGHyperGraph::hyEdge::node_descriptor
NodeT::value_type node_descriptor
Type of nodes information of a hyperedge.
Definition: hdg_hypergraph.hxx:79
HyperNodeFactory
This class is responsible for the mapping of hypernodes to global degrees of freedom.
Definition: hypernodefactory.hxx:21
HDGHyperGraph::HDGHyperGraph
HDGHyperGraph(const typename TopoT::constructor_value_type &construct_topo)
Construct HDGHyperGraph from constructor_value_type.
Definition: hdg_hypergraph.hxx:306
HDGHyperGraph::hyEdge::data
DataT & data
Type of nodes information of a hyperedge.
Definition: hdg_hypergraph.hxx:85
HyDataContainer
Class for saving some (abstract) data per hyperedge.
Definition: hy_data_container.hxx:23
HDGHyperGraph::n_hyNodes
const hyEdge_index_t n_hyNodes() const
Return the number of hypernodes making up the hypergraph.
Definition: hdg_hypergraph.hxx:506
HDGHyperGraph::iterator::iterator
iterator(HDGHyperGraph &hyGraph, const hyEdge_index_t index)
Construct an iterator from an HDGHyperGraph and an index.
Definition: hdg_hypergraph.hxx:142
HDGHyperGraph::hyEdge_data
DataT & hyEdge_data(const hyEdge_index_t index)
Data of prescribed hyperedge.
Definition: hdg_hypergraph.hxx:494
HDGHyperGraph::iterator::index_
hyEdge_index_t index_
Index of the hyEdge of the iterator.
Definition: hdg_hypergraph.hxx:130
HDGHyperGraph::operator[]
value_type operator[](const hyEdge_index_t index)
Subscript operator of a HDGHyperGraph.
Definition: hdg_hypergraph.hxx:403
HDGHyperGraph::iterator
Iterator for struct hyEdge returned by operator[].
Definition: hdg_hypergraph.hxx:114
HDGHyperGraph::value_type
struct HDGHyperGraph::hyEdge value_type
The type for a hyperedge returned by operator[].
HDGHyperGraph::n_hyEdges
const hyEdge_index_t n_hyEdges() const
Return the number of hyperedges making up the hypergraph.
Definition: hdg_hypergraph.hxx:500
HDGHyperGraph::hyEdge
The type for a hyperedge returned by operator[].
Definition: hdg_hypergraph.hxx:60
HDGHyperGraph::hyEdge::topology
TopoT::value_type topology
Topological information of a hyperedge.
Definition: hdg_hypergraph.hxx:67
HDGHyperGraph::hyEdge::geometry
GeomT::value_type geometry
Geometrical information of a hyperedge.
Definition: hdg_hypergraph.hxx:73
hy_assert
#define hy_assert(Expr, Msg)
The assertion to be used within HyperHDG — deactivate using -DNDEBUG compile flag.
Definition: hy_assert.hxx:38
HDGHyperGraph::begin
HDGHyperGraph< n_dofs_per_nodeT, TopoT, GeomT, NodeT, DataT, hyEdge_index_t >::iterator begin()
Return iterator to first hyEdge of HDGHyperGraph.
Definition: hdg_hypergraph.hxx:417
HDGHyperGraph::hyNode_factory
const HyperNodeFactory< n_dofs_per_nodeT, hyEdge_index_t > & hyNode_factory() const
Return const reference to HyperNodeFactory.
Definition: hdg_hypergraph.hxx:446
HDGHyperGraph::iterator::operator++
iterator & operator++()
Increment iterator and return incremented iterator.
Definition: hdg_hypergraph.hxx:171
HDGHyperGraph::iterator::operator=
iterator & operator=(const iterator &other)=default
Copy–assign an iterator from another iterator.
HDGHyperGraph::hyEdge_dim
static constexpr unsigned int hyEdge_dim()
Returns the template parameter representing the dimension of a hyperedge.
Definition: hdg_hypergraph.hxx:243
EmptyC
Empty class as defaultd data class.
Definition: hdg_hypergraph.hxx:12
HDGHyperGraph::hyEdge_topology
const TopoT::value_type hyEdge_topology(const hyEdge_index_t index) const
Topological information of prescribed hyperedge.
Definition: hdg_hypergraph.hxx:460
HDGHyperGraph::iterator::operator--
iterator operator--(int)
Decrement iterator and return old iterator.
Definition: hdg_hypergraph.hxx:212
HDGHyperGraph::space_dim
static constexpr unsigned int space_dim()
Returns the template parameter representing the dimension of the space.
Definition: hdg_hypergraph.hxx:249
HDGHyperGraph::hyGraph_node_des_
std::shared_ptr< NodeT > hyGraph_node_des_
Node descriptions of the hypergraph.
Definition: hdg_hypergraph.hxx:277