1#ifndef TATOOINE_DETAIL_UNSTRUCTURED_SIMPLICIAL_GRID_VERTEX_PROPERTY_SAMPLER_H
2#define TATOOINE_DETAIL_UNSTRUCTURED_SIMPLICIAL_GRID_VERTEX_PROPERTY_SAMPLER_H
8template <floating_point Real, std::size_t NumDimensions,
9 std::size_t SimplexDim,
typename T>
11 :
field<vertex_property_sampler<Real, NumDimensions, SimplexDim, T>, Real,
44 template <std::size_t... VertexSeq>
46 std::index_sequence<VertexSeq...> )
const
49 if (simplex_handles.empty()) {
52 for (
auto t : simplex_handles) {
61 A(r, VertexSeq) =
m_grid[std::get<VertexSeq>(vs)](r) -
62 m_grid[std::get<0>(vs)](r);
64 ((A(r, VertexSeq) = 0), ...);
69 b(r) = x(r) -
m_grid[std::get<0>(vs)](r);
71 auto const barycentric_coord = *
solve(A, b);
72 Real
const eps = 1e-8;
73 if (((barycentric_coord(VertexSeq) >= -eps) && ...) &&
74 ((barycentric_coord(VertexSeq) <= 1 + eps) && ...)) {
76 (
m_prop[std::get<VertexSeq>(vs)] * barycentric_coord(VertexSeq)) +
Definition: grid_edge.h:16
Definition: edge_vtp_writer.h:12
auto solve(polynomial< Real, 1 > const &p) -> std::vector< Real >
solve a + b*x
Definition: polynomial.h:187
vec_type pos_type
Definition: axis_aligned_bounding_box.h:109
Definition: vertex_property_sampler.h:12
auto grid() const -> auto const &
Definition: vertex_property_sampler.h:35
auto property() const -> auto const &
Definition: vertex_property_sampler.h:36
vertex_property_sampler(grid_type const &grid, typed_vertex_property_type const &prop)
Definition: vertex_property_sampler.h:31
Real real_type
Definition: vertex_property_sampler.h:19
auto evaluate(pos_type const &x, real_type const) const -> T
Definition: vertex_property_sampler.h:38
auto evaluate(pos_type const &x, std::index_sequence< VertexSeq... >) const -> T
Definition: vertex_property_sampler.h:45
grid_type const & m_grid
Definition: vertex_property_sampler.h:27
static auto constexpr num_dimensions()
Definition: vertex_property_sampler.h:24
typename grid_type::pos_type pos_type
Definition: vertex_property_sampler.h:20
typed_vertex_property_type const & m_prop
Definition: vertex_property_sampler.h:28
typename grid_type::template typed_vertex_property_type< T > typed_vertex_property_type
Definition: vertex_property_sampler.h:22
static auto constexpr ones()
Definition: mat.h:38
static auto constexpr ood_tensor()
Definition: field.h:21
Definition: unstructured_simplicial_grid.h:52
auto simplex_at(simplex_handle t) const -> auto
Definition: unstructured_simplicial_grid.h:303
auto hierarchy() const -> auto &
Definition: unstructured_simplicial_grid.h:1201
static constexpr auto num_vertices_per_simplex()
Definition: unstructured_simplicial_grid.h:84
static auto constexpr ones()
Definition: vec.h:28