From: Daniel Arndt Date: Mon, 3 Jul 2023 21:24:21 +0000 (-0400) Subject: Fix more tests X-Git-Tag: relicensing~757^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed43e4e66c813dd886616d7ec9db7ecaf40e7101;p=dealii.git Fix more tests --- diff --git a/tests/dofs/dof_tools_05.cc b/tests/dofs/dof_tools_05.cc index 3c65f295eb..da38e6da6e 100644 --- a/tests/dofs/dof_tools_05.cc +++ b/tests/dofs/dof_tools_05.cc @@ -27,8 +27,8 @@ template void check_this(const DoFHandler &dof_handler) { - std::vector component_select(dof_handler.get_fe().n_components(), true); - IndexSet boundary_dofs(dof_handler.n_dofs()); + ComponentMask component_select(dof_handler.get_fe().n_components(), true); + IndexSet boundary_dofs(dof_handler.n_dofs()); // first with all components { @@ -40,7 +40,7 @@ check_this(const DoFHandler &dof_handler) // next with only every second // component for (unsigned int i = 1; i < component_select.size(); i += 2) - component_select[i] = false; + component_select.set(i, false); { boundary_dofs = DoFTools::extract_boundary_dofs(dof_handler, component_select); diff --git a/tests/dofs/dof_tools_20.cc b/tests/dofs/dof_tools_20.cc index d2d9bc7933..d596fae106 100644 --- a/tests/dofs/dof_tools_20.cc +++ b/tests/dofs/dof_tools_20.cc @@ -27,7 +27,7 @@ template void check_this(const DoFHandler &dof_handler) { - std::vector component_select(dof_handler.get_fe().n_components(), true); + ComponentMask component_select(dof_handler.get_fe().n_components(), true); std::vector boundary_dofs(dof_handler.n_dofs()); // first with all components @@ -41,7 +41,7 @@ check_this(const DoFHandler &dof_handler) // next with only every second // component for (unsigned int i = 1; i < component_select.size(); i += 2) - component_select[i] = false; + component_select.set(i, false); { DoFTools::extract_dofs_with_support_on_boundary(dof_handler, component_select, diff --git a/tests/fe/component_mask_12.cc b/tests/fe/component_mask_12.cc index a68baf12b7..3ed60d9682 100644 --- a/tests/fe/component_mask_12.cc +++ b/tests/fe/component_mask_12.cc @@ -45,9 +45,9 @@ test() for (unsigned int int_mask = 0; int_mask < (1U << fe.n_components()); ++int_mask) { - std::vector component_mask(fe.n_components()); + ComponentMask component_mask(fe.n_components(), false); for (unsigned int c = 0; c < fe.n_components(); ++c) - component_mask[c] = (int_mask & (1 << c)); + component_mask.set(c, (int_mask & (1 << c))); // make sure that the round-trip works Assert(ComponentMask(component_mask) == diff --git a/tests/fe/component_mask_14.cc b/tests/fe/component_mask_14.cc index 23b13c997c..f054c82033 100644 --- a/tests/fe/component_mask_14.cc +++ b/tests/fe/component_mask_14.cc @@ -42,9 +42,9 @@ test() for (unsigned int int_mask = 0; int_mask < (1U << fe.n_components()); ++int_mask) { - std::vector component_mask(fe.n_components()); + ComponentMask component_mask(fe.n_components(), false); for (unsigned int c = 0; c < fe.n_components(); ++c) - component_mask[c] = (int_mask & (1 << c)); + component_mask.set(c, (int_mask & (1 << c))); // now try to convert to a block // mask. this should not always diff --git a/tests/numerics/point_value_history_02.cc b/tests/numerics/point_value_history_02.cc index 2c70abb28e..8d3095b49b 100644 --- a/tests/numerics/point_value_history_02.cc +++ b/tests/numerics/point_value_history_02.cc @@ -285,17 +285,17 @@ TestPointValueHistory::run() node_monitor.add_component_names("Solution", solution_names); node_monitor.add_field_name( "Post Processed Vector"); // not sensitive to spaces - std::vector component_mask(3, false); - component_mask[2] = true; + ComponentMask component_mask(3, false); + component_mask.set(2, true); node_monitor.add_field_name("Pressure", component_mask); - component_mask = std::vector(3, false); - component_mask[1] = true; + component_mask = ComponentMask(3, false); + component_mask.set(1, true); node_monitor.add_field_name("Req_sol", component_mask); - component_mask = std::vector(4, true); - component_mask[3] = false; + component_mask = ComponentMask(4, true); + component_mask.set(3, false); node_monitor.add_field_name("Vector_out", component_mask); - component_mask = std::vector(4, false); - component_mask[3] = true; + component_mask = ComponentMask(4, false); + component_mask.set(3, true); node_monitor.add_field_name("Scalar_out", component_mask); std::vector indep_names; diff --git a/tests/numerics/point_value_history_03.cc b/tests/numerics/point_value_history_03.cc index f6f70c06c1..69283f11de 100644 --- a/tests/numerics/point_value_history_03.cc +++ b/tests/numerics/point_value_history_03.cc @@ -248,13 +248,13 @@ TestPointValueHistory::run() node_monitor.add_field_name( "Post Processed Vector"); // not sensitive to spaces node_monitor.add_field_name("Pressure", 1); - std::vector component_mask(1, true); + ComponentMask component_mask(1, true); node_monitor.add_field_name("Req_sol", component_mask); - component_mask = std::vector(2, false); - component_mask[0] = true; + component_mask = ComponentMask(2, false); + component_mask.set(0, true); node_monitor.add_field_name("X_gradient", component_mask); - component_mask = std::vector(2, false); - component_mask[1] = true; + component_mask = ComponentMask(2, false); + component_mask.set(1, true); node_monitor.add_field_name("X_hessian", component_mask); std::vector indep_names; indep_names.push_back("Input");