Reference documentation for deal.II version 8.5.1
mapping.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2001 - 2015 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 
17 #include <deal.II/grid/tria.h>
18 #include <deal.II/fe/mapping.h>
19 
20 DEAL_II_NAMESPACE_OPEN
21 
22 
23 template <int dim, int spacedim>
25 {}
26 
27 
28 template <int dim, int spacedim>
29 std_cxx11::array<Point<spacedim>, GeometryInfo<dim>::vertices_per_cell>
31  const typename Triangulation<dim,spacedim>::cell_iterator &cell) const
32 {
33  std_cxx11::array<Point<spacedim>, GeometryInfo<dim>::vertices_per_cell> vertices;
34  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
35  {
36  vertices[i] = cell->vertex(i);
37  }
38  return vertices;
39 }
40 
41 
42 template<int dim, int spacedim>
43 Point<dim-1>
46  const typename Triangulation<dim,spacedim>::cell_iterator &cell,
47  const unsigned int &face_no,
48  const Point<spacedim> &p) const
49 {
50  //The function doesn't make physical sense for dim=1
51  Assert(dim>1, ExcNotImplemented());
52  //Not implemented for higher dimensions
53  Assert(dim<=3, ExcNotImplemented());
54 
55  Point<dim> unit_cell_pt = transform_real_to_unit_cell(cell, p);
56 
57  Point<dim-1> unit_face_pt;
58 
59  if (dim==2)
60  {
62  unit_face_pt = Point<dim-1>(unit_cell_pt(1));
63  else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
64  unit_face_pt = Point<dim-1>(unit_cell_pt(0));
65  }
66  else if (dim==3)
67  {
69  unit_face_pt = Point<dim-1>(unit_cell_pt(1), unit_cell_pt(2));
70  else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
71  unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(2));
72  else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 2)
73  unit_face_pt = Point<dim-1>(unit_cell_pt(0), unit_cell_pt(1));
74  }
75 
76  return unit_face_pt;
77 }
78 
79 /*------------------------------ InternalDataBase ------------------------------*/
80 
81 
82 template <int dim, int spacedim>
84  update_each(update_default)
85 {}
86 
87 
88 
89 template <int dim, int spacedim>
91 {}
92 
93 
94 
95 template <int dim, int spacedim>
96 std::size_t
98 {
99  return sizeof(*this);
100 }
101 
102 
103 /*------------------------------ InternalData ------------------------------*/
104 
105 
106 
107 // explicit instantiations
108 #include "mapping.inst"
109 
110 
111 DEAL_II_NAMESPACE_CLOSE
virtual std::size_t memory_consumption() const
Definition: mapping.cc:97
virtual ~Mapping()
Definition: mapping.cc:24
Definition: point.h:89
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
virtual ~InternalDataBase()
Definition: mapping.cc:90
No update.
#define Assert(cond, exc)
Definition: exceptions.h:313
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
static ::ExceptionBase & ExcNotImplemented()