]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Require a Tensor for an argument that indicates direction.
authorDavid Wells <wellsd2@rpi.edu>
Sun, 4 Feb 2018 18:08:23 +0000 (13:08 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 4 Feb 2018 21:24:59 +0000 (16:24 -0500)
include/deal.II/grid/manifold_lib.h
source/grid/manifold_lib.cc
tests/bits/cylinder_04.cc
tests/mappings/mapping_q_mixed_manifolds_01.cc
tests/mappings/mapping_q_mixed_manifolds_02.cc

index 254b68361d4eb8ffa87d643b1f5120e02cfed338..c019ba58da0cdb8521a9694cbe6ead6ec5e538b8 100644 (file)
@@ -384,7 +384,7 @@ public:
    * scaled, and the given point may be any point on the axis. The tolerance
    * value is used to determine if a point is on the axis.
    */
-  CylindricalManifold (const Point<spacedim> &direction,
+  CylindricalManifold (const Tensor<1, spacedim> &direction,
                        const Point<spacedim> &point_on_axis,
                        const double tolerance = 1e-10);
 
index 255c06681966e33620da94dc0fdb4b9e05e82b3b..781ddc97988f9989a6329120b258d5c2c695f506 100644 (file)
@@ -931,7 +931,7 @@ CylindricalManifold<dim, spacedim>::CylindricalManifold(const unsigned int axis,
 
 
 template <int dim, int spacedim>
-CylindricalManifold<dim, spacedim>::CylindricalManifold(const Point<spacedim> &direction_,
+CylindricalManifold<dim, spacedim>::CylindricalManifold(const Tensor<1, spacedim> &direction_,
                                                         const Point<spacedim> &point_on_axis_,
                                                         const double tolerance) :
   ChartManifold<dim,spacedim,3>(Tensor<1,3>({0,2.*numbers::PI,0})),
index 943086dfcec08dcf8ab03ad649bfa0c4c3ec50c1..806b9efdf629ec3b93c24cb79ed5e44c414358e2 100644 (file)
@@ -52,8 +52,8 @@ void check ()
 
   GridTools::transform ((Point<dim> ( *)(const Point<dim> &))&rotate_by_xy_angle<dim>, triangulation);
 
-  static const CylindricalManifold<dim> boundary (Point<dim>(std::cos(xy_angle), std::sin(xy_angle), 0),
-                                                  Point<dim>());
+  const Tensor<1, dim> direction {{std::cos(xy_angle), std::sin(xy_angle), 0}};
+  static const CylindricalManifold<dim> boundary (direction, /*center=*/Point<dim>());
   triangulation.set_manifold (0, boundary);
   triangulation.refine_global (2);
 
@@ -71,6 +71,3 @@ int main ()
 
   check<3> ();
 }
-
-
-
index ff0adf2772b8cea73238ad49fc107ef9042357f8..470853ff350e6c22e48899085bb6985fba059731 100644 (file)
 template <int dim>
 struct ManifoldWrapper
 {
-  Manifold<dim> *operator()(const Point<dim> &direction,
+  Manifold<dim> *operator()(const Tensor<1, dim> &direction,
                             const Point<dim> &center ) const;
 };
 
 template <>
 Manifold<2> *
-ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/,
+ManifoldWrapper<2>::operator()(const Tensor<1, 2> &/*direction*/,
                                const Point<2> &center ) const
 {
   return new SphericalManifold<2>(center);
@@ -50,7 +50,7 @@ ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/,
 
 template <>
 Manifold<3> *
-ManifoldWrapper<3>::operator()(const Point<3> &direction,
+ManifoldWrapper<3>::operator()(const Tensor<1, 3> &direction,
                                const Point<3> &center ) const
 {
   return new CylindricalManifold<3>(direction, center);
@@ -59,7 +59,7 @@ ManifoldWrapper<3>::operator()(const Point<3> &direction,
 template <int dim>
 void test()
 {
-  Point<dim> direction;
+  Tensor<1, dim> direction;
   direction[dim-1] = 1.;
 
   std::shared_ptr<Manifold<dim> > cylinder_manifold
index b04e6cf28639d626e3ed4bf28b9e4ce5128717f0..22e0af0e51820b88989a07e2b37d96901b1b4179 100644 (file)
@@ -150,13 +150,13 @@ void create_triangulation(Triangulation<3> &tria)
 template <int dim>
 struct ManifoldWrapper
 {
-  Manifold<dim> *operator()(const Point<dim> &direction,
+  Manifold<dim> *operator()(const Tensor<1, dim> &direction,
                             const Point<dim> &center ) const;
 };
 
 template <>
 Manifold<2> *
-ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/,
+ManifoldWrapper<2>::operator()(const Tensor<1, 2> &/*direction*/,
                                const Point<2> &center ) const
 {
   return new SphericalManifold<2>(center);
@@ -164,7 +164,7 @@ ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/,
 
 template <>
 Manifold<3> *
-ManifoldWrapper<3>::operator()(const Point<3> &direction,
+ManifoldWrapper<3>::operator()(const Tensor<1, 3> &direction,
                                const Point<3> &center ) const
 {
   return new CylindricalManifold<3>(direction, center);
@@ -176,7 +176,7 @@ void test()
   Point<dim> center;
   center[0] = X_C;
   center[1] = Y_C;
-  Point<dim> direction;
+  Tensor<1, dim> direction;
   direction[dim-1] = 1.;
 
   std::shared_ptr<Manifold<dim> > cylinder_manifold

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.