Reference documentation for deal.II version 9.3.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
mapping_q_cache.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_mapping_q_cache_h
17 #define dealii_mapping_q_cache_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/function.h>
24 
26 
27 #include <deal.II/grid/tria.h>
28 
29 
31 
32 // Forward declarations
33 #ifndef DOXYGEN
34 template <int, int>
35 class DoFHandler;
36 #endif
37 
38 
41 
42 
51 template <int dim, int spacedim = dim>
52 class MappingQCache : public MappingQGeneric<dim, spacedim>
53 {
54 public:
60  explicit MappingQCache(const unsigned int polynomial_degree);
61 
65  explicit MappingQCache(const MappingQCache<dim, spacedim> &mapping);
66 
71 
75  virtual std::unique_ptr<Mapping<dim, spacedim>>
76  clone() const override;
77 
82  virtual bool
83  preserves_vertex_locations() const override;
84 
92  void
93  initialize(const Mapping<dim, spacedim> & mapping,
95 
106  initialize(const Triangulation<dim, spacedim> & triangulation,
107  const MappingQGeneric<dim, spacedim> &mapping);
108 
130  void
131  initialize(const Triangulation<dim, spacedim> &triangulation,
132  const std::function<std::vector<Point<spacedim>>(
134  &compute_points_on_cell);
135 
153  void
154  initialize(const Mapping<dim, spacedim> & mapping,
155  const Triangulation<dim, spacedim> &tria,
156  const std::function<Point<spacedim>(
158  const Point<spacedim> &)> & transformation_function,
159  const bool function_describes_relative_displacement);
160 
164  void
165  initialize(const Mapping<dim, spacedim> & mapping,
166  const Triangulation<dim, spacedim> &tria,
167  const Function<spacedim> & transformation_function,
168  const bool function_describes_relative_displacement);
169 
181  template <typename VectorType>
182  void
183  initialize(const Mapping<dim, spacedim> & mapping,
184  const DoFHandler<dim, spacedim> &dof_handler,
185  const VectorType & vector,
186  const bool vector_describes_relative_displacement);
187 
199  template <typename VectorType>
200  void
201  initialize(const Mapping<dim, spacedim> & mapping,
202  const DoFHandler<dim, spacedim> &dof_handler,
203  const MGLevelObject<VectorType> &vectors,
204  const bool vector_describes_relative_displacement);
205 
209  std::size_t
210  memory_consumption() const;
211 
212 protected:
216  virtual std::vector<Point<spacedim>>
218  const typename Triangulation<dim, spacedim>::cell_iterator &cell)
219  const override;
220 
221 private:
227  std::shared_ptr<std::vector<std::vector<std::vector<Point<spacedim>>>>>
229 
234  boost::signals2::connection clear_signal;
235 
241 };
242 
246 
247 #endif
virtual bool preserves_vertex_locations() const override
const unsigned int polynomial_degree
#define DEAL_II_DEPRECATED_EARLY
Definition: config.h:165
std::size_t memory_consumption() const
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
void initialize(const Mapping< dim, spacedim > &mapping, const Triangulation< dim, spacedim > &triangulation)
Abstract base class for mapping classes.
Definition: mapping.h:303
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
boost::signals2::connection clear_signal
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
MappingQCache(const unsigned int polynomial_degree)
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
std::shared_ptr< std::vector< std::vector< std::vector< Point< spacedim > > > > > support_point_cache