]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Modify a test to check the diagonal values (not lumped).
authorDavid Wells <drwells@email.unc.edu>
Sat, 31 Jul 2021 14:31:56 +0000 (10:31 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 16 Aug 2021 20:02:10 +0000 (16:02 -0400)
tests/matrix_free/mass_operator_02.cc
tests/matrix_free/mass_operator_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=1.output
tests/matrix_free/mass_operator_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=4.output
tests/matrix_free/mass_operator_03.cc
tests/matrix_free/mass_operator_03.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=1.output
tests/matrix_free/mass_operator_03.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=4.output

index 7492f8fee6f336b1663e5ae0ef9de17dbfb77206..80e2c920388aae4baad4495dbb1aec415ca6a400 100644 (file)
@@ -96,7 +96,7 @@ test()
     mf;
   mf.initialize(mf_data);
   mf.compute_diagonal();
-  const LinearAlgebra::distributed::Vector<double> &diagonal =
+  const LinearAlgebra::distributed::Vector<double> &inverse_diagonal =
     mf.get_matrix_diagonal_inverse()->get_vector();
 
   LinearAlgebra::distributed::Vector<number> in, out, ref;
@@ -113,7 +113,7 @@ test()
     }
 
   in.update_ghost_values();
-  out = diagonal;
+  out = inverse_diagonal;
 
   // assemble trilinos sparse matrix with
   // (v, u) for reference
@@ -168,15 +168,13 @@ test()
   }
   sparse_matrix.compress(VectorOperation::add);
 
-  sparse_matrix.vmult(ref, in);
-
   for (unsigned int i = 0; i < ref.local_size(); ++i)
     {
-      const unsigned int glob_index = owned_set.nth_index_in_set(i);
+      const auto glob_index = owned_set.nth_index_in_set(i);
       if (constraints.is_constrained(glob_index))
         ref.local_element(i) = 1.;
       else
-        ref.local_element(i) = 1. / ref.local_element(i);
+        ref.local_element(i) = 1. / sparse_matrix(glob_index, glob_index);
     }
   ref.compress(VectorOperation::insert);
 
@@ -184,9 +182,9 @@ test()
   const double diff_norm = out.linfty_norm();
 
   deallog << "Norm of difference: " << diff_norm << std::endl;
-  deallog << "l2_norm: " << diagonal.l2_norm() << std::endl;
-  deallog << "l1_norm: " << diagonal.l1_norm() << std::endl;
-  deallog << "linfty_norm: " << diagonal.linfty_norm() << std::endl
+  deallog << "l2_norm: " << inverse_diagonal.l2_norm() << std::endl;
+  deallog << "l1_norm: " << inverse_diagonal.l1_norm() << std::endl;
+  deallog << "linfty_norm: " << inverse_diagonal.linfty_norm() << std::endl
           << std::endl;
 }
 
index 0b7375c116219016a7bce7f87b16766c2d8f7202..3a595b1c9b95d050b6a0e997f7c9abd535a58202 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 4.26326e-14
-DEAL:2d::l2_norm: 504.352
-DEAL:2d::l1_norm: 3536.64
-DEAL:2d::linfty_norm: 92.1600
+DEAL:2d::Norm of difference: 0.00000
+DEAL:2d::l2_norm: 1008.02
+DEAL:2d::l1_norm: 7088.00
+DEAL:2d::linfty_norm: 144.000
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 4.54747e-13
-DEAL:2d::l2_norm: 5051.63
-DEAL:2d::l1_norm: 68866.9
-DEAL:2d::linfty_norm: 576.000
+DEAL:2d::Norm of difference: 3.41061e-13
+DEAL:2d::l2_norm: 8100.00
+DEAL:2d::l1_norm: 108964.
+DEAL:2d::linfty_norm: 900.000
 DEAL:2d::
 DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 5.68434e-13
-DEAL:3d::l2_norm: 11325.6
-DEAL:3d::l1_norm: 207861.
-DEAL:3d::linfty_norm: 884.736
+DEAL:3d::Norm of difference: 2.27374e-13
+DEAL:3d::l2_norm: 32003.0
+DEAL:3d::l1_norm: 593090.
+DEAL:3d::linfty_norm: 1728.00
 DEAL:3d::
 DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 2.18279e-11
-DEAL:3d::l2_norm: 359043.
-DEAL:3d::l1_norm: 1.80487e+07
-DEAL:3d::linfty_norm: 13824.0
+DEAL:3d::Norm of difference: 2.54659e-11
+DEAL:3d::l2_norm: 729000.
+DEAL:3d::l1_norm: 3.59385e+07
+DEAL:3d::linfty_norm: 27000.0
 DEAL:3d::
index 0b7375c116219016a7bce7f87b16766c2d8f7202..602077b3a4ab3c023d4b389cab6bac08e9e6d2b7 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL:2d::Testing FE_Q<2>(1)
-DEAL:2d::Norm of difference: 4.26326e-14
-DEAL:2d::l2_norm: 504.352
-DEAL:2d::l1_norm: 3536.64
-DEAL:2d::linfty_norm: 92.1600
+DEAL:2d::Norm of difference: 8.52651e-14
+DEAL:2d::l2_norm: 1008.02
+DEAL:2d::l1_norm: 7088.00
+DEAL:2d::linfty_norm: 144.000
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(2)
-DEAL:2d::Norm of difference: 4.54747e-13
-DEAL:2d::l2_norm: 5051.63
-DEAL:2d::l1_norm: 68866.9
-DEAL:2d::linfty_norm: 576.000
+DEAL:2d::Norm of difference: 7.95808e-13
+DEAL:2d::l2_norm: 8100.00
+DEAL:2d::l1_norm: 108964.
+DEAL:2d::linfty_norm: 900.000
 DEAL:2d::
 DEAL:3d::Testing FE_Q<3>(1)
-DEAL:3d::Norm of difference: 5.68434e-13
-DEAL:3d::l2_norm: 11325.6
-DEAL:3d::l1_norm: 207861.
-DEAL:3d::linfty_norm: 884.736
+DEAL:3d::Norm of difference: 6.82121e-13
+DEAL:3d::l2_norm: 32003.0
+DEAL:3d::l1_norm: 593090.
+DEAL:3d::linfty_norm: 1728.00
 DEAL:3d::
 DEAL:3d::Testing FE_Q<3>(2)
-DEAL:3d::Norm of difference: 2.18279e-11
-DEAL:3d::l2_norm: 359043.
-DEAL:3d::l1_norm: 1.80487e+07
-DEAL:3d::linfty_norm: 13824.0
+DEAL:3d::Norm of difference: 4.00178e-11
+DEAL:3d::l2_norm: 729000.
+DEAL:3d::l1_norm: 3.59385e+07
+DEAL:3d::linfty_norm: 27000.0
 DEAL:3d::
index 9da57939937417a9177e37d5a516525c1ffc43a3..da50f183fcb064281f43448f663f65ad585f2772 100644 (file)
@@ -165,15 +165,13 @@ test()
   }
   sparse_matrix.compress(VectorOperation::add);
 
-  sparse_matrix.vmult(ref, in);
-
   for (unsigned int i = 0; i < ref.local_size(); ++i)
     {
-      const unsigned int glob_index = owned_set.nth_index_in_set(i);
+      const auto glob_index = owned_set.nth_index_in_set(i);
       if (constraints.is_constrained(glob_index))
         ref.local_element(i) = 1.;
       else
-        ref.local_element(i) = 1. / ref.local_element(i);
+        ref.local_element(i) = 1. / sparse_matrix(glob_index, glob_index);
     }
   ref.compress(VectorOperation::insert);
 
index 647623790118f6e58505ac93652353f5e49ee06c..5e1cd4dedd1f98e1c38a95817e5e8a1e873bd5d1 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL:2d::Testing FE_Q_Hierarchical<2>(1)
 DEAL:2d::Norm of difference: 1.13687e-13
-DEAL:2d::l2_norm: 960.000
-DEAL:2d::l1_norm: 7744.00
-DEAL:2d::linfty_norm: 256.000
+DEAL:2d::l2_norm: 2160.00
+DEAL:2d::l1_norm: 17424.0
+DEAL:2d::linfty_norm: 576.000
 DEAL:2d::
 DEAL:2d::Testing FE_Q_Hierarchical<2>(2)
-DEAL:2d::Norm of difference: 3.22871e-11
-DEAL:2d::l2_norm: 37440.0
-DEAL:2d::l1_norm: 553536.
-DEAL:2d::linfty_norm: 3600.00
+DEAL:2d::Norm of difference: 2.27374e-13
+DEAL:2d::l2_norm: 3960.00
+DEAL:2d::l1_norm: 63504.0
+DEAL:2d::linfty_norm: 576.000
 DEAL:2d::
 DEAL:3d::Testing FE_Q_Hierarchical<3>(1)
-DEAL:3d::Norm of difference: 1.81899e-12
-DEAL:3d::l2_norm: 29744.5
-DEAL:3d::l1_norm: 681472.
-DEAL:3d::linfty_norm: 4096.00
+DEAL:3d::Norm of difference: 3.63798e-12
+DEAL:3d::l2_norm: 100388.
+DEAL:3d::l1_norm: 2.29997e+06
+DEAL:3d::linfty_norm: 13824.0
 DEAL:3d::
 DEAL:3d::Testing FE_Q_Hierarchical<3>(2)
-DEAL:3d::Norm of difference: 1.39116e-08
-DEAL:3d::l2_norm: 7.24442e+06
-DEAL:3d::l1_norm: 4.11831e+08
-DEAL:3d::linfty_norm: 216000.
+DEAL:3d::Norm of difference: 1.63709e-11
+DEAL:3d::l2_norm: 249197.
+DEAL:3d::l1_norm: 1.60030e+07
+DEAL:3d::linfty_norm: 13824.0
 DEAL:3d::
index 647623790118f6e58505ac93652353f5e49ee06c..c199e6b0c571cfa5de0fcf28facb232be2258d10 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL:2d::Testing FE_Q_Hierarchical<2>(1)
-DEAL:2d::Norm of difference: 1.13687e-13
-DEAL:2d::l2_norm: 960.000
-DEAL:2d::l1_norm: 7744.00
-DEAL:2d::linfty_norm: 256.000
+DEAL:2d::Norm of difference: 3.41061e-13
+DEAL:2d::l2_norm: 2160.00
+DEAL:2d::l1_norm: 17424.0
+DEAL:2d::linfty_norm: 576.000
 DEAL:2d::
 DEAL:2d::Testing FE_Q_Hierarchical<2>(2)
-DEAL:2d::Norm of difference: 3.22871e-11
-DEAL:2d::l2_norm: 37440.0
-DEAL:2d::l1_norm: 553536.
-DEAL:2d::linfty_norm: 3600.00
+DEAL:2d::Norm of difference: 5.68434e-13
+DEAL:2d::l2_norm: 3960.00
+DEAL:2d::l1_norm: 63504.0
+DEAL:2d::linfty_norm: 576.000
 DEAL:2d::
 DEAL:3d::Testing FE_Q_Hierarchical<3>(1)
-DEAL:3d::Norm of difference: 1.81899e-12
-DEAL:3d::l2_norm: 29744.5
-DEAL:3d::l1_norm: 681472.
-DEAL:3d::linfty_norm: 4096.00
+DEAL:3d::Norm of difference: 5.45697e-12
+DEAL:3d::l2_norm: 100388.
+DEAL:3d::l1_norm: 2.29997e+06
+DEAL:3d::linfty_norm: 13824.0
 DEAL:3d::
 DEAL:3d::Testing FE_Q_Hierarchical<3>(2)
-DEAL:3d::Norm of difference: 1.39116e-08
-DEAL:3d::l2_norm: 7.24442e+06
-DEAL:3d::l1_norm: 4.11831e+08
-DEAL:3d::linfty_norm: 216000.
+DEAL:3d::Norm of difference: 3.63798e-11
+DEAL:3d::l2_norm: 249197.
+DEAL:3d::l1_norm: 1.60030e+07
+DEAL:3d::linfty_norm: 13824.0
 DEAL:3d::

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.