]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use copy constructors for manifolds in clone(). 13307/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 28 Jan 2022 04:25:16 +0000 (21:25 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 28 Jan 2022 04:25:16 +0000 (21:25 -0700)
source/grid/manifold_lib.cc

index ad4ad875a9e396a03df1030726dafd4feee09692..1b9ad3730ca49c52d8ebdb623afbad713496c494 100644 (file)
@@ -138,7 +138,7 @@ template <int dim, int spacedim>
 std::unique_ptr<Manifold<dim, spacedim>>
 PolarManifold<dim, spacedim>::clone() const
 {
-  return std::make_unique<PolarManifold<dim, spacedim>>(center);
+  return std::make_unique<PolarManifold<dim, spacedim>>(*this);
 }
 
 
@@ -369,7 +369,7 @@ template <int dim, int spacedim>
 std::unique_ptr<Manifold<dim, spacedim>>
 SphericalManifold<dim, spacedim>::clone() const
 {
-  return std::make_unique<SphericalManifold<dim, spacedim>>(center);
+  return std::make_unique<SphericalManifold<dim, spacedim>>(*this);
 }
 
 
@@ -1080,9 +1080,7 @@ template <int dim, int spacedim>
 std::unique_ptr<Manifold<dim, spacedim>>
 CylindricalManifold<dim, spacedim>::clone() const
 {
-  return std::make_unique<CylindricalManifold<dim, spacedim>>(direction,
-                                                              point_on_axis,
-                                                              tolerance);
+  return std::make_unique<CylindricalManifold<dim, spacedim>>(*this);
 }
 
 
@@ -1237,10 +1235,7 @@ template <int dim, int spacedim>
 std::unique_ptr<Manifold<dim, spacedim>>
 EllipticalManifold<dim, spacedim>::clone() const
 {
-  const double eccentricity = 1.0 / cosh_u;
-  return std::make_unique<EllipticalManifold<dim, spacedim>>(center,
-                                                             direction,
-                                                             eccentricity);
+  return std::make_unique<EllipticalManifold<dim, spacedim>>(*this);
 }
 
 

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.