Reference documentation for deal.II version 8.5.1
manifold_lib.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 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__manifold_lib_h
17 #define dealii__manifold_lib_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/grid/manifold.h>
22 #include <deal.II/base/function.h>
23 #include <deal.II/base/function_parser.h>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
58 template <int dim, int spacedim = dim>
59 class PolarManifold : public ChartManifold<dim, spacedim, spacedim>
60 {
61 public:
71 
77  virtual Point<spacedim>
78  pull_back(const Point<spacedim> &space_point) const;
79 
85  virtual Point<spacedim>
86  push_forward(const Point<spacedim> &chart_point) const;
87 
100  virtual
102  push_forward_gradient(const Point<spacedim> &chart_point) const;
103 
108 private:
109 
115 };
116 
117 
199 template <int dim, int spacedim = dim>
200 class SphericalManifold : public Manifold<dim, spacedim>
201 {
202 public:
207 
215  virtual
218  const Point<spacedim> &p2,
219  const double w) const;
220 
225  virtual
228  const Point<spacedim> &x2) const;
229 
236  virtual
238  get_new_point(const ::Quadrature<spacedim> &quadrature) const DEAL_II_DEPRECATED;
239 
244  virtual
246  get_new_point (const std::vector<Point<spacedim> > &vertices,
247  const std::vector<double> &weights) const;
248 
253 };
254 
255 
271 template <int dim, int spacedim = dim>
272 class CylindricalManifold : public Manifold<dim,spacedim>
273 {
274 public:
281  CylindricalManifold (const unsigned int axis = 0,
282  const double tolerance = 1e-10);
283 
293  const double tolerance = 1e-10);
294 
299  virtual Point<spacedim>
300  get_new_point(const Quadrature<spacedim> &quad) const DEAL_II_DEPRECATED;
301 
306  virtual Point<spacedim>
307  get_new_point(const std::vector<Point<spacedim> > &surrounding_points,
308  const std::vector<double> &weights) const;
309 
310 protected:
315 
320 
321 private:
326 
330  double tolerance;
331 };
332 
333 
350 template <int dim, int spacedim=dim, int chartdim=dim>
351 class FunctionManifold : public ChartManifold<dim, spacedim, chartdim>
352 {
353 public:
365  const Tensor<1,chartdim> &periodicity=Tensor<1,chartdim>(),
366  const double tolerance=1e-10);
367 
382  FunctionManifold(const std::string push_forward_expression,
383  const std::string pull_back_expression,
384  const Tensor<1,chartdim> &periodicity=Tensor<1,chartdim>(),
386  const std::string chart_vars=FunctionParser<chartdim>::default_variable_names(),
387  const std::string space_vars=FunctionParser<spacedim>::default_variable_names(),
388  const double tolerance=1e-10,
389  const double h=1e-8);
390 
395 
401  virtual Point<spacedim>
402  push_forward(const Point<chartdim> &chart_point) const;
403 
424  virtual
426  push_forward_gradient(const Point<chartdim> &chart_point) const;
427 
433  virtual Point<chartdim>
434  pull_back(const Point<spacedim> &space_point) const;
435 
436 private:
441 
447 
453 
459  const double tolerance;
460 
468  const bool owns_pointers;
469 };
470 
471 
486 template <int dim>
487 class TorusManifold : public ChartManifold<dim,3,3>
488 {
489 public:
490  static const int chartdim = 3;
491  static const int spacedim = 3;
492 
498  TorusManifold (const double R, const double r);
499 
503  virtual Point<3>
504  pull_back(const Point<3> &p) const;
505 
509  virtual Point<3>
510  push_forward(const Point<3> &chart_point) const;
511 
515  virtual
517  push_forward_gradient(const Point<3> &chart_point) const;
518 
519 private:
520  double r, R;
521 };
522 
523 DEAL_II_NAMESPACE_CLOSE
524 
525 #endif
virtual Point< spacedim > get_new_point(const ::Quadrature< spacedim > &quadrature) const 1
const double tolerance
Definition: manifold_lib.h:459
SmartPointer< const Function< chartdim >, FunctionManifold< dim, spacedim, chartdim > > push_forward_function
Definition: manifold_lib.h:446
FunctionManifold(const Function< chartdim > &push_forward_function, const Function< spacedim > &pull_back_function, const Tensor< 1, chartdim > &periodicity=Tensor< 1, chartdim >(), const double tolerance=1e-10)
static Tensor< 1, spacedim > get_periodicity()
Definition: manifold_lib.cc:38
const Point< spacedim > point_on_axis
Definition: manifold_lib.h:319
SmartPointer< const Function< spacedim >, FunctionManifold< dim, spacedim, chartdim > > pull_back_function
Definition: manifold_lib.h:452
TorusManifold(const double R, const double r)
const Point< spacedim > center
Definition: manifold_lib.h:107
virtual Point< spacedim > get_new_point(const Quadrature< spacedim > &quad) const 1
virtual DerivativeForm< 1, spacedim, spacedim > push_forward_gradient(const Point< spacedim > &chart_point) const
CylindricalManifold(const unsigned int axis=0, const double tolerance=1e-10)
PolarManifold(const Point< spacedim > center=Point< spacedim >())
Definition: manifold_lib.cc:31
virtual Point< 3 > pull_back(const Point< 3 > &p) const
const Point< spacedim > direction
Definition: manifold_lib.h:314
virtual Point< chartdim > pull_back(const Point< spacedim > &space_point) const
virtual Point< spacedim > get_intermediate_point(const Point< spacedim > &p1, const Point< spacedim > &p2, const double w) const
const Point< spacedim > center
Definition: manifold_lib.h:252
virtual Point< spacedim > push_forward(const Point< chartdim > &chart_point) const
virtual DerivativeForm< 1, chartdim, spacedim > push_forward_gradient(const Point< chartdim > &chart_point) const
virtual Point< spacedim > pull_back(const Point< spacedim > &space_point) const
Definition: manifold_lib.cc:83
FlatManifold< dim, spacedim > flat_manifold
Definition: manifold_lib.h:325
const FunctionParser< spacedim >::ConstMap const_map
Definition: manifold_lib.h:440
virtual Point< 3 > push_forward(const Point< 3 > &chart_point) const
const bool owns_pointers
Definition: manifold_lib.h:468
SphericalManifold(const Point< spacedim > center=Point< spacedim >())
virtual Tensor< 1, spacedim > get_tangent_vector(const Point< spacedim > &x1, const Point< spacedim > &x2) const
virtual DerivativeForm< 1, 3, 3 > push_forward_gradient(const Point< 3 > &chart_point) const
virtual Point< spacedim > push_forward(const Point< spacedim > &chart_point) const
Definition: manifold_lib.cc:52