16 #include <deal.II/base/tensor.h> 17 #include <deal.II/base/std_cxx14/memory.h> 18 #include <deal.II/grid/tria_boundary.h> 19 #include <deal.II/grid/tria.h> 20 #include <deal.II/grid/tria_iterator.h> 21 #include <deal.II/grid/tria_accessor.h> 22 #include <deal.II/fe/fe_q.h> 25 DEAL_II_NAMESPACE_OPEN
32 template <
int dim,
int spacedim>
33 std::unique_ptr<Manifold<dim, spacedim> >
37 return std::unique_ptr<Manifold<dim,spacedim> >();
42 template <
int dim,
int spacedim>
53 template <
int dim,
int spacedim>
63 template <
int dim,
int spacedim>
74 get_intermediate_points_on_line (face, points);
77 get_intermediate_points_on_quad (face, points);
115 template <
int dim,
int spacedim>
132 template <
int dim,
int spacedim>
149 template <
int dim,
int spacedim>
166 template <
int dim,
int spacedim>
167 const std::vector<Point<1> > &
171 if (points.size() <= n_intermediate_points ||
172 points[n_intermediate_points].get() ==
nullptr)
175 if (points.size() <= n_intermediate_points)
176 points.resize(n_intermediate_points+1);
179 if (points[n_intermediate_points].
get() ==
nullptr)
180 points[n_intermediate_points] = std_cxx14::make_unique<QGaussLobatto<1> >
181 (n_intermediate_points+2);
183 return points[n_intermediate_points]->get_points();
193 template <
int dim,
int spacedim>
198 template <
int dim,
int spacedim>
203 return (line->vertex(0) + line->vertex(1)) / 2;
207 template <
int dim,
int spacedim>
208 std::unique_ptr<Manifold<dim, spacedim> >
211 return std_cxx14::make_unique<StraightBoundary<dim,spacedim> >();
222 compute_new_point_on_quad (
const typename Triangulation<dim, 3>::quad_iterator &quad)
277 return (quad->vertex(0) + quad->vertex(1) +
278 quad->vertex(2) + quad->vertex(3) +
279 (quad->line(0)->has_children() ?
280 quad->line(0)->child(0)->vertex(1) :
281 quad->line(0)->center()) +
282 (quad->line(1)->has_children() ?
283 quad->line(1)->child(0)->vertex(1) :
284 quad->line(1)->center()) +
285 (quad->line(2)->has_children() ?
286 quad->line(2)->child(0)->vertex(1) :
287 quad->line(2)->center()) +
288 (quad->line(3)->has_children() ?
289 quad->line(3)->child(0)->vertex(1) :
290 quad->line(3)->center()) ) / 8;
296 template <
int dim,
int spacedim>
310 return compute_new_point_on_quad<2> (quad);
320 return compute_new_point_on_quad<3> (quad);
325 template <
int dim,
int spacedim>
331 const unsigned int n=points.size();
336 const std::vector<Point<1> > &line_points = this->get_line_support_points(n);
342 for (
unsigned int i=0; i<n; ++i)
344 const double x = line_points[1+i][0];
345 points[i] = (1-x)*vertices[0] + x*vertices[1];
352 template <
int dim,
int spacedim>
367 std::vector<
Point<3> > &points)
const 369 const unsigned int spacedim = 3;
371 const unsigned int n=points.size(),
372 m=
static_cast<unsigned int>(std::sqrt(static_cast<double>(n)));
376 const std::vector<Point<1> > &line_points = this->get_line_support_points(m);
384 for (
unsigned int i=0; i<m; ++i)
386 const double y=line_points[1+i][0];
387 for (
unsigned int j=0; j<m; ++j)
389 const double x=line_points[1+j][0];
390 points[i*m+j]=((1-x) * vertices[0] +
391 x * vertices[1]) * (1-y) +
392 ((1-x) * vertices[2] +
393 x * vertices[3]) * y;
404 std::vector<
Point<3> > &points)
const 406 const unsigned int spacedim = 3;
408 const unsigned int n=points.size(),
409 m=
static_cast<unsigned int>(std::sqrt(static_cast<double>(n)));
413 const std::vector<Point<1> > &line_points = this->get_line_support_points(m);
421 for (
unsigned int i=0; i<m; ++i)
423 const double y=line_points[1+i][0];
424 for (
unsigned int j=0; j<m; ++j)
426 const double x=line_points[1+j][0];
427 points[i*m+j]=((1-x) * vertices[0] +
428 x * vertices[1]) * (1-y) +
429 ((1-x) * vertices[2] +
430 x * vertices[3]) * y;
437 template <
int dim,
int spacedim>
448 template <
int dim,
int spacedim>
459 template <
int dim,
int spacedim>
476 p2 = line->vertex(1);
477 const double s = (trial_point-p1)*(p2-p1) / ((p2-p1)*(p2-p1));
478 return p1 + s*(p2-p1);
486 template <
typename Iterator,
int spacedim,
int dim>
488 compute_projection (
const Iterator &
object,
490 std::integral_constant<int, dim>)
540 for (
unsigned int d=0; d<dim; ++d)
544 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
545 x_k += object->vertex(i) *
551 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
552 F_k += (x_k-y)*
object->vertex(i) *
556 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
557 for (
unsigned int j=0; j<GeometryInfo<dim>::vertices_per_cell; ++j)
562 H_k += (
object->vertex(i) *
object->vertex(j)) * tmp;
569 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
570 x_k += object->vertex(i) *
573 if (delta_xi.
norm() < 1
e-5)
583 template <
typename Iterator>
585 compute_projection (
const Iterator &,
587 std::integral_constant<int, 2>)
593 template <
typename Iterator>
595 compute_projection (
const Iterator &,
597 std::integral_constant<int, 2>)
617 template <
int dim,
int spacedim>
626 return internal::compute_projection (quad, y,
627 std::integral_constant<int, 2>());
632 template <
int dim,
int spacedim>
656 #include "tria_boundary.inst" 658 DEAL_II_NAMESPACE_CLOSE
const std::vector< Point< 1 > > & get_line_support_points(const unsigned int n_intermediate_points) const
static ::ExceptionBase & ExcPureFunctionCalled()
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)
#define AssertThrow(cond, exc)
numbers::NumberTraits< Number >::real_type norm() const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
static Tensor< 1, dim > d_linear_shape_function_gradient(const Point< dim > &xi, const unsigned int i)
SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const override
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
#define Assert(cond, exc)
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const override
void get_intermediate_points_on_face(const typename Triangulation< dim, spacedim >::face_iterator &face, std::vector< Point< spacedim > > &points) const
static double d_linear_shape_function(const Point< dim > &xi, const unsigned int i)
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Manifold< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
static ::ExceptionBase & ExcNotImplemented()
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const override
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const override
virtual Point< spacedim > project_to_surface(const typename Triangulation< dim, spacedim >::line_iterator &line, const Point< spacedim > &candidate) const
static ::ExceptionBase & ExcInternalError()
virtual Point< spacedim > project_to_surface(const typename Triangulation< dim, spacedim >::line_iterator &line, const Point< spacedim > &candidate) const override