HyperHDG
unit_cube.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/dense_la.hxx>
4 #include <HyperHDG/hy_assert.hxx>
6 
7 #include <algorithm>
8 
9 namespace Geometry
10 {
11 /*!*************************************************************************************************
12  * \brief Define the geometry of a unit cube that is subdivided into several orthotopes.
13  *
14  * This class defines the geometry of a unit cube which is subdivided into several orthotopes. The
15  * number of orthotopes in each spatial dimension is defined by the vector that serves as the
16  * argument of the constructor.
17  *
18  * \tparam hyEdge_dimT Dimension of a hyperedge, i.e., 1 is for PDEs defined on graphs, 2 is
19  * for PDEs defined on surfaces, and 3 is for PDEs defined on volumes, ....
20  * \tparam space_dimT The dimension of the space, the object is located in. This number should
21  * be larger than or equal to hyEdge_dimT.
22  * \tparam pt_coord_t The floating point type in which the coordinates of vertices are given.
23  * Defaults to double.
24  * \tparam ConstructorVecT The vector/array type of the constructor.
25  * Defaults to SmallVec<space_dimT, unsigned int>.
26  * \tparam hyEdge_index_t The integer type in which the indices of hyperedges are represented.
27  * Defaults to unsigne int.
28  *
29  * \authors Guido Kanschat, Heidelberg University, 2019--2020.
30  * \authors Andreas Rupp, Heidelberg University, 2019--2020.
31  **************************************************************************************************/
32 template <unsigned int hyEdge_dimT,
33  unsigned int space_dimT,
34  typename pt_coord_t = double,
35  typename ConstructorVecT = SmallVec<space_dimT, unsigned int>,
36  typename hyEdge_index_t = unsigned int>
37 class UnitCube
38 {
39  /*!***********************************************************************************************
40  * \brief Definition of the geometry of a single hyperedge.
41  *
42  * A hyperege is uniquely defined by a translation, the spanning dimensions, and the lengths of
43  * the lines along the these spanning dimensions.
44  *
45  * \authors Guido Kanschat, Heidelberg University, 2019--2020.
46  * \authors Andreas Rupp, Heidelberg University, 2019--2020.
47  ************************************************************************************************/
48  class hyEdge
49  {
50  private:
51  /*!*********************************************************************************************
52  * \brief Translation vector of the origin.
53  **********************************************************************************************/
55  /*!*********************************************************************************************
56  * \brief The dimensions in wihch the orthotope evolves.
57  **********************************************************************************************/
59  /*!*********************************************************************************************
60  * \brief Lengths of the orthotope's lines which are parallel to the \c dim_indices axes.
61  **********************************************************************************************/
63 
64  /*!*********************************************************************************************
65  * \brief Fill data of hyEdge.
66  *
67  * Recursive function that fills \c translation, \c dim_indices, and \¢ char_length. To do so,
68  * it considers a single hyperedge and takes its zeroth and first faces, and the zeroth and
69  * first faces of these faces, and so on to determine the positions of the translation and the
70  * other spanning points of the interface.
71  *
72  * \tparam hyEdge_dimTT Dimension of the hyperedge or face that is considered.
73  * \param index Variable that indicates which point is investigated.
74  * Supposed to be 0, initially.
75  * \param elem Hyperedge or face which is considered.
76  * \param geometry The overall unit cube of which the initial elem is a hyperedge of.
77  * \retval index Index that is used for further (recursive) executions of the function.
78  **********************************************************************************************/
79  template <unsigned int hyEdge_dimTT>
80  unsigned int fill_data(unsigned int index,
82  const UnitCube& geometry)
83  {
84  if constexpr (hyEdge_dimTT == 0)
85  {
86  if (index == 0)
87  for (unsigned int dim_pt = 0; dim_pt < space_dimT; ++dim_pt)
88  {
89  unsigned int ext_dim = Wrapper::exterior_direction(elem, dim_pt);
90  translation[ext_dim] = (pt_coord_t)Wrapper::exterior_coordinate(elem, dim_pt) /
91  (pt_coord_t)geometry.n_elements_[ext_dim];
92  hy_assert(0. <= translation[ext_dim] && translation[ext_dim] <= 1.,
93  "The unit cube has only these cooridnates.");
94  }
95  unsigned int dim = 0;
96  for (; dim < hyEdge_dimT && char_length[dim] != 0.; ++dim)
97  ;
98  if (index == (unsigned int)1 << dim && char_length[dim] == 0.)
99  for (unsigned int dim_pt = 0; dim_pt < space_dimT; ++dim_pt)
100  {
101  unsigned int ext_dim = Wrapper::exterior_direction(elem, dim_pt);
102  pt_coord_t helper = (pt_coord_t)Wrapper::exterior_coordinate(elem, dim_pt) /
103  (pt_coord_t)geometry.n_elements_[ext_dim];
104  hy_assert(0. <= helper && helper <= 1., "The unit cube has only these cooridnates.");
105  if (helper != translation[ext_dim])
106  {
107  char_length[dim] = helper - translation[ext_dim];
108  dim_indices[dim] = ext_dim;
109  break;
110  }
111  }
112  ++index;
113  }
114  else
115  {
116  for (unsigned int i = 2 * hyEdge_dimTT - 2; i < 2 * hyEdge_dimTT; ++i)
117  index = fill_data<hyEdge_dimTT - 1>(index, Wrapper::get_face(elem, i), geometry);
118  }
119  return index;
120  }
121  /*!*********************************************************************************************
122  * \brief Refine coarse elememnt.
123  **********************************************************************************************/
125  const UnitCube& geometry)
126  {
127  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
128  {
129  char_length[dim] /= (pt_coord_t)geometry.n_subintervals_;
130  translation[dim_indices[dim]] +=
131  (pt_coord_t)Wrapper::interior_coordinate(elem, dim) * char_length[dim];
132  }
133  }
134 
135  public:
136  /*!*********************************************************************************************
137  * \brief Return dimension of the hyperedge.
138  **********************************************************************************************/
139  static constexpr unsigned int hyEdge_dim() { return hyEdge_dimT; }
140  /*!*********************************************************************************************
141  * \brief Return dimension of the surrounding space.
142  **********************************************************************************************/
143  static constexpr unsigned int space_dim() { return space_dimT; }
144  /*!*********************************************************************************************
145  * \brief Construct a orthotopic hyperedge from its index and the surrounding unit hypercube.
146  *
147  * \param index The index of the hyperedge to be created.
148  * \param geometry The surrounding unit hypercube.
149  **********************************************************************************************/
150  hyEdge(const hyEdge_index_t index, const UnitCube& geometry)
151  {
153  Wrapper::get_element(geometry.tpcc_elements_, index / geometry.n_loc_ref_elem);
155  Wrapper::get_element(geometry.tpcc_ref_elem_, index % geometry.n_loc_ref_elem);
156  fill_data<hyEdge_dimT>(0, elem, geometry);
157  adapt_data(loc_elem, geometry);
158  }
159 
160  /*!*********************************************************************************************
161  * \brief Map n_vec points from reference to physical element.
162  *
163  * \param points Matrix whose columns consist of the points to be mapped.
164  * \retval phy_points Matrix whose columns consist of the mapped points.
165  **********************************************************************************************/
166  template <unsigned int n_vec>
168  const SmallMat<hyEdge_dimT, n_vec, pt_coord_t>& points) const
169  {
170  for (unsigned int i = 0; i < points.size(); ++i)
171  hy_assert(points[i] >= 0. && points[i] <= 1., "Point must lie in reference square!");
172 
174  rep_mat<space_dimT, n_vec, pt_coord_t>(translation);
175  for (unsigned int j = 0; j < n_vec; ++j)
176  for (unsigned int i = 0; i < hyEdge_dimT; ++i)
177  phy_points(dim_indices[i], j) += points(i, j) * char_length[i];
178 
179  return phy_points;
180  }
181  /*!*********************************************************************************************
182  * \brief Map n_vec points from reference to physical element.
183  *
184  * \param points Matrix whose columns consist of the points to be mapped.
185  * \retval points Matrix whose columns consist of the mapped points.
186  **********************************************************************************************/
187  template <unsigned int n_vec>
190  {
191  hy_assert(hyEdge_dimT == space_dimT, "This is only valid of the problem is of volumetype.");
192  for (unsigned int i = 0; i < points.size(); ++i)
193  hy_assert(points[i] >= 0. && points[i] <= 1., "Point must lie in reference square!");
194 
195  for (unsigned int j = 0; j < n_vec; ++j)
196  for (unsigned int i = 0; i < space_dimT; ++i)
197  {
198  points(i, j) *= char_length[i];
199  points(i, j) += translation[i];
200  }
201 
202  return points;
203  }
204  /*!*********************************************************************************************
205  * \brief Return matrix column of the affine-linear transformation.
206  *
207  * \param index Index of the matrix column to be returned.
208  * \retval column The specified matrix column.
209  **********************************************************************************************/
211  {
212  hy_assert(index < hyEdge_dimT, "There are only " << hyEdge_dimT << " spanning vectors.");
213 
216 
217  return span_vec;
218  }
219  /*!*********************************************************************************************
220  * \brief Return reduced matrix R of the QR decomposition of the linear transoformation.
221  **********************************************************************************************/
223  {
224  return diagonal<hyEdge_dimT, hyEdge_dimT, pt_coord_t>(char_length);
225  }
226  /*!*********************************************************************************************
227  * \brief Return matrix Q of the QR decomposition of the linear transoformation.
228  **********************************************************************************************/
230  {
231  const auto& dim_ind = dim_indices.data();
233  for (unsigned int index = 0; index < hyEdge_dimT; ++index)
234  mat_q(dim_indices[index], index) = 1.;
235  unsigned int helper = 0;
236  for (unsigned int index = hyEdge_dimT; index < space_dimT; ++index)
237  {
238  while (std::find(dim_ind.begin(), dim_ind.end(), helper) != dim_ind.end())
239  ++helper;
240  mat_q(helper, index) = 1.;
241  ++helper;
242  }
243 
244  return mat_q;
245  }
246  /*!*********************************************************************************************
247  * \brief Return Haussdorff/Lebesque measure of the hyperedge.
248  **********************************************************************************************/
249  pt_coord_t area() const
250  {
251  pt_coord_t area = 1.;
252  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
253  area *= char_length[dim];
254  return area;
255  }
256  /*!*********************************************************************************************
257  * \brief Return Haussdorff measure of the specified hypernode.
258  **********************************************************************************************/
259  pt_coord_t face_area(const unsigned int index) const
260  {
261  hy_assert(index < 2 * hyEdge_dimT, "A hyperedge has 2 * dim(hyEdge) faces.");
262  pt_coord_t area = 1.;
263  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
264  if (dim != index / 2)
265  area *= char_length[dim];
266  return area;
267  }
268  /*!*********************************************************************************************
269  * \brief Return local normal of given index.
270  *
271  * Return outer unit normal with respect to the hypernode which is spanned by the vectors
272  * spanning the phyiscal element, orthogonally projected to a hyEdge_dimT dimensional space,
273  * but the vector of the given index. This is an element of the same dimension as the
274  * reference element.
275  **********************************************************************************************/
277  {
278  hy_assert(index < 2 * hyEdge_dimT, "A hyperedge has 2 * dim(hyEdge) inner normals.");
280  normal[index / 2] = index % 2 ? 1. : -1.;
281  return normal;
282  }
283  /*!*********************************************************************************************
284  * \brief Return inner normal of given index.
285  *
286  * Return outer unit normal with respect to the hypernode which is spanned by all vectors
287  * spanning the phyiscal element, but the vector of the given index. The vector has to be in
288  * the span of the columns of the local transformation matrix. This is an element of the same
289  * dimension as the full space.
290  **********************************************************************************************/
292  {
293  hy_assert(index < 2 * hyEdge_dimT, "A hyperedge has 2 * dim(hyEdge) inner normals.");
295  normal[dim_indices[index / 2]] = index % 2 ? 1. : -1.;
296  return normal;
297  }
298  /*!*********************************************************************************************
299  * \brief Return barycenter of face of given index.
300  **********************************************************************************************/
302  {
303  hy_assert(index < 2 * hyEdge_dimT, "A hyperedge has 2 * dim(hyEdge) inner normals.");
304  Point<hyEdge_dimT, pt_coord_t> local_center(0.5);
305  local_center[index / 2] = index % 2 ? 1. : 0.;
306  return map_ref_to_phys(local_center);
307  }
308  /*!*********************************************************************************************
309  * \brief Return outer normal of given index.
310  *
311  * Return unit normal with respect to the hyperedge within the full space.
312  **********************************************************************************************/
314  {
315  hy_assert(index < space_dimT - hyEdge_dimT,
316  "This function returns one of the dim(space) - dim(hyEdge) orthonormal vectors "
317  << "which are orthogonal to the hyperedge.");
318 
320  unsigned int dim = 0;
321  for (unsigned int cnt = 0; cnt < index + 1; ++dim)
322  if (std::find(dim_indices.begin(), dim_indices.end(), dim) == dim_indices.end())
323  ++cnt;
324  outer_normal[dim] = 1.;
325 
326  return outer_normal;
327  }
328  /*!*********************************************************************************************
329  * \brief Return lexicographically ordered equidistant tensorial point of given index.
330  **********************************************************************************************/
331  template <unsigned int n_sub_points, typename one_dim_float_t>
333  unsigned int index,
334  const SmallVec<n_sub_points, one_dim_float_t>& points_1d) const
335  {
336  static_assert(n_sub_points > 0, "No subpoints do not make sense!");
337  hy_assert(index < std::pow(n_sub_points, hyEdge_dimT),
338  "The index must not exceed the number of prescribed lexicographic points.");
340  for (unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
341  {
342  pt[dim] = (pt_coord_t)points_1d[index % n_sub_points];
343  index /= n_sub_points;
344  }
345  return map_ref_to_phys(pt);
346  }
347 
348  /*!*********************************************************************************************
349  * \brief Return equidistant tensorial point of given index on a given boundary face (slightly
350  * moved away from the boundary using boundary_scale), ordered lexicographically.
351  **********************************************************************************************/
352  template <unsigned int n_sub_points, typename one_dim_float_t>
354  unsigned int index,
355  unsigned int boundary_number,
356  float boundary_scale,
357  const SmallVec<n_sub_points, one_dim_float_t>& points_1d) const
358  {
359  static_assert(n_sub_points > 0, "No subpoints do not make sense!");
360  hy_assert(index < std::pow(n_sub_points, hyEdge_dimT - 1) * hyEdge_dimT * 2,
361  "The index must not exceed the number of prescribed lexicographic points.");
362  Point<hyEdge_dimT - 1, pt_coord_t> subpt;
363  index = index - std::pow(n_sub_points, hyEdge_dimT - 1) * boundary_number;
364  for (unsigned int subdim = 0; subdim < hyEdge_dimT - 1; ++subdim)
365  {
366  subpt[subdim] = (pt_coord_t)points_1d[index % n_sub_points];
367  index /= n_sub_points;
368  }
370  unsigned int subd = 0;
371  for (unsigned int d = 0; d < hyEdge_dimT; d++)
372  {
373  if (boundary_number / 2 == d)
374  pt[d] = boundary_scale * (boundary_number % 2 - 0.5) + 0.5;
375  else
376  pt[d] = subpt[subd++];
377  }
378  return map_ref_to_phys(pt);
379  }
380  }; // end of class hyEdge
381 
382  public:
383  /*!***********************************************************************************************
384  * \brief Return the template parameter representing the dimension of a hyperedge.
385  *
386  * \retval hyEdge_dimT The dimension of a hyperedge.
387  ************************************************************************************************/
388  static constexpr unsigned int hyEdge_dim() { return hyEdge_dimT; }
389  /*!***********************************************************************************************
390  * \brief Return the template parameter representing the dimension of the space.
391  *
392  * \retval space_dimT The dimension of the space.
393  ************************************************************************************************/
394  static constexpr unsigned int space_dim() { return space_dimT; }
395 
396  private:
397  /*!***********************************************************************************************
398  * \brief Number of elements per spatial dimension.
399  *
400  * A vector / array comprising the number of elements in each spatial dimension.
401  ************************************************************************************************/
403  /*!***********************************************************************************************
404  * \brief Tensor product chain complex for elements.
405  ************************************************************************************************/
408  /*!***********************************************************************************************
409  * \brief Refinment level corresponds to number of subintervals per dimension.
410  ************************************************************************************************/
411  unsigned int n_subintervals_;
412  /*!***********************************************************************************************
413  * \brief Tensor product chain complex for refined elements.
414  ************************************************************************************************/
416  /*!***********************************************************************************************
417  * \brief Number of refined elements per element.
418  ************************************************************************************************/
419  unsigned int n_loc_ref_elem;
420 
421  public:
422  /*!***********************************************************************************************
423  * \brief Defines the return value of the class.
424  *
425  * The \c class \c UnitCube defines the geometry of the hypergraph. It contains the different
426  * hyperedges (that actually are constructed everytime access is needed from e.g. the solver
427  * class). Thus, its main purpose is to provide a structure that administrates the hyperedges that
428  * are the return value of this structure.
429  ************************************************************************************************/
431  /*!***********************************************************************************************
432  * \brief Defines the value type of input argument for standard constructor.
433  *
434  * To receive very general global loops, constructors need to account for the fact that the
435  * specific topology / geometry of a hypergraph influences the way in which the hypergraph needs
436  * to be constructed. The \c typedef implements the aspect, that a cubic hypergraph geometry which
437  * is a unit cube is by default constructed by a vector / array that contains the numbers of
438  * elements in the different dimensions.
439  ************************************************************************************************/
440  typedef ConstructorVecT constructor_value_type;
441  /*!***********************************************************************************************
442  * \brief Construct a cubic that describes a unit cube hypergraph.
443  *
444  * Constructs a hypergraph from a \c constructor_value_type containing the elementens per spatial
445  * dimension.
446  *
447  * \param n_elements The number of elements per spatial dimension.
448  ************************************************************************************************/
452  Wrapper::create_tpcc<hyEdge_dimT, space_dimT, TPCC::boundaries::both, hyEdge_index_t>(
453  n_elements)),
454  n_subintervals_(1),
456  Wrapper::create_tpcc<hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t>(
457  SmallVec<hyEdge_dimT, unsigned int>(n_subintervals_))),
458  n_loc_ref_elem(Hypercube<hyEdge_dimT>::pow(n_subintervals_))
459  {
460  }
461  /*!***********************************************************************************************
462  * \brief Construct a unit cube from its topological information
463  *
464  * Constructs a hypergraph from a \c Topology::Cubic containing the elementens per spatial
465  * dimension.
466  *
467  * \param other The topology of the hypergraph that has the geometry of the unit cube.
468  ************************************************************************************************/
470  : n_elements_(other.n_elements()),
472  Wrapper::create_tpcc<hyEdge_dimT, space_dimT, TPCC::boundaries::both, hyEdge_index_t>(
473  other.n_elements())),
476  Wrapper::create_tpcc<hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t>(
477  SmallVec<hyEdge_dimT, unsigned int>(n_subintervals_))),
478  n_loc_ref_elem(Hypercube<hyEdge_dimT>::pow(n_subintervals_))
479  {
480  }
481  /*!***********************************************************************************************
482  * \brief Get geometrical hyperedge of given index.
483  *
484  * This function returns the hyperedge of the given index, i.e., it returns the geometrical
485  * hyperedge (\b not the topological information). The geometrical informatiom comprises the
486  * indices of adjacent vertices (i.e. points) and information about their respective positions.
487  *
488  * \param index The index of the hyperedge to be returned.
489  * \retval hyperedge Geometrical information on the hyperedge (cf. \c value_type).
490  ************************************************************************************************/
491  const value_type operator[](const hyEdge_index_t index) const { return hyEdge(index, *this); }
492  /*!***********************************************************************************************
493  * \brief Return the refinement level (equal to number of subintervals).
494  ************************************************************************************************/
495  unsigned int get_refinement() const { return n_subintervals_; }
496  /*!***********************************************************************************************
497  * \brief Set the refinement level (equal to number of subintervals).
498  ************************************************************************************************/
499  void set_refinement(unsigned int level)
500  {
501  n_subintervals_ = level;
503  Wrapper::create_tpcc<hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t>(
506  }
507 }; // end class UnitCube
508 
509 } // end namespace Geometry
TPCC::Element
Tensor coordinates for a facet of dimension k in the complex of dimension n.
Definition: element.h:38
hy_assert.hxx
This file provides the function hy_assert.
Wrapper
A namespace containing the different wrapper functions.
Definition: lapack.hxx:20
check_push_test.index
index
Definition: check_push_test.py:10
cubic.hxx
TPCC::both
@ both
Definition: lexicographic.h:11
Geometry::UnitCube::constructor_value_type
ConstructorVecT constructor_value_type
Defines the value type of input argument for standard constructor.
Definition: unit_cube.hxx:440
Geometry
A namespace containing classes describing hypergraph geometries.
Definition: file.hxx:8
Geometry::UnitCube::hyEdge::face_barycenter
Point< space_dimT, pt_coord_t > face_barycenter(const unsigned int index) const
Return barycenter of face of given index.
Definition: unit_cube.hxx:301
diffusion_uniform.geometry
geometry
Definition: diffusion_uniform.py:19
TPCC::boundaries
boundaries
Definition: lexicographic.h:9
Geometry::UnitCube::hyEdge::char_length
SmallVec< hyEdge_dimT, pt_coord_t > char_length
Lengths of the orthotope's lines which are parallel to the dim_indices axes.
Definition: unit_cube.hxx:62
Geometry::UnitCube::hyEdge::fill_data
unsigned int fill_data(unsigned int index, const Wrapper::tpcc_elem_t< hyEdge_dimTT, space_dimT > &elem, const UnitCube &geometry)
Fill data of hyEdge.
Definition: unit_cube.hxx:80
Geometry::UnitCube::tpcc_elements_
const Wrapper::tpcc_t< hyEdge_dimT, space_dimT, TPCC::boundaries::both, hyEdge_index_t > tpcc_elements_
Tensor product chain complex for elements.
Definition: unit_cube.hxx:407
Wrapper::exterior_coordinate
unsigned int exterior_coordinate(const auto &elem, const unsigned int index)
Return coordinate value with respect to index-th orthonormal direction on element.
Definition: tpcc.hxx:150
Geometry::UnitCube::n_loc_ref_elem
unsigned int n_loc_ref_elem
Number of refined elements per element.
Definition: unit_cube.hxx:419
Wrapper::get_face
auto get_face(const auto &elem, const unsigned int index)
Return i-th element facet.
Definition: tpcc.hxx:121
Geometry::UnitCube::hyEdge::inner_normal
Point< space_dimT, pt_coord_t > inner_normal(const unsigned int index) const
Return inner normal of given index.
Definition: unit_cube.hxx:291
Wrapper::interior_coordinate
unsigned int interior_coordinate(const auto &elem, const unsigned int index)
Return coordinate value with respect to index-th orthonormal direction of element.
Definition: tpcc.hxx:159
Geometry::UnitCube::n_elements_
const SmallVec< space_dimT, unsigned int > n_elements_
Number of elements per spatial dimension.
Definition: unit_cube.hxx:402
Geometry::UnitCube::hyEdge::hyEdge
hyEdge(const hyEdge_index_t index, const UnitCube &geometry)
Construct a orthotopic hyperedge from its index and the surrounding unit hypercube.
Definition: unit_cube.hxx:150
Wrapper::get_element
auto get_element(const auto &tpcc, const auto index)
Return the element of given index the TPCC.
Definition: tpcc.hxx:92
Geometry::UnitCube::hyEdge::boundary_lexicographic
Point< space_dimT, pt_coord_t > boundary_lexicographic(unsigned int index, unsigned int boundary_number, float boundary_scale, const SmallVec< n_sub_points, one_dim_float_t > &points_1d) const
Return equidistant tensorial point of given index on a given boundary face (slightly moved away from ...
Definition: unit_cube.hxx:353
Geometry::UnitCube
Define the geometry of a unit cube that is subdivided into several orthotopes.
Definition: unit_cube.hxx:37
SmallMat::size
static constexpr unsigned int size()
Return size a SmallMat.
Definition: dense_la.hxx:54
Geometry::UnitCube::hyEdge::adapt_data
void adapt_data(const Wrapper::tpcc_elem_t< hyEdge_dimT, hyEdge_dimT > &elem, const UnitCube &geometry)
Refine coarse elememnt.
Definition: unit_cube.hxx:124
TPCC
Definition: combinations.h:8
Geometry::UnitCube::hyEdge_dim
static constexpr unsigned int hyEdge_dim()
Return the template parameter representing the dimension of a hyperedge.
Definition: unit_cube.hxx:388
Geometry::UnitCube::UnitCube
UnitCube(const Topology::Cubic< hyEdge_dimT, space_dimT > &other)
Construct a unit cube from its topological information.
Definition: unit_cube.hxx:469
Geometry::UnitCube::hyEdge::mat_q
const SmallSquareMat< space_dimT, pt_coord_t > mat_q() const
Return matrix Q of the QR decomposition of the linear transoformation.
Definition: unit_cube.hxx:229
Geometry::UnitCube::hyEdge::dim_indices
SmallVec< hyEdge_dimT, unsigned int > dim_indices
The dimensions in wihch the orthotope evolves.
Definition: unit_cube.hxx:58
Wrapper::n_elements
index_t n_elements(const auto &tpcc)
Return the element of given index the TPCC.
Definition: tpcc.hxx:80
Geometry::UnitCube::hyEdge::outer_normal
Point< space_dimT, pt_coord_t > outer_normal(const unsigned int index) const
Return outer normal of given index.
Definition: unit_cube.hxx:313
TPCC::Lexicographic
Lexicographic enumeration of the k-dimensional faces in a tensor product chain complex of dimension n...
Definition: lexicographic.h:44
Geometry::UnitCube::hyEdge::span_vec
SmallVec< space_dimT, pt_coord_t > span_vec(const unsigned int index) const
Return matrix column of the affine-linear transformation.
Definition: unit_cube.hxx:210
Topology::Cubic
Definition of the topology of a hypergraph — Cubic HyperGraphs.
Definition: cubic.hxx:40
Geometry::UnitCube::hyEdge::local_normal
Point< hyEdge_dimT, pt_coord_t > local_normal(const unsigned int index) const
Return local normal of given index.
Definition: unit_cube.hxx:276
Geometry::UnitCube::hyEdge::area
pt_coord_t area() const
Return Haussdorff/Lebesque measure of the hyperedge.
Definition: unit_cube.hxx:249
Geometry::UnitCube::hyEdge::map_ref_to_phys
SmallMat< space_dimT, n_vec, pt_coord_t > map_ref_to_phys(const SmallMat< hyEdge_dimT, n_vec, pt_coord_t > &points) const
Map n_vec points from reference to physical element.
Definition: unit_cube.hxx:167
Geometry::UnitCube::hyEdge::mat_r
const SmallSquareMat< hyEdge_dimT, pt_coord_t > mat_r() const
Return reduced matrix R of the QR decomposition of the linear transoformation.
Definition: unit_cube.hxx:222
Geometry::UnitCube::hyEdge::space_dim
static constexpr unsigned int space_dim()
Return dimension of the surrounding space.
Definition: unit_cube.hxx:143
Geometry::UnitCube::hyEdge
Definition of the geometry of a single hyperedge.
Definition: unit_cube.hxx:48
Geometry::UnitCube::hyEdge::translation
Point< space_dimT, pt_coord_t > translation
Translation vector of the origin.
Definition: unit_cube.hxx:54
Hypercube::pow
static constexpr unsigned int pow(unsigned int base)
Return n to the power dim.
Definition: hypercube.hxx:25
Geometry::UnitCube::get_refinement
unsigned int get_refinement() const
Return the refinement level (equal to number of subintervals).
Definition: unit_cube.hxx:495
Geometry::UnitCube::hyEdge::face_area
pt_coord_t face_area(const unsigned int index) const
Return Haussdorff measure of the specified hypernode.
Definition: unit_cube.hxx:259
hy_assert
#define hy_assert(Expr, Msg)
The assertion to be used within HyperHDG — deactivate using -DNDEBUG compile flag.
Definition: hy_assert.hxx:38
dense_la.hxx
Geometry::UnitCube::value_type
hyEdge value_type
Defines the return value of the class.
Definition: unit_cube.hxx:430
Geometry::UnitCube::space_dim
static constexpr unsigned int space_dim()
Return the template parameter representing the dimension of the space.
Definition: unit_cube.hxx:394
Geometry::UnitCube::tpcc_ref_elem_
Wrapper::tpcc_t< hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t > tpcc_ref_elem_
Tensor product chain complex for refined elements.
Definition: unit_cube.hxx:415
Geometry::UnitCube::set_refinement
void set_refinement(unsigned int level)
Set the refinement level (equal to number of subintervals).
Definition: unit_cube.hxx:499
Geometry::UnitCube::hyEdge::map_ref_to_phys
SmallMat< space_dimT, n_vec, pt_coord_t > & map_ref_to_phys(SmallMat< space_dimT, n_vec, pt_coord_t > &points) const
Map n_vec points from reference to physical element.
Definition: unit_cube.hxx:188
Wrapper::create_tpcc
tpcc_t< hyEdge_dim, space_dim, bndT, index_t > create_tpcc(const SmallVec< space_dim, index_t > &vec)
Create a tensor product chain complex.
Definition: tpcc.hxx:62
Geometry::UnitCube::n_subintervals_
unsigned int n_subintervals_
Refinment level corresponds to number of subintervals per dimension.
Definition: unit_cube.hxx:411
Geometry::UnitCube::UnitCube
UnitCube(const constructor_value_type &n_elements)
Construct a cubic that describes a unit cube hypergraph.
Definition: unit_cube.hxx:449
Geometry::UnitCube::operator[]
const value_type operator[](const hyEdge_index_t index) const
Get geometrical hyperedge of given index.
Definition: unit_cube.hxx:491
SmallMat
This class implements a small/dense matrix.
Definition: dense_la.hxx:34
Wrapper::exterior_direction
unsigned int exterior_direction(const auto &elem, const unsigned int index)
Return the index-th orthonormal direction to element.
Definition: tpcc.hxx:138
Geometry::UnitCube::hyEdge::hyEdge_dim
static constexpr unsigned int hyEdge_dim()
Return dimension of the hyperedge.
Definition: unit_cube.hxx:139
Geometry::UnitCube::hyEdge::lexicographic
Point< space_dimT, pt_coord_t > lexicographic(unsigned int index, const SmallVec< n_sub_points, one_dim_float_t > &points_1d) const
Return lexicographically ordered equidistant tensorial point of given index.
Definition: unit_cube.hxx:332
Hypercube
Helper class containing numbers and functions related to hypercubes.
Definition: hypercube.hxx:12