]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix more tests
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Jul 2023 21:24:21 +0000 (17:24 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Jul 2023 21:24:37 +0000 (17:24 -0400)
tests/dofs/dof_tools_05.cc
tests/dofs/dof_tools_20.cc
tests/fe/component_mask_12.cc
tests/fe/component_mask_14.cc
tests/numerics/point_value_history_02.cc
tests/numerics/point_value_history_03.cc

index 3c65f295eb9a387bed4cb83959dcdfb4d3959872..da38e6da6eeeb7fe5505083c4863bd94600fe740 100644 (file)
@@ -27,8 +27,8 @@ template <int dim>
 void
 check_this(const DoFHandler<dim> &dof_handler)
 {
-  std::vector<bool> 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<dim> &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);
index d2d9bc79335212b767f9a674a116cf51aa1346a4..d596fae1066c1483ec67b63ae67c2aa69d5406fb 100644 (file)
@@ -27,7 +27,7 @@ template <int dim>
 void
 check_this(const DoFHandler<dim> &dof_handler)
 {
-  std::vector<bool> component_select(dof_handler.get_fe().n_components(), true);
+  ComponentMask     component_select(dof_handler.get_fe().n_components(), true);
   std::vector<bool> boundary_dofs(dof_handler.n_dofs());
 
   // first with all components
@@ -41,7 +41,7 @@ check_this(const DoFHandler<dim> &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,
index a68baf12b70b59fc36827d762c6181df618caba8..3ed60d9682033e1b938705c48a742f0c63ab0931 100644 (file)
@@ -45,9 +45,9 @@ test()
   for (unsigned int int_mask = 0; int_mask < (1U << fe.n_components());
        ++int_mask)
     {
-      std::vector<bool> 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) ==
index 23b13c997c54ebdaa5a49d5d216797c6b8d0f837..f054c8203383831a969a8254a8f437d5714904e6 100644 (file)
@@ -42,9 +42,9 @@ test()
   for (unsigned int int_mask = 0; int_mask < (1U << fe.n_components());
        ++int_mask)
     {
-      std::vector<bool> 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
index 2c70abb28e9714c173c9d4f5e84ec375b1521a68..8d3095b49b643da93aa22efd95f5f335ba892e77 100644 (file)
@@ -285,17 +285,17 @@ TestPointValueHistory<dim>::run()
     node_monitor.add_component_names("Solution", solution_names);
     node_monitor.add_field_name(
       "Post Processed Vector"); // not sensitive to spaces
-    std::vector<bool> 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<bool>(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<bool>(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<bool>(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<std::string> indep_names;
index f6f70c06c144212628159cf07540bcd02e0349c6..69283f11de1473bfafd5790137e2a3a1fa53cc49 100644 (file)
@@ -248,13 +248,13 @@ TestPointValueHistory<dim>::run()
     node_monitor.add_field_name(
       "Post Processed Vector"); // not sensitive to spaces
     node_monitor.add_field_name("Pressure", 1);
-    std::vector<bool> component_mask(1, true);
+    ComponentMask component_mask(1, true);
     node_monitor.add_field_name("Req_sol", component_mask);
-    component_mask    = std::vector<bool>(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<bool>(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<std::string> indep_names;
     indep_names.push_back("Input");

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.