From: David Wells Date: Sun, 4 Feb 2018 18:08:23 +0000 (-0500) Subject: Require a Tensor for an argument that indicates direction. X-Git-Tag: v9.0.0-rc1~467^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee8c2c5ce94e5c062bd6944636c1817dedf03a2f;p=dealii.git Require a Tensor for an argument that indicates direction. --- diff --git a/include/deal.II/grid/manifold_lib.h b/include/deal.II/grid/manifold_lib.h index 254b68361d..c019ba58da 100644 --- a/include/deal.II/grid/manifold_lib.h +++ b/include/deal.II/grid/manifold_lib.h @@ -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 &direction, + CylindricalManifold (const Tensor<1, spacedim> &direction, const Point &point_on_axis, const double tolerance = 1e-10); diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 255c066819..781ddc9798 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -931,7 +931,7 @@ CylindricalManifold::CylindricalManifold(const unsigned int axis, template -CylindricalManifold::CylindricalManifold(const Point &direction_, +CylindricalManifold::CylindricalManifold(const Tensor<1, spacedim> &direction_, const Point &point_on_axis_, const double tolerance) : ChartManifold(Tensor<1,3>({0,2.*numbers::PI,0})), diff --git a/tests/bits/cylinder_04.cc b/tests/bits/cylinder_04.cc index 943086dfce..806b9efdf6 100644 --- a/tests/bits/cylinder_04.cc +++ b/tests/bits/cylinder_04.cc @@ -52,8 +52,8 @@ void check () GridTools::transform ((Point ( *)(const Point &))&rotate_by_xy_angle, triangulation); - static const CylindricalManifold boundary (Point(std::cos(xy_angle), std::sin(xy_angle), 0), - Point()); + const Tensor<1, dim> direction {{std::cos(xy_angle), std::sin(xy_angle), 0}}; + static const CylindricalManifold boundary (direction, /*center=*/Point()); triangulation.set_manifold (0, boundary); triangulation.refine_global (2); @@ -71,6 +71,3 @@ int main () check<3> (); } - - - diff --git a/tests/mappings/mapping_q_mixed_manifolds_01.cc b/tests/mappings/mapping_q_mixed_manifolds_01.cc index ff0adf2772..470853ff35 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_01.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_01.cc @@ -36,13 +36,13 @@ template struct ManifoldWrapper { - Manifold *operator()(const Point &direction, + Manifold *operator()(const Tensor<1, dim> &direction, const Point ¢er ) const; }; template <> Manifold<2> * -ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/, +ManifoldWrapper<2>::operator()(const Tensor<1, 2> &/*direction*/, const Point<2> ¢er ) 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> ¢er ) const { return new CylindricalManifold<3>(direction, center); @@ -59,7 +59,7 @@ ManifoldWrapper<3>::operator()(const Point<3> &direction, template void test() { - Point direction; + Tensor<1, dim> direction; direction[dim-1] = 1.; std::shared_ptr > cylinder_manifold diff --git a/tests/mappings/mapping_q_mixed_manifolds_02.cc b/tests/mappings/mapping_q_mixed_manifolds_02.cc index b04e6cf286..22e0af0e51 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_02.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_02.cc @@ -150,13 +150,13 @@ void create_triangulation(Triangulation<3> &tria) template struct ManifoldWrapper { - Manifold *operator()(const Point &direction, + Manifold *operator()(const Tensor<1, dim> &direction, const Point ¢er ) const; }; template <> Manifold<2> * -ManifoldWrapper<2>::operator()(const Point<2> &/*direction*/, +ManifoldWrapper<2>::operator()(const Tensor<1, 2> &/*direction*/, const Point<2> ¢er ) 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> ¢er ) const { return new CylindricalManifold<3>(direction, center); @@ -176,7 +176,7 @@ void test() Point center; center[0] = X_C; center[1] = Y_C; - Point direction; + Tensor<1, dim> direction; direction[dim-1] = 1.; std::shared_ptr > cylinder_manifold