16 #include <deal.II/base/std_cxx14/memory.h> 18 #include <deal.II/grid/tria_accessor.h> 19 #include <deal.II/grid/tria_iterator.h> 20 #include <deal.II/grid/tria_boundary.h> 22 #include <deal.II/fe/mapping_c1.h> 26 DEAL_II_NAMESPACE_OPEN
30 template <
int dim,
int spacedim>
38 template <
int dim,
int spacedim>
50 this->
qp_mapping = std::make_shared<MappingC1<dim,spacedim>::MappingC1Generic>();
60 const unsigned int dim = 1;
72 const unsigned int dim = 2;
73 const std::array<double, 2> interior_gl_points
74 {{0.5 - 0.5*std::sqrt(1.0/5.0), 0.5 + 0.5*std::sqrt(1.0/5.0)}};
79 for (
unsigned int line_no=0; line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
83 if (line->at_boundary())
115 const Tensor<1,2> coordinate_vector = line->vertex(1) - line->vertex(0);
116 const double h = std::sqrt(coordinate_vector * coordinate_vector);
118 coordinate_axis /= h;
120 const double alpha = std::atan2(coordinate_axis[1], coordinate_axis[0]);
121 const double c = -((face_vertex_normals[0][1] * std::sin(alpha)
122 +face_vertex_normals[0][0] * std::cos(alpha)) /
123 (face_vertex_normals[0][1] * std::cos(alpha)
124 -face_vertex_normals[0][0] * std::sin(alpha)));
125 const double b = ((face_vertex_normals[1][1] * std::sin(alpha)
126 +face_vertex_normals[1][0] * std::cos(alpha)) /
127 (face_vertex_normals[1][1] * std::cos(alpha)
128 -face_vertex_normals[1][0] * std::sin(alpha)))
131 const double t1 = interior_gl_points[0];
132 const double t2 = interior_gl_points[1];
133 const double s_t1 = (((-
b-c)*t1+b)*t1+c)*t1;
134 const double s_t2 = (((-
b-c)*t2+b)*t2+c)*t2;
143 for (
unsigned int i=0; i<2; ++i)
145 Point<2> real_point (std::cos(alpha) * new_unit_points[i][0]
146 - std::sin(alpha) * new_unit_points[i][1],
147 std::sin(alpha) * new_unit_points[i][0]
148 + std::cos(alpha) * new_unit_points[i][1]);
150 real_point += line->vertex(0);
151 a.push_back (real_point);
160 a.push_back((1.0 - interior_gl_points[0])*line->vertex(0) +
161 (interior_gl_points[0]*line->vertex(1)));
162 a.push_back((1.0 - interior_gl_points[1])*line->vertex(0) +
163 (interior_gl_points[1]*line->vertex(1)));
170 template <
int dim,
int spacedim>
185 const unsigned int dim = 1;
197 const unsigned int dim = 2;
204 template <
int dim,
int spacedim>
214 template <
int dim,
int spacedim>
215 std::unique_ptr<Mapping<dim,spacedim> >
218 return std_cxx14::make_unique<MappingC1<dim,spacedim>>();
225 #include "mapping_c1.inst" 228 DEAL_II_NAMESPACE_CLOSE
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
virtual void add_quad_support_points(const typename Triangulation< dim >::cell_iterator &cell, std::vector< Point< dim > > &a) const override
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define Assert(cond, exc)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
std::shared_ptr< const MappingQGeneric< dim, spacedim > > qp_mapping
virtual void add_line_support_points(const typename Triangulation< dim >::cell_iterator &cell, std::vector< Point< dim > > &a) const override
static ::ExceptionBase & ExcNotImplemented()
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, FaceVertexNormals &face_vertex_normals) const
const Manifold< dim, spacedim > & get_manifold(const types::manifold_id number) const