Reference documentation for deal.II version Git 2618e0f 2017-11-23 17:25:26 +0100
mapping.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2016 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_mapping_h
17 #define dealii_mapping_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/derivative_form.h>
22 #include <deal.II/grid/tria.h>
23 #include <deal.II/fe/fe_update_flags.h>
24 
25 #include <array>
26 #include <cmath>
27 
28 DEAL_II_NAMESPACE_OPEN
29 
30 template <typename ElementType> class ArrayView;
31 template <int dim> class Quadrature;
32 template <int dim, int spacedim> class FEValues;
33 template <int dim, int spacedim> class FEValuesBase;
34 template <int dim, int spacedim> class FEValues;
35 template <int dim, int spacedim> class FEFaceValues;
36 template <int dim, int spacedim> class FESubfaceValues;
37 
38 
51 {
56  mapping_none = 0x0000,
57 
62 
67 
73 
79 
86  mapping_piola = 0x0100,
87 
93 
101  mapping_nedelec = 0x0200,
102 
107 
112 
123 
129 
135 };
136 
137 
286 template <int dim, int spacedim=dim>
287 class Mapping : public Subscriptor
288 {
289 public:
290 
294  virtual ~Mapping () = default;
295 
305  virtual
306  Mapping<dim,spacedim> *clone () const = 0;
307 
322  virtual
323  std::array<Point<spacedim>, GeometryInfo<dim>::vertices_per_cell>
324  get_vertices (const typename Triangulation<dim,spacedim>::cell_iterator &cell) const;
325 
337  virtual
338  bool preserves_vertex_locations () const = 0;
339 
356  virtual
359  const Point<dim> &p) const = 0;
360 
389  virtual
390  Point<dim>
392  const Point<spacedim> &p) const = 0;
393 
403  Point<dim-1>
405  const unsigned int &face_no,
406  const Point<spacedim> &p) const;
407 
422 
423 
432  "Computing the mapping between a real space point and a point in reference "
433  "space failed, typically because the given point lies outside the cell "
434  "where the inverse mapping is not unique.");
435 
444  Point<spacedim>, double, int,
445  << "The image of the mapping applied to cell with center ["
446  << arg1 << "] is distorted. The cell geometry or the "
447  << "mapping are invalid, giving a non-positive volume "
448  << "fraction of " << arg2 << " in quadrature point "
449  << arg3 << ".");
450 
460 public:
527  {
528  public:
533  InternalDataBase ();
534 
538  InternalDataBase (const InternalDataBase &) = delete;
539 
543  virtual ~InternalDataBase () = default;
544 
560 
564  virtual std::size_t memory_consumption () const;
565  };
566 
567 
568 protected:
592  virtual
594  requires_update_flags (const UpdateFlags update_flags) const = 0;
595 
644  virtual
646  get_data (const UpdateFlags update_flags,
647  const Quadrature<dim> &quadrature) const = 0;
648 
676  virtual
678  get_face_data (const UpdateFlags update_flags,
679  const Quadrature<dim-1> &quadrature) const = 0;
680 
709  virtual
711  get_subface_data (const UpdateFlags update_flags,
712  const Quadrature<dim-1> &quadrature) const = 0;
713 
797  virtual
800  const CellSimilarity::Similarity cell_similarity,
801  const Quadrature<dim> &quadrature,
802  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
804 
829  virtual void
831  const unsigned int face_no,
832  const Quadrature<dim-1> &quadrature,
833  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
835 
862  virtual void
864  const unsigned int face_no,
865  const unsigned int subface_no,
866  const Quadrature<dim-1> &quadrature,
867  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
869 
874 public:
875 
943  virtual
944  void
945  transform (const ArrayView<const Tensor<1,dim> > &input,
946  const MappingType type,
947  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
948  const ArrayView<Tensor<1,spacedim> > &output) const = 0;
949 
996  virtual
997  void
999  const MappingType type,
1000  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1001  const ArrayView<Tensor<2,spacedim> > &output) const = 0;
1002 
1055  virtual
1056  void
1057  transform (const ArrayView<const Tensor<2, dim> > &input,
1058  const MappingType type,
1059  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1060  const ArrayView<Tensor<2,spacedim> > &output) const = 0;
1061 
1101  virtual
1102  void
1104  const MappingType type,
1105  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1106  const ArrayView<Tensor<3,spacedim> > &output) const = 0;
1107 
1155  virtual
1156  void
1157  transform (const ArrayView<const Tensor<3, dim> > &input,
1158  const MappingType type,
1159  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1160  const ArrayView<Tensor<3,spacedim> > &output) const = 0;
1161 
1171  friend class FEValuesBase<dim,spacedim>;
1172  friend class FEValues<dim,spacedim>;
1173  friend class FEFaceValues<dim,spacedim>;
1174  friend class FESubfaceValues<dim,spacedim>;
1175 };
1176 
1177 
1178 DEAL_II_NAMESPACE_CLOSE
1179 
1180 #endif
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const =0
static::ExceptionBase & ExcTransformationFailed()
virtual std::array< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
Definition: mapping.cc:25
virtual ~InternalDataBase()=default
MappingType
Definition: mapping.h:50
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data,::internal::FEValues::MappingRelatedData< dim, spacedim > &output_data) const =0
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim-1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data,::internal::FEValues::MappingRelatedData< dim, spacedim > &output_data) const =0
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const =0
static::ExceptionBase & ExcDistortedMappedCell(Point< spacedim > arg1, double arg2, int arg3)
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim-1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data,::internal::FEValues::MappingRelatedData< dim, spacedim > &output_data) const =0
UpdateFlags
Abstract base class for mapping classes.
Definition: dof_tools.h:46
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:582
#define DeclException0(Exception0)
Definition: exceptions.h:570
static::ExceptionBase & ExcInvalidData()
virtual InternalDataBase * get_data(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) const =0
virtual ~Mapping()=default
virtual InternalDataBase * get_subface_data(const UpdateFlags update_flags, const Quadrature< dim-1 > &quadrature) const =0
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
Definition: fe.h:33
virtual std::size_t memory_consumption() const
Definition: mapping.cc:86
virtual bool preserves_vertex_locations() const =0
virtual Mapping< dim, spacedim > * clone() const =0
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition: exceptions.h:617
Point< dim-1 > project_real_point_to_unit_point_on_face(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int &face_no, const Point< spacedim > &p) const
Definition: mapping.cc:40
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const =0
virtual InternalDataBase * get_face_data(const UpdateFlags update_flags, const Quadrature< dim-1 > &quadrature) const =0
UpdateFlags update_each
Definition: mapping.h:559