Go to the documentation of this file. 1 #pragma once // Ensure that file is included only once in a single compilation.
42 template <
unsigned int hyEdge_dimT,
43 unsigned int space_dimT,
44 template <
typename...>
typename vectorT = std::vector,
46 template <
unsigned int,
unsigned int,
typename>
typename mapping_tM =
Mapping::Linear,
47 unsigned int hyEdge_dimTM = hyEdge_dimT,
48 unsigned int space_dimTM = space_dimT,
49 typename pt_coord_tM =
typename pointT::value_type,
50 typename hyEdge_index_t =
unsigned int,
51 typename hyNode_index_t = hyEdge_index_t,
52 typename pt_index_t = hyNode_index_t>
62 using mapping_t = mapping_tM<hyEdge_dimTM, space_dimTM, pt_coord_tM>;
72 static constexpr
unsigned int hyEdge_dim() {
return hyEdge_dimT; }
76 static constexpr
unsigned int space_dim() {
return space_dimT; }
94 pointT
point(
const unsigned int pt_index)
const
110 for (
unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
116 for (
unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
127 template <
unsigned int n_vec>
131 for (
unsigned int i = 0; i < points.
size(); ++i)
132 hy_assert(points[i] >= 0. && points[i] <= 1.,
"Point must lie in reference square!");
133 return mapping.map_reference_to_physical(points);
141 template <
unsigned int n_vec>
145 for (
unsigned int i = 0; i < points.
size(); ++i)
146 hy_assert(points[i] >= 0. && points[i] <= 1.,
"Point must lie in reference square!");
147 points =
mapping.map_reference_to_physical(points);
158 hy_assert(
index < hyEdge_dimT,
"There are only " << hyEdge_dimT <<
" spanning vectors.");
178 hy_assert(
index < 2 * hyEdge_dimT,
"A hyperedge has 2 * dim(hyEdge) faces.");
179 return std::abs(
mapping.functional_determinant_hyNode(
index / 2));
191 hy_assert(
index < 2 * hyEdge_dimT,
"A hyperedge has 2 * dim(hyEdge) inner normals.");
207 hy_assert(
index < 2 * hyEdge_dimT,
"A hyperedge has 2 * dim(hyEdge) inner normals.");
218 hy_assert(
index < 2 * hyEdge_dimT,
"A hyperedge has 2 * dim(hyEdge) inner normals.");
220 local_center[
index / 2] =
index % 2 ? 1. : 0.;
231 "This function returns one of the dim(space) - dim(hyEdge) orthonormal vectors "
232 <<
"which are orthogonal to the hyperedge.");
238 template <
unsigned int n_sub_po
ints,
typename one_dim_
float_t>
243 static_assert(n_sub_points > 0,
"No subpoints do not make sense!");
245 "The index must not exceed the number of prescribed lexicographic points.");
247 for (
unsigned int dim = 0; dim < hyEdge_dimT; ++dim)
250 index /= n_sub_points;
252 return mapping.map_reference_to_physical(pt);
258 template <
unsigned int n_sub_po
ints,
typename one_dim_
float_t>
261 unsigned int boundary_number,
262 float boundary_scale,
265 static_assert(n_sub_points > 0,
"No subpoints do not make sense!");
266 hy_assert(
index < std::pow(n_sub_points, hyEdge_dimT - 1) * hyEdge_dimT * 2,
267 "The index must not exceed the number of prescribed lexicographic points.");
269 index =
index - std::pow(n_sub_points, hyEdge_dimT - 1) * boundary_number;
270 for (
unsigned int subdim = 0; subdim < hyEdge_dimT - 1; ++subdim)
273 index /= n_sub_points;
276 unsigned int subd = 0;
277 for (
unsigned int d = 0; d < hyEdge_dimT; d++)
279 if (boundary_number / 2 == d)
280 pt[d] = boundary_scale * (boundary_number % 2 - 0.5) + 0.5;
282 pt[d] = subpt[subd++];
284 return mapping.map_reference_to_physical(pt);
294 static constexpr
unsigned int hyEdge_dim() {
return hyEdge_dimT; }
300 static constexpr
unsigned int space_dim() {
return space_dimT; }
341 File<hyEdge_dimT, space_dimT, vectorT, pointT, hyEdge_index_t, hyNode_index_t, pt_index_t>
386 "Index must be non-negative and smaller than "
387 <<
domain_info_.n_hyEdges <<
" (which is the amount of hyperedges). It was "
402 Wrapper::create_tpcc<hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t>(
Tensor coordinates for a facet of dimension k in the complex of dimension n.
Definition: element.h:38
Hypergraph geometry based on an input file.
Definition: file.hxx:53
This file provides the function hy_assert.
Point< space_dimT, pt_coord_t > outer_normal(const unsigned int index) const
Return outer normal of given index.
Definition: file.hxx:228
Point< hyEdge_dimT, pt_coord_t > local_normal(const unsigned int index) const
Return local normal of given index.
Definition: file.hxx:189
A namespace containing the different wrapper functions.
Definition: lapack.hxx:20
index
Definition: check_push_test.py:10
@ both
Definition: lexicographic.h:11
File(const constructor_value_type &topology)
Construct a hypergraph which is read from a file.
Definition: file.hxx:351
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 (slightly moved away from the b...
Definition: file.hxx:259
pointT point(const unsigned int pt_index) const
Return vertex of specified index of a hyperedge.
Definition: file.hxx:94
A namespace containing classes describing hypergraph geometries.
Definition: file.hxx:8
const DomainInfo< hyEdge_dimT, space_dimT, vectorT, pointT, hyEdge_index_t, hyNode_index_t, pt_index_t > & domain_info_
Domain Info containing all the information of the hypergraph (cf. ReadDomain.hxx).
Definition: file.hxx:312
Hypergraph topology based on an input file.
Definition: file.hxx:43
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: file.hxx:142
boundaries
Definition: lexicographic.h:9
mapping_t mapping
Hold an instance of a mapping type to be able to calculate normals and so on.
Definition: file.hxx:90
pt_coord_t face_area(const unsigned int index) const
Return Haussdorff measure of the specified hypernode.
Definition: file.hxx:176
pt_coord_t area() const
Return Haussdorff/Lebesque measure of the hyperedge.
Definition: file.hxx:172
Wrapper::tpcc_t< hyEdge_dimT, hyEdge_dimT, TPCC::boundaries::both, hyEdge_index_t > tpcc_ref_elem_
Tensor product chain complex for refined elements.
Definition: file.hxx:321
unsigned int get_refinement() const
Return the refinement level (equal to number of subintervals).
Definition: file.hxx:394
typename pointT::value_type pt_coord_t
The point type is the floating point type of pointT.
Definition: file.hxx:58
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
auto get_element(const auto &tpcc, const auto index)
Return the element of given index the TPCC.
Definition: tpcc.hxx:92
static constexpr unsigned int size()
Return size a SmallMat.
Definition: dense_la.hxx:54
Definition: combinations.h:8
value_type operator[](const hyEdge_index_t index) const
Get geometrical hyperedge of given index.
Definition: file.hxx:371
const SmallSquareMat< space_dimT, pt_coord_t > mat_q() const
Return matrix Q of the QR decomposition of the linear transoformation.
Definition: file.hxx:168
const hyEdge_index_t index_
Index of the hyperedge within the hypergraph.
Definition: file.hxx:86
hyEdge value_type
Defines the return value of the class.
Definition: file.hxx:336
index_t n_elements(const auto &tpcc)
Return the element of given index the TPCC.
Definition: tpcc.hxx:80
Mapping of a unit hypercube to a parallelotope — can also be used for simplices.
Definition: linear.hxx:18
Lexicographic enumeration of the k-dimensional faces in a tensor product chain complex of dimension n...
Definition: lexicographic.h:44
Topology::File< hyEdge_dimT, space_dimT, vectorT, pointT, hyEdge_index_t, hyNode_index_t, pt_index_t > constructor_value_type
Define the value type of input argument for standard constructor.
Definition: file.hxx:342
static constexpr unsigned int hyEdge_dim()
Return dimension of the hyperedge.
Definition: file.hxx:72
mapping_tM< hyEdge_dimTM, space_dimTM, pt_coord_tM > mapping_t
The mapping type is mapping_tt with given template parameters.
Definition: file.hxx:62
static constexpr unsigned int space_dim()
Return dimension of the surrounding space.
Definition: file.hxx:76
static constexpr unsigned int pow(unsigned int base)
Return n to the power dim.
Definition: hypercube.hxx:25
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: file.hxx:239
static constexpr unsigned int hyEdge_dim()
Returns the template parameter representing the dimension of a hyperedge.
Definition: file.hxx:294
hyEdge(const File &hyGraph_geometry, const hyEdge_index_t index)
Construct hyperedge from hypergraph and index.
Definition: file.hxx:105
#define hy_assert(Expr, Msg)
The assertion to be used within HyperHDG — deactivate using -DNDEBUG compile flag.
Definition: hy_assert.hxx:38
Point< space_dimT, pt_coord_t > inner_normal(const unsigned int index) const
Return inner normal of given index.
Definition: file.hxx:205
void set_refinement(unsigned int level)
Set the refinement level (equal to number of subintervals).
Definition: file.hxx:398
static constexpr unsigned int space_dim()
Returns the template parameter representing the dimension of the space.
Definition: file.hxx:300
unsigned int n_subintervals_
Refinment level corresponds to number of subintervals per dimension.
Definition: file.hxx:317
Point< space_dimT, pt_coord_t > face_barycenter(const unsigned int index) const
Return barycenter of face of given index.
Definition: file.hxx:216
SmallMat< n_rowsT, 1, mat_entry_t > get_column(const unsigned int col) const
Return a column of a SmallMat.
Definition: dense_la.hxx:206
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
unsigned int n_loc_ref_elem
Number of refined elements per element.
Definition: file.hxx:325
Hold all topological and geometrical information of a hypergraph.
Definition: read_domain.hxx:59
Definition of the geometry of a hypergraph's edges.
Definition: file.hxx:66
const SmallSquareMat< hyEdge_dimT, pt_coord_t > & mat_r() const
Return reduced matrix R of the QR decomposition.
Definition: file.hxx:164
const File & hyGraph_geometry_
Reference to parent hypergraph.
Definition: file.hxx:82
void set_column(const unsigned int col, const SmallMat< n_rowsT, 1, mat_entry_t > col_vec)
Set column of a SmallMat.
Definition: dense_la.hxx:220
value_type get_hyEdge(const hyEdge_index_t index) const
Get geometrical hyperedge of given index.
Definition: file.hxx:383
This class implements a small/dense matrix.
Definition: dense_la.hxx:34
SmallVec< space_dimT, pt_coord_t > span_vec(const unsigned int index) const
Return matrix column of the affine-linear transformation.
Definition: file.hxx:156
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: file.hxx:128
Helper class containing numbers and functions related to hypercubes.
Definition: hypercube.hxx:12