Reference documentation for deal.II version 8.5.0
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/base/std_cxx11/array.h>
23 #include <deal.II/base/array_view.h>
24 #include <deal.II/grid/tria.h>
25 #include <deal.II/fe/fe_update_flags.h>
26 
27 #include <cmath>
28 
29 DEAL_II_NAMESPACE_OPEN
30 
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 ();
295 
305  virtual
306  Mapping<dim,spacedim> *clone () const = 0;
307 
322  virtual
323  std_cxx11::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  private:
533 
534  public:
539  InternalDataBase ();
540 
544  virtual ~InternalDataBase ();
545 
561 
565  virtual std::size_t memory_consumption () const;
566  };
567 
568 
569 protected:
593  virtual
595  requires_update_flags (const UpdateFlags update_flags) const = 0;
596 
645  virtual
647  get_data (const UpdateFlags update_flags,
648  const Quadrature<dim> &quadrature) const = 0;
649 
677  virtual
679  get_face_data (const UpdateFlags update_flags,
680  const Quadrature<dim-1> &quadrature) const = 0;
681 
710  virtual
712  get_subface_data (const UpdateFlags update_flags,
713  const Quadrature<dim-1> &quadrature) const = 0;
714 
798  virtual
801  const CellSimilarity::Similarity cell_similarity,
802  const Quadrature<dim> &quadrature,
803  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
805 
830  virtual void
832  const unsigned int face_no,
833  const Quadrature<dim-1> &quadrature,
834  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
836 
863  virtual void
865  const unsigned int face_no,
866  const unsigned int subface_no,
867  const Quadrature<dim-1> &quadrature,
868  const typename Mapping<dim,spacedim>::InternalDataBase &internal_data,
870 
875 public:
876 
944  virtual
945  void
946  transform (const ArrayView<const Tensor<1,dim> > &input,
947  const MappingType type,
948  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
949  const ArrayView<Tensor<1,spacedim> > &output) const = 0;
950 
997  virtual
998  void
1000  const MappingType type,
1001  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1002  const ArrayView<Tensor<2,spacedim> > &output) const = 0;
1003 
1056  virtual
1057  void
1058  transform (const ArrayView<const Tensor<2, dim> > &input,
1059  const MappingType type,
1060  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1061  const ArrayView<Tensor<2,spacedim> > &output) const = 0;
1062 
1102  virtual
1103  void
1105  const MappingType type,
1106  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1107  const ArrayView<Tensor<3,spacedim> > &output) const = 0;
1108 
1156  virtual
1157  void
1158  transform (const ArrayView<const Tensor<3, dim> > &input,
1159  const MappingType type,
1160  const typename Mapping<dim,spacedim>::InternalDataBase &internal,
1161  const ArrayView<Tensor<3,spacedim> > &output) const = 0;
1162 
1172  friend class FEValuesBase<dim,spacedim>;
1173  friend class FEValues<dim,spacedim>;
1174  friend class FEFaceValues<dim,spacedim>;
1175  friend class FESubfaceValues<dim,spacedim>;
1176 };
1177 
1178 
1179 DEAL_II_NAMESPACE_CLOSE
1180 
1181 #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()
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 ~Mapping()
Definition: mapping.cc:24
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
virtual ~InternalDataBase()
Definition: mapping.cc:90
virtual std_cxx11::array< Point< spacedim >, GeometryInfo< dim >::vertices_per_cell > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
Definition: mapping.cc:30
UpdateFlags
Abstract base class for mapping classes.
Definition: dof_tools.h:46
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:553
#define DeclException0(Exception0)
Definition: exceptions.h:541
static::ExceptionBase & ExcInvalidData()
virtual InternalDataBase * get_data(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) const =0
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:30
virtual std::size_t memory_consumption() const
Definition: mapping.cc:97
virtual bool preserves_vertex_locations() const =0
virtual Mapping< dim, spacedim > * clone() const =0
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition: exceptions.h:588
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:45
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:560