From 0a33205643205272e4f66c0855ea802cd127f85b Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 5 Jan 2018 00:12:31 +0100 Subject: [PATCH] Rebase Opencascade Boundary classes onto FlatManifold --- include/deal.II/opencascade/boundary_lib.h | 37 ++++------- tests/codim_one/torus_01.cc | 13 ++-- tests/opencascade/circle_normal_projection.cc | 2 +- .../interpolation_curve_boundary.cc | 2 +- tests/opencascade/normal_projection_01.output | 64 +++++++++---------- 5 files changed, 53 insertions(+), 65 deletions(-) diff --git a/include/deal.II/opencascade/boundary_lib.h b/include/deal.II/opencascade/boundary_lib.h index 433e41dde0..bf917df9e4 100644 --- a/include/deal.II/opencascade/boundary_lib.h +++ b/include/deal.II/opencascade/boundary_lib.h @@ -42,10 +42,10 @@ DEAL_II_NAMESPACE_OPEN namespace OpenCASCADE { /** - * A Boundary object based on OpenCASCADE TopoDS_Shape where where new - * points are first computed by averaging the surrounding points in the same - * way as FlatManifold does, and are then projected in the normal direction - * using OpenCASCADE utilities. + * A Manifold object based on OpenCASCADE TopoDS_Shape where new points are + * first computed by averaging the surrounding points in the same way as + * FlatManifold does, and are then projected in the normal direction using + * OpenCASCADE utilities. * * This class makes no assumptions on the shape you pass to it, and the * topological dimension of the Manifold is inferred from the TopoDS_Shape @@ -60,13 +60,10 @@ namespace OpenCASCADE * face would be collapsed to the edge, and your surrounding points would * not be lying on the given shape, raising an exception. * - * @deprecated This class has been deprecated in favor of the equivalent - * Manifold class. - * * @author Luca Heltai, Andrea Mola, 2011--2014. */ template - class DEAL_II_DEPRECATED NormalProjectionBoundary : public Boundary + class NormalProjectionBoundary : public FlatManifold { public: @@ -110,7 +107,7 @@ namespace OpenCASCADE }; /** - * A Boundary object based on OpenCASCADE TopoDS_Shape where new points are + * A Manifold object based on OpenCASCADE TopoDS_Shape where new points are * first computed by averaging the surrounding points in the same way as * FlatManifold does, and then projecting them onto the manifold along the * direction specified at construction time using OpenCASCADE utilities. @@ -123,22 +120,19 @@ namespace OpenCASCADE * points leaves them untouched. If this is not the case, an * ExcPointNotOnManifold is thrown. * - * Notice that this type of Boundary descriptor may fail to give results if + * Notice that this type of Manifold descriptor may fail to give results if * the triangulation to be refined is close to the boundary of the given * TopoDS_Shape, or when the direction you use at construction time does not * intersect the shape. An exception is thrown when this happens. * - * @deprecated This class has been deprecated in favor of the equivalent - * Manifold class. - * * @author Luca Heltai, Andrea Mola, 2011--2014. */ template - class DEAL_II_DEPRECATED DirectionalProjectionBoundary : public Boundary + class DirectionalProjectionBoundary : public FlatManifold { public: /** - * Construct a Boundary object which will project points on the + * Construct a Manifold object which will project points on the * TopoDS_Shape @p sh, along the given @p direction. */ DirectionalProjectionBoundary(const TopoDS_Shape &sh, @@ -180,7 +174,7 @@ namespace OpenCASCADE /** - * A Boundary object based on OpenCASCADE TopoDS_Shape where new points are + * A Manifold object based on OpenCASCADE TopoDS_Shape where new points are * first computed by averaging the surrounding points in the same way as * FlatManifold does, and then projecting them using OpenCASCADE utilities * onto the manifold along a direction which is an estimation of the @@ -215,23 +209,20 @@ namespace OpenCASCADE * ExcPointNotOnManifold is thrown. * * - * Notice that this type of Boundary descriptor may fail to give results if + * Notice that this type of Manifold descriptor may fail to give results if * the triangulation to be refined is close to the boundary of the given * TopoDS_Shape, or when the normal direction estimated from the surrounding * points does not intersect the shape. An exception is thrown when this * happens. * - * @deprecated This class has been deprecated in favor of the equivalent - * Manifold class. - * * @author Luca Heltai, Andrea Mola, 2011--2014. */ template - class DEAL_II_DEPRECATED NormalToMeshProjectionBoundary : public Boundary + class NormalToMeshProjectionBoundary : public FlatManifold { public: /** - * Construct a Boundary object which will project points on the + * Construct a Manifold object which will project points on the * TopoDS_Shape @p sh, along a direction which is approximately normal to * the mesh cell. */ @@ -264,7 +255,7 @@ namespace OpenCASCADE }; /** - * A Boundary object based on OpenCASCADE TopoDS_Shape objects which have + * A Manifold object based on OpenCASCADE TopoDS_Shape objects which have * topological dimension equal to one (TopoDS_Edge or TopoDS_Wire) where new * points are located at the arclength average of the surrounding points. If * the given TopoDS_Shape can be casted to a periodic (closed) curve, then diff --git a/tests/codim_one/torus_01.cc b/tests/codim_one/torus_01.cc index 5097f1b664..7921a245c7 100644 --- a/tests/codim_one/torus_01.cc +++ b/tests/codim_one/torus_01.cc @@ -24,29 +24,26 @@ #include #include #include -#include +#include #include -std::ofstream logfile("output"); - - int main () { const int dim = 2; const int spacedim = 3; - deallog.attach(logfile); + initlog(); - TorusBoundary boundary (1.5, .5); + TorusManifold boundary (1.5, .5); Triangulation tria; - tria.set_boundary (0, boundary); + tria.set_manifold (0, boundary); GridGenerator::torus (tria, 1.5, .5); tria.refine_global(2); GridOut grid_out; - grid_out.write_gnuplot (tria, logfile); + grid_out.write_gnuplot (tria, deallog.get_file_stream()); return 0; } diff --git a/tests/opencascade/circle_normal_projection.cc b/tests/opencascade/circle_normal_projection.cc index 2cd6fe6281..efb71dc5ef 100644 --- a/tests/opencascade/circle_normal_projection.cc +++ b/tests/opencascade/circle_normal_projection.cc @@ -68,7 +68,7 @@ int main () GridGenerator::hyper_cube(tria); // Set the exterior boundary - tria.set_boundary(0, boundary_line); + tria.set_manifold(0, boundary_line); // This is here to ignore the // points created in the interior diff --git a/tests/opencascade/interpolation_curve_boundary.cc b/tests/opencascade/interpolation_curve_boundary.cc index cfb0ab2881..9dc175e2c6 100644 --- a/tests/opencascade/interpolation_curve_boundary.cc +++ b/tests/opencascade/interpolation_curve_boundary.cc @@ -57,7 +57,7 @@ int main () GridGenerator::hyper_cube(tria); // Set the exterior boundary - tria.set_boundary(0, boundary_line); + tria.set_manifold(0, boundary_line); // This is here to ignore the points created in the interior of the // face. diff --git a/tests/opencascade/normal_projection_01.output b/tests/opencascade/normal_projection_01.output index cb62c8d6b6..972dd9cdfb 100644 --- a/tests/opencascade/normal_projection_01.output +++ b/tests/opencascade/normal_projection_01.output @@ -81,30 +81,30 @@ $NOD 79 0.0669873 0.5 0.5 80 0.5 0.933013 0.5 81 0.5 0.0669873 0.5 -82 0.183268 -0.241189 0.183268 -83 0.183268 -0.241189 0.816732 -84 0.816732 -0.241189 0.183268 -85 0.816732 -0.241189 0.816732 -86 0.183268 0.183268 -0.241189 -87 0.816732 0.183268 -0.241189 -88 0.183268 0.816732 -0.241189 -89 0.816732 0.816732 -0.241189 -90 -0.241189 0.183268 0.183268 -91 -0.241189 0.816732 0.183268 -92 -0.241189 0.183268 0.816732 -93 -0.241189 0.816732 0.816732 -94 1.24119 0.183268 0.183268 -95 1.24119 0.816732 0.183268 -96 1.24119 0.183268 0.816732 -97 1.24119 0.816732 0.816732 -98 0.183268 1.24119 0.183268 -99 0.183268 1.24119 0.816732 -100 0.816732 1.24119 0.183268 -101 0.816732 1.24119 0.816732 -102 0.183268 0.183268 1.24119 -103 0.816732 0.183268 1.24119 -104 0.183268 0.816732 1.24119 -105 0.816732 0.816732 1.24119 +82 0.186191 -0.243672 0.186191 +83 0.186191 -0.243672 0.813809 +84 0.813809 -0.243672 0.186191 +85 0.813809 -0.243672 0.813809 +86 0.186191 0.186191 -0.243672 +87 0.813809 0.186191 -0.243672 +88 0.186191 0.813809 -0.243672 +89 0.813809 0.813809 -0.243672 +90 -0.243672 0.186191 0.186191 +91 -0.243672 0.813809 0.186191 +92 -0.243672 0.186191 0.813809 +93 -0.243672 0.813809 0.813809 +94 1.24367 0.186191 0.186191 +95 1.24367 0.813809 0.186191 +96 1.24367 0.186191 0.813809 +97 1.24367 0.813809 0.813809 +98 0.186191 1.24367 0.186191 +99 0.186191 1.24367 0.813809 +100 0.813809 1.24367 0.186191 +101 0.813809 1.24367 0.813809 +102 0.186191 0.186191 1.24367 +103 0.813809 0.186191 1.24367 +104 0.186191 0.813809 1.24367 +105 0.813809 0.813809 1.24367 106 0.912665 0.912665 0.5 107 0.0873347 0.912665 0.5 108 0.912665 0.0873347 0.5 @@ -117,14 +117,14 @@ $NOD 115 0.5 0.0873347 0.912665 116 0.5 0.912665 0.0873347 117 0.5 0.0873347 0.0873347 -118 0.107556 0.107556 0.107556 -119 0.892444 0.107556 0.107556 -120 0.107556 0.892444 0.107556 -121 0.892444 0.892444 0.107556 -122 0.107556 0.107556 0.892444 -123 0.892444 0.107556 0.892444 -124 0.107556 0.892444 0.892444 -125 0.892444 0.892444 0.892444 +118 0.109238 0.109238 0.109238 +119 0.890762 0.109238 0.109238 +120 0.109238 0.890762 0.109238 +121 0.890762 0.890762 0.109238 +122 0.109238 0.109238 0.890762 +123 0.890762 0.109238 0.890762 +124 0.109238 0.890762 0.890762 +125 0.890762 0.890762 0.890762 $ENDNOD $ELM 64 -- 2.39.5