//----------------------------------------------------------------------
// test the umfpack sparse direct solver on a mass matrix
+// test of the transpose as well
#include "../tests.h"
#include <iostream>
template <int dim>
-void test ()
+void test (bool transpose = false)
{
deallog << dim << 'd' << std::endl;
for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
solution(j) = j+j*(i+1)*(i+1);
- B.vmult (b, solution);
+ if (transpose)
+ B.Tvmult (b, solution);
+ else
+ B.vmult (b, solution);
+
x = b;
- SparseDirectUMFPACK().solve (B, x);
+ SparseDirectUMFPACK().solve (B, x, transpose);
x -= solution;
deallog << "relative norm distance = "
test<1> ();
test<2> ();
test<3> ();
+
+ test<1> (/*transpose =*/ true);
+ test<2> (/*transpose =*/ true);
+ test<3> (/*transpose =*/ true);
}
DEAL::absolute norms = 0 140414.
DEAL::relative norm distance = 0
DEAL::absolute norms = 0 280828.
+DEAL::1d
+DEAL::Number of dofs = 193
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 3084.00
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 7709.99
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 15420.0
+DEAL::2d
+DEAL::Number of dofs = 1889
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 94764.3
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 236911.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 473822.
+DEAL::3d
+DEAL::Number of dofs = 1333
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 56165.6
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 140414.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 280828.
template <int dim>
-void test ()
+void test (bool transpose = false)
{
deallog << dim << 'd' << std::endl;
for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
solution(j) = j+j*(i+1)*(i+1);
- B.vmult (b, solution);
+ if (transpose)
+ B.Tvmult (b, solution);
+ else
+ B.vmult (b, solution);
+
x = b;
- Binv.solve (x);
+ Binv.solve (x, transpose);
x -= solution;
deallog << "relative norm distance = "
test<1> ();
test<2> ();
test<3> ();
+
+ test<1> (/*transpose =*/ true);
+ test<2> (/*transpose =*/ true);
+ test<3> (/*transpose =*/ true);
}
DEAL::absolute norms = 0 140414.
DEAL::relative norm distance = 0
DEAL::absolute norms = 0 280828.
+DEAL::1d
+DEAL::Number of dofs = 193
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 3084.00
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 7709.99
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 15420.0
+DEAL::2d
+DEAL::Number of dofs = 1889
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 94764.3
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 236911.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 473822.
+DEAL::3d
+DEAL::Number of dofs = 1333
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 56165.6
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 140414.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 280828.
//----------------------------------------------------------------------
// test the umfpack sparse direct solver on a mass matrix that is slightly modified to make it nonsymmetric
+// test for the transpose as well
#include "../tests.h"
#include <iostream>
template <int dim>
-void test ()
+void test (bool transpose = false)
{
deallog << dim << 'd' << std::endl;
for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
solution(j) = j+j*(i+1)*(i+1);
- B.vmult (b, solution);
+ if (transpose)
+ B.Tvmult (b, solution);
+ else
+ B.vmult (b, solution);
+
x = b;
- SparseDirectUMFPACK().solve (B, x);
+ SparseDirectUMFPACK().solve (B, x, transpose);
x -= solution;
deallog << "relative norm distance = "
test<1> ();
test<2> ();
test<3> ();
+
+ test<1> (/*transpose =*/ true);
+ test<2> (/*transpose =*/ true);
+ test<3> (/*transpose =*/ true);
}
DEAL::absolute norms = 0 140414.
DEAL::relative norm distance = 0
DEAL::absolute norms = 0 280828.
+DEAL::1d
+DEAL::Number of dofs = 193
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 3084.00
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 7709.99
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 15420.0
+DEAL::2d
+DEAL::Number of dofs = 1889
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 94764.3
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 236911.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 473822.
+DEAL::3d
+DEAL::Number of dofs = 1333
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 56165.6
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 140414.
+DEAL::relative norm distance = 0
+DEAL::absolute norms = 0 280828.