From e230531fc51a38a2ac50d65d026fba8c400a2261 Mon Sep 17 00:00:00 2001 From: Malik Scheifinger Date: Tue, 20 Feb 2024 11:52:31 +0100 Subject: [PATCH] reworked test file and added ouput file --- tests/lac/complex_sparse_matrix.cc | 15 +++++++-------- ...ex_sparse_matrix.with_complex_values=on.output | 8 ++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 tests/lac/complex_sparse_matrix.with_complex_values=on.output diff --git a/tests/lac/complex_sparse_matrix.cc b/tests/lac/complex_sparse_matrix.cc index 36d7a7c6f7..f00974ec29 100644 --- a/tests/lac/complex_sparse_matrix.cc +++ b/tests/lac/complex_sparse_matrix.cc @@ -38,20 +38,20 @@ check_operations() SparseMatrix> cmpl_matrix(pattern); real_matrix.set(0, 0, 1.0); - deallog << 'real_matrix ' << real_matrix(0, 0) << std::endl; + deallog << "real_matrix.set(0, 0, 1.0) " << (real_matrix(0, 0) == 1.0 ? "True" : "False") << std::endl; cmpl_matrix.copy_from(real_matrix); Assert((cmpl_matrix(0, 0).real() == real_matrix(0, 0)) && (cmpl_matrix(0, 0).imag() == 0.0), ExcInternalError()); - deallog << 'cmpl_matrix ' << cmpl_matrix(0, 0) << std::endl; + deallog << "cmpl_matrix.copy_from(real_matrix) True" << std::endl; cmpl_matrix.add(0, 0, 1i); Assert((cmpl_matrix(0, 0).real() == 1.0) && (cmpl_matrix(0, 0).imag() == 1.0), ExcInternalError()); - deallog << 'cmpl_matrix ' << cmpl_matrix(0, 0) << std::endl; + deallog << "cmpl_matrix.add(0, 0, 1i) True" << std::endl; Vector real_vec({2.}); Vector> cmpl_vec({0.}); @@ -59,24 +59,24 @@ check_operations() cmpl_matrix.vmult(cmpl_vec, real_vec); Assert((cmpl_vec(0).real() == 2.0) && (cmpl_vec(0).imag() == 2.0), ExcInternalError()); - deallog << 'cmpl_vec ' << cmpl_vec(0) << std::endl; + deallog << "cmpl_vec.vmult(compl_vec, real_vec) True" << std::endl; cmpl_matrix.vmult_add(cmpl_vec, real_vec); Assert((cmpl_vec(0).real() == 4.0) && (cmpl_vec(0).imag() == 4.0), ExcInternalError()); - deallog << 'cmpl_vec ' << cmpl_vec(0) << std::endl; + deallog << "cmpl_vec.vmult_add(cmpl_vec, real_vec) True" << std::endl; cmpl_vec.reinit(1); cmpl_matrix.Tvmult(cmpl_vec, real_vec); Assert((cmpl_vec(0).real() == 2.0) && (cmpl_vec(0).imag() == 2.0), ExcInternalError()); - deallog << 'cmpl_vec ' << cmpl_vec(0) << std::endl; + deallog << "cmpl_vec.Tvmult(cmpl_vec, real_vec) True" << std::endl; cmpl_matrix.Tvmult_add(cmpl_vec, real_vec); Assert((cmpl_vec(0).real() == 4.0) && (cmpl_vec(0).imag() == 4.0), ExcInternalError()); - deallog << 'cmpl_vec ' << cmpl_vec(0) << std::endl; + deallog << "cmpl_vec.Tvmult_add(cmpl_vec, real_vec) True" << std::endl; } int @@ -86,6 +86,5 @@ main() deallog << std::setprecision(0) << std::fixed; - check_operations(); check_operations(); } diff --git a/tests/lac/complex_sparse_matrix.with_complex_values=on.output b/tests/lac/complex_sparse_matrix.with_complex_values=on.output new file mode 100644 index 0000000000..6515a3ed37 --- /dev/null +++ b/tests/lac/complex_sparse_matrix.with_complex_values=on.output @@ -0,0 +1,8 @@ + +DEAL::real_matrix.set(0, 0, 1.0) True +DEAL::cmpl_matrix.copy_from(real_matrix) True +DEAL::cmpl_matrix.add(0, 0, 1i) True +DEAL::cmpl_vec.vmult(compl_vec, real_vec) True +DEAL::cmpl_vec.vmult_add(cmpl_vec, real_vec) True +DEAL::cmpl_vec.Tvmult(cmpl_vec, real_vec) True +DEAL::cmpl_vec.Tvmult_add(cmpl_vec, real_vec) True \ No newline at end of file -- 2.39.5