From: Luca Heltai Date: Thu, 16 Oct 2014 19:30:30 +0000 (+0200) Subject: Fixed also last comments by @bangerth, using std::tuple where appropriate. We split... X-Git-Tag: v8.2.0-rc1~81^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c231beae621d29bcd351813de48e27b61a018186;p=dealii.git Fixed also last comments by @bangerth, using std::tuple where appropriate. We split also some of the functions in utilities.h into two different parts, one of which is transparent to the underlying OpenCASCADE structures. Added documentation directory to step-54. Replaced std::tuple with std_cxx11::tuple Fixed std_cxx11 also in the tests. --- diff --git a/examples/step-54/doc/builds-on b/examples/step-54/doc/builds-on new file mode 100644 index 0000000000..2302bdb7e5 --- /dev/null +++ b/examples/step-54/doc/builds-on @@ -0,0 +1 @@ +step-49 diff --git a/examples/step-54/doc/intro.dox b/examples/step-54/doc/intro.dox new file mode 100644 index 0000000000..e8b6366ebe --- /dev/null +++ b/examples/step-54/doc/intro.dox @@ -0,0 +1,25 @@ +
+ +This program was contributed by Andrea Mola and Luca Heltai. + +@note This program elaborates on concepts of industrial geometry, using +tools that interface with OpenCASCADE (http://www.opencascade.org) that +allow the specification of arbitrary IGES files as boundaries for your +geometries. + + + +

Introduction

+ +In some of the previous tutorial programs (step-1 and step-5 among others) +we have seen that the deal.II mesh refinement is able to + +-mesh refinement -> rule to refine boundary cells +-set_boundary +-so far only elementary shapes were considered + +-this tutorial shows how to refine a mesh on top of a complex surface +generated with a CAD modeler and saved in an IGES file. + + +

Where geometry and meshes intersect

diff --git a/examples/step-54/doc/kind b/examples/step-54/doc/kind new file mode 100644 index 0000000000..c1d9154931 --- /dev/null +++ b/examples/step-54/doc/kind @@ -0,0 +1 @@ +techniques diff --git a/examples/step-54/doc/results.dox b/examples/step-54/doc/results.dox new file mode 100644 index 0000000000..ef0e3651db --- /dev/null +++ b/examples/step-54/doc/results.dox @@ -0,0 +1,11 @@ +

Results

+ +Running the program produces a series of mesh files mesh.vtu +that we can +visualize with any of the usual visualization programs that can read the VTK +file format. + + + + + \ No newline at end of file diff --git a/examples/step-54/doc/tooltip b/examples/step-54/doc/tooltip new file mode 100644 index 0000000000..9afee0bfd9 --- /dev/null +++ b/examples/step-54/doc/tooltip @@ -0,0 +1 @@ +Geometry: Using industry standard IGES files as boundary descriptors. diff --git a/include/deal.II/opencascade/boundary_lib.h b/include/deal.II/opencascade/boundary_lib.h index 4a0553d91f..cffff0fe79 100644 --- a/include/deal.II/opencascade/boundary_lib.h +++ b/include/deal.II/opencascade/boundary_lib.h @@ -124,7 +124,7 @@ namespace OpenCASCADE * 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 appens. + * is thrown when this happens. * * @author Luca Heltai, Andrea Mola, 2011--2014. */ @@ -177,9 +177,11 @@ namespace OpenCASCADE /** * A Boundary 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 it using + * 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 surrounding points (hence mesh cell) normal. + * is an estimation of the surrounding points (hence mesh cell) + * normal. + * * The direction normal to the mesh is particularly useful because * it is the direction in which the mesh is missing nodes. For * instance, during the refinement of a cell a new node is initially @@ -194,6 +196,7 @@ namespace OpenCASCADE * triangles are identified with the points assigned, and the normals * of such triangles are averaged to obtain the approximation of * the normal to the cell. + * * The case in which 2 surrounding points are present (i.e.:a cell * edge is being refined) is of course more tricky. The average of * the CAD surface normals at the 2 surrounding points is first @@ -202,23 +205,21 @@ namespace OpenCASCADE * to have the new point with equal distance with respect to the * surrounding points * - * This class only operates with CAD faces and makes the - * assumption that the shape you pass to it - * contains at least a face. If that is not the case, an Exeption - * is thrown. In debug mode there is a sanity check to - * make sure that the surrounding points (the ones used in - * project_to_manifold()) actually live on the Manifold, i.e., - * calling OpenCASCADE::closest_point() on those points leaves them - * untouched. If this is not the case, an ExcPointNotOnManifold is - * thrown. + * This class only operates with CAD faces and makes the assumption + * that the shape you pass to it contains at least one face. If that + * is not the case, an Exception is thrown. In debug mode there is a + * sanity check to make sure that the surrounding points (the ones + * used in project_to_manifold()) actually live on the Manifold, + * i.e., calling OpenCASCADE::closest_point() on those 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 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 appens. + * estimated from the surrounding points does not intersect the + * shape. An exception is thrown when this happens. * * @author Luca Heltai, Andrea Mola, 2011--2014. */ @@ -228,7 +229,8 @@ namespace OpenCASCADE public: /** * Construct a Boundary object which will project points on the - * TopoDS_Shape @p sh, along the given @p direction. + * TopoDS_Shape @p sh, along a direction which is approximately + * normal to the mesh cell. */ NormalToMeshProjectionBoundary(const TopoDS_Shape &sh, const double tolerance=1e-7); @@ -238,9 +240,6 @@ namespace OpenCASCADE * in debug mode, checks that each of the @p surrounding_points is * within tolerance from the given TopoDS_Shape. If this is not * the case, an exception is thrown. - * - * The projected point is computed using OpenCASCADE directional - * projection algorithms. */ virtual Point project_to_manifold (const std::vector > &surrounding_points, diff --git a/include/deal.II/opencascade/utilities.h b/include/deal.II/opencascade/utilities.h index 8b6c27c3d0..e93de35ae8 100644 --- a/include/deal.II/opencascade/utilities.h +++ b/include/deal.II/opencascade/utilities.h @@ -95,14 +95,12 @@ namespace OpenCASCADE /** * Count the subobjects of a shape. This function is useful to * gather information about the TopoDS_Shape passed as argument. It - * counts the number of faces, edges and vertices (the only + * returns the number of faces, edges and vertices (the only * topological entities associated with actual geometries) which are * contained in the given shape. */ - void count_elements(const TopoDS_Shape &shape, - unsigned int &n_faces, - unsigned int &n_edges, - unsigned int &n_vertices); + std_cxx11::tuple + count_elements(const TopoDS_Shape &shape); /** * Read IGES files and translate their content into openCascade @@ -123,16 +121,17 @@ namespace OpenCASCADE /** * This function returns the tolerance associated with the shape. - * Each CAD geometrical object is defined along with a tolerance, which indicates - * possible inaccuracy of its placement. For instance, the tolerance tol of a vertex - * indicates that it can be located in any point contained in a sphere centered - * in the nominal position and having radius tol. While carrying out an operation - * such as projecting a point onto a - * surface (which will in turn have its tolerance) we must keep in mind that the - * precision of the projection will be limited by the tolerance with which the - * surface is built. - * The tolerance is computed taking the maximum tolerance among the subshapes - * composing the shape. + * Each CAD geometrical object is defined along with a tolerance, + * which indicates possible inaccuracy of its placement. For + * instance, the tolerance of a vertex indicates that it can be + * located in any point contained in a sphere centered in the + * nominal position and having radius tol. While carrying out an + * operation such as projecting a point onto a surface (which will + * in turn have its tolerance) we must keep in mind that the + * precision of the projection will be limited by the tolerance + * with which the surface is built. The tolerance is computed + * taking the maximum tolerance among the subshapes composing the + * shape. */ double get_shape_tolerance(const TopoDS_Shape &shape); @@ -219,38 +218,75 @@ namespace OpenCASCADE std::vector &shells, std::vector &wires); + /** + * Project the point @p origin on the topological shape given by @p + * in_shape, and returns the projected point, the subshape which + * contains the point and the parametric u and v coordinates of the + * point within the resulting shape. If the shape is not elementary, + * all its subshapes are iterated, faces first, then edges, and the + * returned shape is the closest one to the point @p origin. If the + * returned shape is an edge, then only the u coordinate is filled + * with sensible information, and the v coordinate is set to zero. + * + * This function returns a tuple containing the projected point, the + * shape, the u coordinate and the v coordinate (which is different + * from zero only if the resulting shape is a face). + */ + std_cxx11::tuple, TopoDS_Shape, double, double> + project_point_and_pull_back(const TopoDS_Shape &in_shape, + const Point<3> &origin, + const double tolerance=1e-7); /** - * Get the closest point to the given topological shape. If the - * shape is not elementary, all its subshapes are iterated, faces - * first, then edges, and the closest point is returned together - * with the shape which contains it, and the u v coordinates of the - * point. If the returned shape is an edge, then only the u - * coordinate is filled with sensible information, and the v - * coordinate is set to zero. + * Return the projection of the point @p origin on the topological + * shape given by @p in_shape. If the shape is not elementary, all + * its subshapes are iterated, faces first, then edges, and the + * returned point is the closest one to the @p in_shape, regardless + * of its type. */ - Point<3> closest_point(const TopoDS_Shape in_shape, - const Point<3> origin, - TopoDS_Shape &out_shape, - double &u, - double &v, + Point<3> closest_point(const TopoDS_Shape &in_shape, + const Point<3> &origin, const double tolerance=1e-7); + /** + * Given an elementary shape @p in_shape and the reference + * coordinates within the shape, returns the corresponding point in + * real space. If the shape is a TopoDS_Edge, the @p v coordinate is + * ignored. Only edges or faces, as returned by the function + * project_point_and_pull_back(), can be used as input to this + * function. If this is not the case, an Exception is thrown. + */ + Point<3> push_forward(const TopoDS_Shape &in_shape, + const double u, + const double v); + /** - * Get the closest point to the given topological shape. If the - * shape is not elementary, all its subshapes are iterated, faces - * first, then edges, and the closest point is returned together - * with the shape which contains it, and the u v coordinates of the - * point. If the returned shape is an edge, then only the u - * coordinate is filled with sensible information, and the v - * coordinate is set to zero. + * Given a TopoDS_Face @p face and the reference coordinates within + * this face, returns the corresponding point in real space, the + * normal to the surface at that point and the mean curvature as a + * tuple. */ - Point<3> closest_point_and_differential_forms(const TopoDS_Shape in_shape, - const Point<3> origin, - Point<3> &surface_normal, - double &mean_curvature, - const double tolerance=1e-7); + std_cxx11::tuple, Point<3>, double > + push_forward_and_differential_forms(const TopoDS_Face &face, + const double u, + const double v, + const double tolerance=1e-7); + + + /** + * Get the closest point to the given topological shape, together + * with the normal and the mean curvature at that point. If the + * shape is not elementary, all its sub-faces (only the faces) are + * iterated, faces first, and only the closest point is + * returned. This function will throw an exception if the @p + * in_shape does not contain at least one face. + */ + std_cxx11::tuple, Point<3>, double> + closest_point_and_differential_forms(const TopoDS_Shape &in_shape, + const Point<3> &origin, + const double tolerance=1e-7); + /** * Intersect a line passing through the given @p origin point along @@ -323,7 +359,6 @@ namespace OpenCASCADE * Trying to make operations on the wrong type of shapes. */ DeclException0(ExcUnsupportedShape); - } diff --git a/source/opencascade/boundary_lib.cc b/source/opencascade/boundary_lib.cc index 5a18647530..236c4229f5 100644 --- a/source/opencascade/boundary_lib.cc +++ b/source/opencascade/boundary_lib.cc @@ -68,15 +68,14 @@ namespace OpenCASCADE project_to_manifold (const std::vector > &surrounding_points, const Point &candidate) const { - TopoDS_Shape out_shape; - double u=0, v=0; +#ifdef DEBUG for (unsigned int i=0; i > &surrounding_points, const Point &candidate) const { - TopoDS_Shape out_shape; - double u=0, v=0; +#ifdef DEBUG for (unsigned int i=0; i + counts = count_elements(sh); - Assert(n_faces > 0, ExcMessage("NormalToMeshProjectionBoundary needs a shape containing faces to operate.")); + Assert(std_cxx11::get<0>(counts) > 0, ExcMessage("NormalToMeshProjectionBoundary needs a shape containing faces to operate.")); } @@ -141,13 +133,15 @@ namespace OpenCASCADE TopoDS_Shape out_shape; double u=0, v=0; Point<3> average_normal(0.0,0.0,0.0); +#ifdef DEBUG for (unsigned int i=0; i surface_normal; - double mean_curvature; - closest_point_and_differential_forms(sh, surrounding_points[i], surface_normal, mean_curvature); - average_normal += surface_normal; + std_cxx11::tuple, Point<3>, double> + p_and_diff_forms = + closest_point_and_differential_forms(sh, + surrounding_points[i], + tolerance); + average_normal += std_cxx11::get<1>(p_and_diff_forms); } average_normal/=2.0; @@ -166,11 +162,10 @@ namespace OpenCASCADE Assert(average_normal.norm() > 1e-4, ExcMessage("Failed to refine cell: the average of the surface normals at the surrounding edge turns out to be a null vector, making the projection direction undetermined.")); - Point<3> P = (surrounding_points[0]+surrounding_points[1])/2; - Point<3> N = surrounding_points[0]-surrounding_points[1]; - N = N/sqrt(N.square()); - average_normal = average_normal-(average_normal*N)*N; - average_normal = average_normal/average_normal.norm(); + Point<3> T = surrounding_points[0]-surrounding_points[1]; + T /= T.norm(); + average_normal = average_normal-(average_normal*T)*T; + average_normal /= average_normal.norm(); break; } case 8: @@ -194,10 +189,10 @@ namespace OpenCASCADE average_normal = (n1+n2+n3+n4)/4.0; - Assert(average_normal.norm() > 1e-4, + Assert(average_normal.norm() > tolerance, ExcMessage("Failed to refine cell: the average of the surface normals at the surrounding edge turns out to be a null vector, making the projection direction undetermined.")); - average_normal = average_normal/average_normal.norm(); + average_normal /= average_normal.norm(); break; } default: diff --git a/source/opencascade/utilities.cc b/source/opencascade/utilities.cc index c44b63ade4..51eb8d7ab6 100644 --- a/source/opencascade/utilities.cc +++ b/source/opencascade/utilities.cc @@ -62,13 +62,11 @@ DEAL_II_NAMESPACE_OPEN namespace OpenCASCADE { - void count_elements(const TopoDS_Shape &shape, - unsigned int &n_faces, - unsigned int &n_edges, - unsigned int &n_vertices) + std_cxx11::tuple + count_elements(const TopoDS_Shape &shape) { TopExp_Explorer exp; - n_faces=0, n_edges=0, n_vertices=0; + unsigned int n_faces=0, n_edges=0, n_vertices=0; for (exp.Init(shape, TopAbs_FACE); exp.More(); exp.Next(), ++n_faces) {} @@ -78,6 +76,7 @@ namespace OpenCASCADE for (exp.Init(shape, TopAbs_VERTEX); exp.More(); exp.Next(), ++n_vertices) {} + return std_cxx11::tuple(n_faces, n_edges, n_vertices); } void extract_geometrical_shapes(const TopoDS_Shape &shape, @@ -347,7 +346,6 @@ namespace OpenCASCADE double minDistance = 1e7; double distance; - int lowest_dist_int = 0; Point<3> result; for (int i=0; i closest_point(const TopoDS_Shape in_shape, - const Point<3> origin, - TopoDS_Shape &out_shape, - double &u, - double &v, - const double tolerance) + std_cxx11::tuple, TopoDS_Shape, double, double> + project_point_and_pull_back(const TopoDS_Shape &in_shape, + const Point<3> &origin, + const double tolerance) { - TopExp_Explorer exp; gp_Pnt Pproj = point(origin); @@ -412,8 +405,10 @@ namespace OpenCASCADE unsigned int counter = 0; unsigned int face_counter = 0; - u=0; - v=0; + + TopoDS_Shape out_shape; + double u=0; + double v=0; for (exp.Init(in_shape, TopAbs_FACE); exp.More(); exp.Next()) { @@ -473,53 +468,89 @@ namespace OpenCASCADE } Assert(counter > 0, ExcMessage("Could not find projection points.")); - return point(Pproj); + return std_cxx11::tuple, TopoDS_Shape, double, double> + (point(Pproj),out_shape, u, v); } - Point<3> closest_point_and_differential_forms(const TopoDS_Shape in_shape, - const Point<3> origin, - Point<3> &surface_normal, - double &mean_curvature, - const double tolerance) - + Point<3> closest_point(const TopoDS_Shape &in_shape, + const Point<3> &origin, + const double tolerance) { + std_cxx11::tuple, TopoDS_Shape, double, double> + ref = project_point_and_pull_back(in_shape, origin, tolerance); + return std_cxx11::get<0>(ref); + } - TopoDS_Shape out_shape; - double u, v; + std_cxx11::tuple, Point<3>, double> + closest_point_and_differential_forms(const TopoDS_Shape &in_shape, + const Point<3> &origin, + const double tolerance) + + { + std_cxx11::tuple, TopoDS_Shape, double, double> + shape_and_params = project_point_and_pull_back(in_shape, + origin, + tolerance); - Point<3> result = closest_point(in_shape, - origin, - out_shape, - u, - v, - tolerance); + TopoDS_Shape &out_shape = std_cxx11::get<1>(shape_and_params); + double &u = std_cxx11::get<2>(shape_and_params); + double &v = std_cxx11::get<3>(shape_and_params); // just a check here: the number of faces in out_shape must be 1, otherwise // something is wrong - unsigned int n_faces, n_edges, n_vertices; - count_elements(out_shape, - n_faces, - n_edges, - n_vertices); + std_cxx11::tuple numbers = + count_elements(out_shape); - Assert(n_faces > 0, ExcMessage("Could not find normal: the shape containing the closest point has 0 faces.")); - Assert(n_faces < 2, ExcMessage("Could not find normal: the shape containing the closest point has more than 1 face.")); + Assert(std_cxx11::get<0>(numbers) > 0, + ExcMessage("Could not find normal: the shape containing the closest point has 0 faces.")); + Assert(std_cxx11::get<0>(numbers) < 2, + ExcMessage("Could not find normal: the shape containing the closest point has more than 1 face.")); TopExp_Explorer exp; - exp.Init(in_shape, TopAbs_FACE); + exp.Init(out_shape, TopAbs_FACE); TopoDS_Face face = TopoDS::Face(exp.Current()); + return push_forward_and_differential_forms(face, u, v, tolerance); + } + Point<3> push_forward(const TopoDS_Shape &in_shape, + const double u, + const double v) + { + switch (in_shape.ShapeType()) + { + case TopAbs_FACE: + { + BRepAdaptor_Surface surf(TopoDS::Face(in_shape)); + return point(surf.Value(u,v)); + } + case TopAbs_EDGE: + { + BRepAdaptor_Curve curve(TopoDS::Edge(in_shape)); + return point(curve.Value(u)); + } + default: + Assert(false, ExcUnsupportedShape()); + } + return Point<3>(); + } + + std_cxx11::tuple, Point<3>, double > + push_forward_and_differential_forms(const TopoDS_Face &face, + const double u, + const double v, + const double tolerance) + { Handle(Geom_Surface) SurfToProj = BRep_Tool::Surface(face); - GeomLProp_SLProps props(SurfToProj, u, v, 1, tolerance); + GeomLProp_SLProps props(SurfToProj, u, v, 1, 1e-7); + gp_Pnt Value = props.Value(); + Assert(props.IsNormalDefined(), ExcMessage("Normal is not well defined!")); gp_Dir Normal = props.Normal(); + Assert(props.IsCurvatureDefined(), ExcMessage("Curvature is not well defined!")); Standard_Real Mean_Curvature = props.MeanCurvature(); - - surface_normal = Point<3>(Normal.X(),Normal.Y(),Normal.Z()); - mean_curvature = double(Mean_Curvature); - - return result; + Point<3> normal = Point<3>(Normal.X(),Normal.Y(),Normal.Z()); + return std_cxx11::tuple, Point<3>, double>(point(Value), normal, Mean_Curvature); } diff --git a/tests/opencascade/closest_point_to_shape.cc b/tests/opencascade/closest_point_to_shape.cc index c648b19aef..f816294478 100644 --- a/tests/opencascade/closest_point_to_shape.cc +++ b/tests/opencascade/closest_point_to_shape.cc @@ -70,7 +70,13 @@ int main () TopoDS_Shape sh; for(unsigned int i=0; i pp = closest_point(edge, points[i], sh, u, v); + std_cxx11::tuple, TopoDS_Shape, double, double> ref = + project_point_and_pull_back(edge, points[i]); + + Point<3> pp = std_cxx11::get<0>(ref); + sh = std_cxx11::get<1>(ref); + u = std_cxx11::get<2>(ref); + v = std_cxx11::get<3>(ref); deallog << "Origin: " << points[i] << ", on unit circle: " << pp diff --git a/tests/opencascade/create_tria_01.cc b/tests/opencascade/create_tria_01.cc index 226f116c46..907c270f71 100644 --- a/tests/opencascade/create_tria_01.cc +++ b/tests/opencascade/create_tria_01.cc @@ -9,7 +9,7 @@ // //----------------------------------------------------------- -// Read the first face of goteborg.iges, attach it to a projector, +// Read the file side.iges, attach it to a projector, // create a single-cell Triangulation, and refine it with the new // projector. @@ -44,7 +44,7 @@ int main () { std::ofstream logfile("output"); - TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/goteborg.iges", 1); + TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/side.iges"); std::vector faces; std::vector edges; std::vector vertices; diff --git a/tests/opencascade/create_tria_01.output b/tests/opencascade/create_tria_01.output index 89325f344a..7b880ba992 100644 --- a/tests/opencascade/create_tria_01.output +++ b/tests/opencascade/create_tria_01.output @@ -1,30 +1,30 @@ $NOD 25 -1 -1986.99 -2.3276e-17 -149.998 -2 -2637.58 3.55271e-15 -249.603 -3 -2008.61 314.696 428.208 -4 -3059.55 1.42109e-14 501.418 -5 -2304.65 -7.10543e-15 -245.601 -6 -2000.53 167.884 134.23 -7 -2725.34 0.0425119 204.053 -8 -2545.92 193.951 440.032 -9 -2404.02 65.5321 139.195 -10 -2142.3 -5.17421e-15 -216.101 -11 -2469.32 0 -267.915 -12 -1995.92 96.6019 -14.6159 -13 -2004.03 238.906 282.434 -14 -2632.21 0.000934116 -15.8842 -15 -2877.56 -5.67115e-09 370.719 -16 -2279.15 262.151 429.296 -17 -2808.9 111.45 459.573 -18 -2354.15 31.1791 -52.9914 -19 -2472.24 120.934 295.122 -20 -2202.2 116.44 136.819 -21 -2565.7 37.2635 170.327 -22 -2173.99 60.762 -34.0318 -23 -2511.39 14.632 -39.6776 -24 -2239.11 183.341 286.741 -25 -2682.97 67.745 321.647 +1 0 0 0.001 +2 -2.11667e-14 0.001 0.001 +3 0 0 0 +4 -2.11667e-14 0.001 0 +5 -0.000234467 0.000444022 0.001 +6 3.40745e-16 -4.38101e-16 0.0005 +7 -2.11537e-14 0.001 0.0005 +8 -0.000234467 0.000444022 0 +9 -0.000234467 0.000444022 0.0005 +10 -0.000139999 0.00020943 0.001 +11 -0.00021601 0.000764021 0.001 +12 5.11117e-16 -6.57151e-16 0.00075 +13 5.11117e-16 -6.57151e-16 0.00025 +14 -2.11472e-14 0.001 0.00075 +15 -2.11472e-14 0.001 0.00025 +16 -0.000139999 0.00020943 0 +17 -0.00021601 0.000764021 0 +18 -0.000234467 0.000444022 0.00075 +19 -0.000234467 0.000444022 0.00025 +20 -0.000139999 0.00020943 0.0005 +21 -0.00021601 0.000764021 0.0005 +22 -0.000139999 0.00020943 0.00075 +23 -0.00021601 0.000764021 0.00075 +24 -0.000139999 0.00020943 0.00025 +25 -0.00021601 0.000764021 0.00025 $ENDNOD $ELM 16 diff --git a/tests/opencascade/iges_describe.cc b/tests/opencascade/iges_describe.cc index 3a4633c450..f2f181d878 100644 --- a/tests/opencascade/iges_describe.cc +++ b/tests/opencascade/iges_describe.cc @@ -36,11 +36,15 @@ int main () extract_geometrical_shapes(sh, faces, edges, vertices); - unsigned int nf=0, ne=0, nv=0; - count_elements(sh, nf, ne, nv); - deallog << "Shape contains " << nf << " faces, " - << ne << " edges, and " - << nv << " vertices." << std::endl; + std_cxx11::tuple + n = count_elements(sh); + unsigned int nf=std_cxx11::get<0>(n); + unsigned int ne=std_cxx11::get<1>(n); + unsigned int nv=std_cxx11::get<2>(n); + + deallog << "Shape contains " << std_cxx11::get<0>(n) << " faces, " + << std_cxx11::get<1>(n) << " edges, and " + << std_cxx11::get<2>(n) << " vertices." << std::endl; if(nf != faces.size()) deallog << "Error!" << std::endl; diff --git a/tests/opencascade/normal_projection_01.cc b/tests/opencascade/normal_projection_01.cc index 635a1439e2..bdc5e73e04 100644 --- a/tests/opencascade/normal_projection_01.cc +++ b/tests/opencascade/normal_projection_01.cc @@ -44,7 +44,7 @@ int main () std::ofstream logfile("output"); gp_Pnt center(.5,.5,.5); - Standard_Real radius(Point<3>().distance(Pnt(center))); + Standard_Real radius(Point<3>().distance(point(center))); TopoDS_Face face = BRepPrimAPI_MakeSphere(center, radius); diff --git a/tests/opencascade/plane_intersection_01.cc b/tests/opencascade/plane_intersection_01.cc index e215376ba9..3aa5210477 100644 --- a/tests/opencascade/plane_intersection_01.cc +++ b/tests/opencascade/plane_intersection_01.cc @@ -49,7 +49,7 @@ int main() // Create a sphere gp_Pnt center(.5,.5,.5); - Standard_Real radius(Point<3>().distance(Pnt(center))); + Standard_Real radius(Point<3>().distance(point(center))); TopoDS_Face face = BRepPrimAPI_MakeSphere(center, radius);