Go to the documentation of this file.
25 template <
int n,
int k,
typename Bint =
unsigned int,
typename Sint =
unsigned short,
26 typename Tint =
unsigned char>
41 std::array<Sint, n - 1> result{};
42 for (Tint i = 0; i < n - 1; ++i)
63 static_assert(k >= 1,
"Element dimension of slab must be at least 1");
68 constexpr Bint
size()
const {
return aux.size(); }
73 constexpr Bint
block_size(Tint block)
const {
return aux.block_size(block); }
99 std::array<Sint, n> coordinates{};
100 for (Tint i = 0; i < k - 1; ++i)
102 const Sint c = local.along_coordinate(i);
103 const Tint d =
directions[local.along_direction(i)];
104 coordinates[d] =
reverse[i] ? (
superset.fiber_dimension(d) - c - 1) : (c);
109 for (Tint i = 0; i < n - k; ++i)
111 const Sint c = local.across_coordinate(i);
112 const Tint d =
directions[local.across_direction(i)];
122 #endif // TPCC_SLAB_H
Tensor coordinates for a facet of dimension k in the complex of dimension n.
Definition: element.h:38
constexpr Sint fiber_dimension(Tint i) const
Dimension of the fiber with given index in the tensor product.
Definition: lexicographic.h:131
static constexpr std::array< Sint, n - 1 > aux_dimensions(const Lexicographic< n, k, Bint, Sint, Tint > &from, const std::array< Tint, n - 1 > &directions)
Compute the dimensions of the auxiliary object.
Definition: slab.h:38
constexpr Slab(const Lexicographic< n, k, Bint, Sint, Tint > &from, const std::array< Tint, n - 1 > directions, const std::array< bool, n - 1 > &reverse, Tint normal_direction, Sint normal_coordinate)
Definition: slab.h:53
index
Definition: check_push_test.py:10
const Lexicographic< n, k, Bint, Sint, Tint > & superset
Definition: slab.h:30
std::array< Bint, binomial(n, k)> block_sizes
The number of objects facing the same directions.
Definition: slab.h:50
Lexicographic< n, k, Bint, Sint, Tint > super_class
Definition: slab.h:29
const std::array< bool, n - 1 > reverse
Definition: slab.h:32
const Sint normal_coordinate
Definition: slab.h:34
Definition: combinations.h:8
constexpr std::enable_if<(kk<=n), Combination< n+1, k+1, T > >::type add_and_expand(unsigned int i) const
The combination out of n+1 obtained by adding one element.
Definition: combinations.h:164
constexpr Element< n, k, Sint, Tint > operator[](Bint index) const
The element at position index, in the coordinates of the whole chain complex.
Definition: slab.h:95
Lexicographic enumeration of the k-dimensional faces in a tensor product chain complex of dimension n...
Definition: lexicographic.h:44
const std::array< Tint, n - 1 > directions
Definition: slab.h:31
Combination< n, k > orientation
A Combination enumerating the coordinate directions along which the element is aligned.
Definition: element.h:47
constexpr Bint block_size(Tint block) const
The number of elements in one direction.
Definition: slab.h:73
const Tint normal_direction
Definition: slab.h:33
constexpr T binomial(T n, T k)
Compute the binomial coefficient n over k.
Definition: combinations.h:17
const Lexicographic< n - 1,((k > 0) ? k - 1 :0), Bint, Sint, Tint > aux
Definition: slab.h:35
constexpr Bint size() const
Definition: slab.h:68