+++ /dev/null
-//---------------------------- trilinos_full_matrix_01.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_01.cc ---------------------------
-
-
-// check setting elements in a petsc matrix using
-// TrilinosWrappers::FullMatrix::set()
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.set (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // then make sure we retrieve the same ones
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
- }
- else
- {
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_01/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_02.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_02.cc ---------------------------
-
-
-// check setting elements in a petsc matrix using
-// TrilinosWrappers::FullMatrix::add()
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.add (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // then make sure we retrieve the same ones
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
- }
- else
- {
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_02/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_03.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_03.cc ---------------------------
-
-
-// check setting elements in a petsc matrix using set() and add()
-// intermixed. this poses PETSc some problems, since one has to flush some
-// buffer in between these two types of operations
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- if (i*j % 2 == 0)
- m.set (i,j, i*j*.5+.5);
- else
- m.add (i,j, i*j*.5+.5);
- }
-
- m.compress ();
-
- // then make sure we retrieve the same ones
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
- Assert (m.el(i,j) == i*j*.5+.5, ExcInternalError());
- }
- else
- {
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_03/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_04.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_04.cc ---------------------------
-
-
-// check querying matrix sizes
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- Assert (m.m() == 5, ExcInternalError());
- Assert (m.n() == 5, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_04/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_05.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2007, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_05.cc ---------------------------
-
-
-// check querying the number of nonzero elements in
-// TrilinosWrappers::FullMatrix
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries. count how many
- // entries we have
- unsigned int counter = 0;
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- m.set (i,j, i*j*.5+.5);
- ++counter;
- }
-
- m.compress ();
-
- // prior to and including PETSc 2.3.0,
- // n_nonzero_elements returns the actual
- // number of nonzeros. after that, PETSc
- // returns the *total* number of entries of
- // this matrix. check both (in the case
- // post 2.3.0, output a dummy number
-#if (DEAL_II_PETSC_VERSION_MAJOR == 2) &&\
- ((DEAL_II_PETSC_VERSION_MINOR < 3) \
- ||\
- ((DEAL_II_PETSC_VERSION_MINOR == 3) &&\
- (DEAL_II_PETSC_VERSION_SUBMINOR == 0)))
- deallog << m.n_nonzero_elements() << std::endl;
- Assert (m.n_nonzero_elements() == counter,
- ExcInternalError());
-#else
- deallog << counter << std::endl;
- Assert (m.m() * m.m(), ExcInternalError());
-#endif
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_05/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::8
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_06.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_06.cc ---------------------------
-
-
-// check TrilinosWrappers::FullMatrix::l1_norm
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries. count how many
- // entries we have
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.set (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // compare against the exact value of the
- // l1-norm (max col-sum)
- deallog << m.l1_norm() << std::endl;
- Assert (m.l1_norm() == 7, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_06/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::7.00000
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_07.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_07.cc ---------------------------
-
-
-// check TrilinosWrappers::FullMatrix::linfty_norm
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries. count how many
- // entries we have
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.set (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // compare against the exact value of the
- // linfty-norm (max row-sum)
- deallog << m.linfty_norm() << std::endl;
- Assert (m.linfty_norm() == 8.5, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_07/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::8.50000
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_08.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_08.cc ---------------------------
-
-
-// check TrilinosWrappers::FullMatrix::frobenius_norm
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries. count how many
- // entries we have
- TrilinosScalar norm = 0;
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- m.set (i,j, i*j*.5+.5);
- norm += (i*j*.5+.5)*(i*j*.5+.5);
- }
- norm = std::sqrt(norm);
-
- m.compress ();
-
- // compare against the exact value of the
- // l2-norm (max row-sum)
- deallog << m.frobenius_norm() << std::endl;
- Assert (m.frobenius_norm() == norm, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_08/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::9.04157
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_09.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_09.cc ---------------------------
-
-
-// check TrilinosWrappers::FullMatrix::operator *=
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.set (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // then multiply everything by 1.25 and
- // make sure we retrieve the values we
- // expect
- m *= 1.25;
-
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
- }
- else
- {
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_09/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_10.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_10.cc ---------------------------
-
-
-// check TrilinosWrappers::FullMatrix::operator /=
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test (TrilinosWrappers::FullMatrix &m)
-{
- // first set a few entries
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- m.set (i,j, i*j*.5+.5);
-
- m.compress ();
-
- // then divide everything by 4/3 and
- // make sure we retrieve the values we
- // expect
- m /= 4./3.;
-
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- if ((i+2*j+1) % 3 == 0)
- {
- Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- Assert (m.el(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
- }
- else
- {
- Assert (m(i,j) == 0, ExcInternalError());
- Assert (m.el(i,j) == 0, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_10/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::FullMatrix m (5,5);
- test (m);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_iterator_01.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_iterator_01.cc ---------------------------
-
-
-// test TrilinosWrappers::MatrixBase::const_iterator
-
-#include "../tests.h"
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-
-
-void test ()
-{
- TrilinosWrappers::FullMatrix m(5,5);
- m.set (0,0,1);
- m.set (1,1,2);
- m.set (1,2,3);
- m.compress ();
- TrilinosWrappers::FullMatrix::const_iterator i = m.begin();
- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
- ++i;
- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
- i++;
- deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc,char **argv)
-{
- std::ofstream logfile("full_matrix_iterator_01/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- test ();
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::0 0 1.00000
-DEAL::0 1 0
-DEAL::0 2 0
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_01.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_01.cc ---------------------------
-
-
-// check FullMatrix::vmult
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- v(i) = i;
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // w:=Mv
- m.vmult (w,v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
-
- double result = 0;
- for (unsigned int j=0; j<m.m(); ++j)
- result += (i+2*j)*j;
- Assert (w(i) == result, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_01/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- test (v,w);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_02.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_02.cc ---------------------------
-
-
-// check FullMatrix::Tvmult
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- v(i) = i;
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // w:=Mv
- m.Tvmult (w,v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
-
- double result = 0;
- for (unsigned int j=0; j<m.m(); ++j)
- result += (j+2*i)*j;
- Assert (w(i) == result, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_02/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- test (v,w);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_03.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_03.cc ---------------------------
-
-
-// check FullMatrix::vmult_add
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = i;
- }
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // w:=Mv
- m.vmult_add (w,v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
-
- double result = 0;
- for (unsigned int j=0; j<m.m(); ++j)
- result += (i+2*j)*j;
- Assert (w(i) == i+result, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_03/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- test (v,w);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_04.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_04.cc ---------------------------
-
-
-// check FullMatrix::Tvmult_add
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = i;
- }
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // w:=Mv
- m.Tvmult_add (w,v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
-
- double result = 0;
- for (unsigned int j=0; j<m.m(); ++j)
- result += (j+2*i)*j;
- Assert (w(i) == i+result, ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_04/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- test (v,w);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_05.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_05.cc ---------------------------
-
-
-// check FullMatrix::matrix_scalar_product
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = i+1;
- }
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // <w,Mv>
- const TrilinosScalar s = m.matrix_scalar_product (w,v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
- }
-
- TrilinosScalar result = 0;
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- result += (i+2*j)*j*(i+1);
-
- Assert (s == result, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_05/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- test (v,w);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_06.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_06.cc ---------------------------
-
-
-// check FullMatrix::matrix_norm_square
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- v(i) = i;
-
- m.compress ();
- v.compress ();
-
- // <w,Mv>
- const TrilinosScalar s = m.matrix_norm_square (v);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- Assert (v(i) == i, ExcInternalError());
-
- TrilinosScalar result = 0;
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- result += (i+2*j)*j*i;
-
- Assert (s == result, ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_06/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (30);
- test (v);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-//---------------------------- trilinos_full_matrix_vector_07.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- trilinos_full_matrix_vector_07.cc ---------------------------
-
-
-// check FullMatrix::matrix_norm_square
-
-#include "../tests.h"
-#include <lac/trilinos_vector.h>
-#include <lac/trilinos_full_matrix.h>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-
-void test (TrilinosWrappers::Vector &v,
- TrilinosWrappers::Vector &w,
- TrilinosWrappers::Vector &x)
-{
- TrilinosWrappers::FullMatrix m(v.size(),v.size());
- for (unsigned int i=0; i<m.m(); ++i)
- for (unsigned int j=0; j<m.m(); ++j)
- m.set (i,j, i+2*j);
-
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = i+1;
- }
-
- m.compress ();
- v.compress ();
- w.compress ();
-
- // x=w-Mv
- const double s = m.residual (x, v, w);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (v(i) == i, ExcInternalError());
- Assert (w(i) == i+1, ExcInternalError());
-
- double result = i+1;
- for (unsigned int j=0; j<m.m(); ++j)
- result -= (i+2*j)*j;
-
- Assert (x(i) == result, ExcInternalError());
- }
-
- Assert (s == x.l2_norm(), ExcInternalError());
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main (int argc, char **argv)
-{
- std::ofstream logfile("full_matrix_vector_07/output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- try
- {
- {
- TrilinosWrappers::Vector v (100);
- TrilinosWrappers::Vector w (100);
- TrilinosWrappers::Vector x (100);
- test (v,w,x);
- }
- }
- catch (std::exception &exc)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- std::cerr << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- std::cerr << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK