Debian Codegraph @

include/deal.II/fe/mapping_c1.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2001 - 2024 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15 #ifndef dealii_mapping_c1_h
16 #define dealii_mapping_c1_h
17
18
19 #include <deal.II/base/config.h>
20
21 #include <deal.II/fe/mapping_q.h>
22
23 DEAL_II_NAMESPACE_OPEN
24
25 /**
26 * @addtogroup mapping
27 * @{
28 */
29
30 /**
31 * Mapping class that uses C1 (continuously differentiable) cubic mappings of
32 * the boundary. This class is built atop of MappingQ by simply
33 * determining the interpolation points for a cubic mapping of the boundary
34 * differently: MappingQ chooses them such that they interpolate the boundary,
35 * while this class chooses them such that the discretized boundary is
36 * globally continuously differentiable.
37 */
38 template <int dim, int spacedim = dim>
39 class MappingC1 : public MappingQ<dim, spacedim>
40 {
41 public:
42 /**
43 * Constructor. Pass the fixed degree @p 3 down to the base class, as a
44 * cubic mapping suffices to generate a continuous mapping of the boundary.
45 */
46 MappingC1();
47
48 /**
49 * Return a pointer to a copy of the present object. The caller of this copy
50 * then assumes ownership of it.
51 */
52 virtual std::unique_ptr<Mapping<dim, spacedim>>
53 clone() const override;
54
55 /**
56 * For <tt>dim=2,3</tt>. Append the support points of all shape functions
57 * located on bounding lines to the vector @p a. Points located on the
58 * line but on vertices are not included.
59 *
60 * This function chooses the respective points not such that they are
61 * interpolating the boundary (as does the base class), but rather such
62 * that the resulting cubic mapping is a continuous one.
63 */
64 virtual void
65 add_line_support_points(
66 const typename Triangulation<dim, spacedim>::cell_iterator &cell,
67 std::vector<Point<spacedim>> &a) const override;
68
69 /**
70 * For <tt>dim=3</tt>. Append the support points of all shape functions
71 * located on bounding faces (quads in 3d) to the vector @p a. Points
72 * located on the line but on vertices are not included.
73 *
74 * This function chooses the respective points not such that they are
75 * interpolating the boundary (as does the base class), but rather such
76 * that the resulting cubic mapping is a continuous one.
77 */
78 virtual void
79 add_quad_support_points(
80 const typename Triangulation<dim, spacedim>::cell_iterator &cell,
81 std::vector<Point<spacedim>> &a) const override;
82 };
83
84 /** @} */
85
86 /* -------------- declaration of explicit specializations ------------- */
87
88 #ifndef DOXYGEN
89
90 template <>
91 void
92 MappingC1<1>::add_line_support_points(const Triangulation<1>::cell_iterator &,
93 std::vector<Point<1>> &) const;
94 template <>
95 void
96 MappingC1<2>::add_line_support_points(
97 const Triangulation<2>::cell_iterator &cell,
98 std::vector<Point<2>> &a) const;
99
100 template <>
101 void
102 MappingC1<1>::add_quad_support_points(const Triangulation<1>::cell_iterator &,
103 std::vector<Point<1>> &) const;
104 template <>
105 void
106 MappingC1<2>::add_quad_support_points(const Triangulation<2>::cell_iterator &,
107 std::vector<Point<2>> &) const;
108
109
110 #endif // DOXYGEN
111
112 DEAL_II_NAMESPACE_CLOSE
113
114 #endif