From dfd9f171e6a8f2591e7530232272e262355ac627 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 7 Apr 2023 14:32:37 -0600 Subject: [PATCH] Avoid call to a deprecated function. --- examples/step-2/step-2.cc | 9 +++------ examples/step-60/step-60.cc | 2 +- source/particles/generators.cc | 9 +++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/examples/step-2/step-2.cc b/examples/step-2/step-2.cc index cba004b43e..1426ae98db 100644 --- a/examples/step-2/step-2.cc +++ b/examples/step-2/step-2.cc @@ -120,8 +120,7 @@ void make_grid(Triangulation<2> &triangulation) // understand exactly what this function does, and you can skip over // it. But if you would like to know anyway: We want to call the // function DoFTools::map_dofs_to_support_points() that returns a list -// of locations (in the form of Point objects that store -// coordinates). It does so in the form of a map through which we can +// of locations. It does so in the form of a map through which we can // query (in a statement such as `dof_location_map[42]`) where the DoF // is located (in the example, where the 42nd DoF is). It puts this // information into the `dof_location_map` object. @@ -134,10 +133,8 @@ void make_grid(Triangulation<2> &triangulation) void write_dof_locations(const DoFHandler<2> &dof_handler, const std::string & filename) { - std::map> dof_location_map; - DoFTools::map_dofs_to_support_points(MappingQ1<2>(), - dof_handler, - dof_location_map); + std::map> dof_location_map = + DoFTools::map_dofs_to_support_points(MappingQ1<2>(), dof_handler); std::ofstream dof_location_file(filename); DoFTools::write_gnuplot_dof_support_point_info(dof_location_file, diff --git a/examples/step-60/step-60.cc b/examples/step-60/step-60.cc index d3ace151d1..b9d9d16d93 100644 --- a/examples/step-60/step-60.cc +++ b/examples/step-60/step-60.cc @@ -709,7 +709,7 @@ namespace Step60 // // With the mapping in place, it is now possible to query what is the // location of all support points associated with the `embedded_dh`, by - // calling the method DoFTools::map_dofs_to_support_points. + // calling the method DoFTools::map_dofs_to_support_points(). // // This method has two variants. One that does *not* take a Mapping, and // one that takes a Mapping. If you use the second type, like we are doing diff --git a/source/particles/generators.cc b/source/particles/generators.cc index fdebe39ee7..acd3caf205 100644 --- a/source/particles/generators.cc +++ b/source/particles/generators.cc @@ -468,12 +468,9 @@ namespace Particles (components.size() == 0 ? ComponentMask(fe.n_components(), true) : components); - std::map> support_points_map; - - DoFTools::map_dofs_to_support_points(mapping, - dof_handler, - support_points_map, - mask); + const std::map> + support_points_map = + DoFTools::map_dofs_to_support_points(mapping, dof_handler, mask); // Generate the vector of points from the map // Memory is reserved for efficiency reasons -- 2.39.5