ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
transfinite_interpolation.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception or LGPL-2.1-or-later
3// Copyright (C) 2007 - 2022 by Martin Kronbichler
4// Copyright (C) 2008 - 2022 by David Wells
5// Copyright (C) 2020 - 2023 by the ryujin authors
6//
7
8#pragma once
9
10#include <deal.II/base/config.h>
11#include <deal.II/grid/manifold.h>
12
13namespace ryujin
14{
15 using namespace dealii; // FIXME: namespace pollution
16
25 template <int dim, int spacedim = dim>
26 class TransfiniteInterpolationManifold : public Manifold<dim, spacedim>
27 {
28 public:
30
32
33 std::unique_ptr<Manifold<dim, spacedim>> clone() const override;
34
35 void initialize(
36 const Triangulation<dim, spacedim> &triangulation,
37 const Manifold<dim, spacedim> &chart_manifold = FlatManifold<dim>());
38
39 Point<spacedim>
40 get_new_point(const ArrayView<const Point<spacedim>> &surrounding_points,
41 const ArrayView<const double> &weights) const override;
42
43 void
44 get_new_points(const ArrayView<const Point<spacedim>> &surrounding_points,
45 const Table<2, double> &weights,
46 ArrayView<Point<spacedim>> new_points) const override;
47
48 private:
49 std::array<unsigned int, 20> get_possible_cells_around_points(
50 const ArrayView<const Point<spacedim>> &surrounding_points) const;
51
52 typename Triangulation<dim, spacedim>::cell_iterator compute_chart_points(
53 const ArrayView<const Point<spacedim>> &surrounding_points,
54 ArrayView<Point<dim>> chart_points) const;
55
56 Point<dim>
57 pull_back(const typename Triangulation<dim, spacedim>::cell_iterator &cell,
58 const Point<spacedim> &p,
59 const Point<dim> &initial_guess) const;
60
61 Point<spacedim> push_forward(
62 const typename Triangulation<dim, spacedim>::cell_iterator &cell,
63 const Point<dim> &chart_point) const;
64
65 DerivativeForm<1, dim, spacedim> push_forward_gradient(
66 const typename Triangulation<dim, spacedim>::cell_iterator &cell,
67 const Point<dim> &chart_point,
68 const Point<spacedim> &pushed_forward_chart_point) const;
69
70 Triangulation<dim, spacedim> triangulation;
71
72 int level_coarse;
73
74 std::vector<bool> coarse_cell_is_flat;
75
76 std::unique_ptr<Manifold<dim, spacedim>> chart_manifold;
77 };
78
79} // namespace ryujin
Point< spacedim > get_new_point(const ArrayView< const Point< spacedim > > &surrounding_points, const ArrayView< const double > &weights) const override
~TransfiniteInterpolationManifold() override=default
std::unique_ptr< Manifold< dim, spacedim > > clone() const override
void get_new_points(const ArrayView< const Point< spacedim > > &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim > > new_points) const override
void initialize(const Triangulation< dim, spacedim > &triangulation, const Manifold< dim, spacedim > &chart_manifold=FlatManifold< dim >())