//---------------------------- trilinos_65.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
+// Copyright (C) 2004, 2005, 2008, 2013 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// This test used to fail after upgrading to petsc 2.2.1
-#include "../tests.h"
+#include "../tests.h"
#include <deal.II/base/utilities.h>
#include <deal.II/lac/trilinos_vector.h>
void test ()
{
- TrilinosWrappers::MPI::Vector
- v (Epetra_Map(100,0,Utilities::Trilinos::comm_world()));
+ TrilinosWrappers::MPI::Vector
+ v (Epetra_Map(TrilinosWrappers::types::int_type(100),0,
+ Utilities::Trilinos::comm_world()));
v(0) = 1;
v = 0;
-int main (int argc,char **argv)
+int main (int argc,char **argv)
{
std::ofstream logfile("65/output");
deallog.attach(logfile);
deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ deallog.threshold_double(1.e-10);
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
-
+
return 1;
}
- catch (...)
+ catch (...)
{
std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
//---------------------------- trilinos_slowness_03.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2005, 2013 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
//
// the tests build the 5-point stencil matrix for a uniform grid of size N*N
-#include "../tests.h"
+#include "../tests.h"
#include <deal.II/base/utilities.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/trilinos_sparse_matrix.h>
{
const unsigned int N = 200;
- // build the sparse matrix
- Epetra_Map map (static_cast<int>(N*N), 0, Utilities::Trilinos::comm_world());
+ // build the sparse matrix
+ Epetra_Map map (TrilinosWrappers::types::int_type(N*N), 0,
+ Utilities::Trilinos::comm_world());
TrilinosWrappers::SparseMatrix matrix (map, 5);
for(unsigned int i=0; i<N; i++)
for(unsigned int j=0; j<N; j++)
}
}
matrix.compress ();
-
+
// then do a single matrix-vector
// multiplication with subsequent formation
// of the matrix norm
for (unsigned int i=0; i<N*N; ++i)
v1(i) = i;
matrix.vmult (v2, v1);
-
+
deallog << v1*v2 << std::endl;
}
-int main (int argc,char **argv)
+int main (int argc,char **argv)
{
std::ofstream logfile("slowness_03/output");
deallog.attach(logfile);
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
-
+
return 1;
}
- catch (...)
+ catch (...)
{
std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
//---------------------------- trilinos_slowness_03.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2005 by the deal.II authors
+// Copyright (C) 2005, 2013 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// matrix in a consecutive fashion, but rather according to the order of
// degrees of freedom in the sequence of cells that we traverse
-#include "../tests.h"
+#include "../tests.h"
#include <deal.II/base/utilities.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/trilinos_sparse_matrix.h>
// unused indices
const unsigned int k = rand() % (N-i);
permutation[i] = unused_indices[k];
-
+
// then swap this used element to the
// end where we won't consider it any
// more
std::swap (unused_indices[k], unused_indices[N-i-1]);
- }
+ }
}
-
- // build the sparse matrix
- Epetra_Map map (static_cast<int>(N*N), 0, Utilities::Trilinos::comm_world());
+
+ // build the sparse matrix
+ Epetra_Map map (TrilinosWrappers::types::int_type(N*N), 0,
+ Utilities::Trilinos::comm_world());
TrilinosWrappers::SparseMatrix matrix (map, 5);
for(unsigned int i_=0; i_<N; i_++)
for(unsigned int j_=0; j_<N; j_++)
{
const unsigned int i=permutation[i_];
const unsigned int j=permutation[j_];
-
+
const unsigned int global = i*N+j;
matrix.set(global, global, rand());
if (j>0)
}
}
matrix.compress ();
-
+
// then do a single matrix-vector
// multiplication with subsequent formation
// of the matrix norm
for (unsigned int i=0; i<N*N; ++i)
v1(i) = i;
matrix.vmult (v2, v1);
-
+
deallog << v1*v2 << std::endl;
}
-int main (int argc,char **argv)
+int main (int argc,char **argv)
{
std::ofstream logfile("slowness_04/output");
deallog.attach(logfile);
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
-
+
return 1;
}
- catch (...)
+ catch (...)
{
std::cerr << std::endl << std::endl
<< "----------------------------------------------------"
matrix.print_formatted (deallog.get_file_stream());
// now copy everything into a Trilinos matrix
- Epetra_Map map(5,5,0,Utilities::Trilinos::comm_world());
+ Epetra_Map map(TrilinosWrappers::types::int_type(5),
+ TrilinosWrappers::types::int_type(5),
+ 0,
+ Utilities::Trilinos::comm_world());
TrilinosWrappers::SparseMatrix tmatrix;
tmatrix.reinit (map, map, matrix);
// now copy everything into a Trilinos matrix
Epetra_Map map(TrilinosWrappers::types::int_type(5),
- 5,0,Utilities::Trilinos::comm_world());
+ TrilinosWrappers::types::int_type(5),
+ 0,
+ Utilities::Trilinos::comm_world());
TrilinosWrappers::SparseMatrix tmatrix;
tmatrix.reinit (map, map, matrix, 0, false);