#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/intergrid_map.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/fe/fe_q.h>
#include <fstream>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/intergrid_map.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/numerics/vector_tools.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/intergrid_map.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/numerics/vector_tools.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/intergrid_map.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/fe/fe_q.h>
#include <fstream>
#include <deal.II/lac/linear_operator.h>
// Vectors:
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
// Block Matrix and Vectors:
-#include <deal.II/lac/petsc_block_vector.h>
-#include <deal.II/lac/petsc_block_sparse_matrix.h>
-
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_block_sparse_matrix.h>
initlog();
deallog << std::setprecision(10);
- {
- PETScWrappers::SparseMatrix a(2,2,2);
- for (unsigned int i = 0; i<2; ++i)
- for (unsigned int j = 0; j<2; ++j)
- a.add (i,j, 2);
- a.compress (VectorOperation::add);
-
- PETScWrappers::Vector v(2);
- for (unsigned int i = 0; i<2; ++i)
- v[i] = 1;
- PETScWrappers::Vector u(v);
- auto op_a = linear_operator<PETScWrappers::Vector>(a);
- op_a.vmult(u,v);
- deallog << "SparseMatrix -> OK" << std::endl;
- }
-
{
unsigned int np = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
if (4%np==0 && np<=4)
deallog << "SparseMatrix MPI -> OK" << std::endl;
}
- {
- PETScWrappers::BlockSparseMatrix a;
- auto op_a = linear_operator<PETScWrappers::BlockVector>(a);
- deallog << "BlockSparseMatrix -> OK" << std::endl;
- }
-
{
PETScWrappers::MPI::BlockSparseMatrix a;
auto op_a = linear_operator<PETScWrappers::MPI::BlockVector>(a);
return 0;
}
-
-
-DEAL::SparseMatrix -> OK
DEAL::SparseMatrix MPI -> OK
-DEAL::BlockSparseMatrix -> OK
DEAL::BlockSparseMatrix MPI -> OK
DEAL::OK
-DEAL::SparseMatrix -> OK
DEAL::SparseMatrix MPI -> OK
-DEAL::BlockSparseMatrix -> OK
DEAL::BlockSparseMatrix MPI -> OK
DEAL::OK
-DEAL::SparseMatrix -> OK
DEAL::SparseMatrix MPI -> OK
-DEAL::BlockSparseMatrix -> OK
DEAL::BlockSparseMatrix MPI -> OK
DEAL::OK
#include "../tests.h"
#include <deal.II/base/mpi.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector_memory.h>
// check is_serial_vector type trait
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <fstream>
void test ()
{
- // make sure that is_serial_vector< dealii::PETScWrappers::Vector > is working
- Assert (is_serial_vector< dealii::PETScWrappers::Vector >::value == true,
- ExcInternalError());
-
- deallog << is_serial_vector< dealii::PETScWrappers::Vector >::value << std::endl;
-
- deallog << "OK" << std::endl << std::endl;
-
- // make sure that is_serial_vector< dealii::PETScWrappers::BlockVector > is working
- Assert (is_serial_vector< dealii::PETScWrappers::BlockVector >::value == true,
- ExcInternalError());
-
- deallog << is_serial_vector< dealii::PETScWrappers::BlockVector >::value << std::endl;
-
- deallog << "OK" << std::endl << std::endl;
-
// make sure that is_serial_vector< dealii::PETScWrappers::MPI::Vector > is working
Assert (is_serial_vector< dealii::PETScWrappers::MPI::Vector >::value == false,
ExcInternalError());
-DEAL::1
-DEAL::OK
-DEAL::
-DEAL::1
-DEAL::OK
-DEAL::
DEAL::0
DEAL::OK
DEAL::
// ---------------------------------------------------------------------
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include "fe_tools_extrapolate_common.h"
// check FETools::extrapolate on distributed triangulations
CHECK_ALL(DGQ,1,DGQ,0);
CHECK_ALL(DGQ,1,DGQ,1);
}
-
// Like _01 but with PETSc vectors. this program hangs at the time of writing
// in much the same way solution_transfer_01 does because one processor has no
-// cells and all the others decide that PETScWrappers::Vector::compress is a
-// no-op when of course the one who does have cells doesn't think so
+// cells and all the others decide that PETScWrappers::MPI::Vector::compress
+// is a no-op when of course the one who does have cells doesn't think so
#include "../tests.h"
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector_memory.h>
#include <deal.II/base/logstream.h>
testit<PETScWrappers::MPI::Vector>();
testit<PETScWrappers::MPI::BlockVector>();
- testit<PETScWrappers::Vector>();
- testit<PETScWrappers::BlockVector>();
if (myid==0)
deallog << "done" << std::endl;
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/petsc_solver.h>
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/sparsity_tools.h>
-// check PETScWrappers::Vector::size()
+// check PETScWrappers::MPI::Vector::size()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the vector
for (unsigned int i=0; i<v.size(); i+=1+i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator() in set-mode
+// check PETScWrappers::MPI::Vector::operator() in set-mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator() in add-mode
+// check PETScWrappers::MPI::Vector::operator() in add-mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::l1_norm()
+// check PETScWrappers::MPI::Vector::l1_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
test (v);
}
-// check PETScWrappers::Vector::l2_norm()
+// check PETScWrappers::MPI::Vector::l2_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
PetscScalar norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
test (v);
}
-// check PETScWrappers::Vector::linfty_norm()
+// check PETScWrappers::MPI::Vector::linfty_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
test (v);
}
-// check PETScWrappers::Vector::operator *=
+// check PETScWrappers::MPI::Vector::operator *=
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator /=
+// check PETScWrappers::MPI::Vector::operator /=
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator*(Vector) on two vectors that are
+// check PETScWrappers::MPI::Vector::operator*(Vector) on two vectors that are
// orthogonal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector, but disjoint sets of elements
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::operator*(Vector) on two vectors that are
+// check PETScWrappers::MPI::Vector::operator*(Vector) on two vectors that are
// not orthogonal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector, and record the expected scalar
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// this test used to check for PETScWrappers::Vector::clear(). However, this
-// function has since been removed, so we test for v=0 instead, although that
-// may be covered by one of the other tests
+// this test used to check for PETScWrappers::MPI::Vector::clear(). However,
+// this function has since been removed, so we test for v=0 instead, although
+// that may be covered by one of the other tests
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator = (PetscScalar) with setting to a
+// check PETScWrappers::MPI::Vector::operator = (PetscScalar) with setting to a
// nonzero value
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator = (Vector)
+// check PETScWrappers::MPI::Vector::operator = (Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
v.compress (VectorOperation::insert);
// then copy it
- PETScWrappers::Vector w (v.size());
+ PETScWrappers::MPI::Vector w (v.locally_owned_elements(), MPI_COMM_WORLD);
w = v;
// make sure they're equal
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator = (Vector), except that we don't
+// check PETScWrappers::MPI::Vector::operator = (Vector), except that we don't
// resize the vector to be copied to beforehand
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
// then copy it to a vector of different
// size
- PETScWrappers::Vector w (1);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 1, 1);
w = v;
// make sure they're equal
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::reinit(fast)
+// check PETScWrappers::MPI::Vector::reinit(fast)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
- v.reinit (13, true);
+ v.reinit (MPI_COMM_WORLD, 13, 13, true);
AssertThrow (v.size() == 13, ExcInternalError());
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::reinit(!fast)
+// check PETScWrappers::MPI::Vector::reinit(!fast)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
v.compress (VectorOperation::insert);
// then resize with setting to zero
- v.reinit (13, false);
+ v.reinit (MPI_COMM_WORLD, 13, 13, false);
AssertThrow (v.size() == 13, ExcInternalError());
AssertThrow (v.l2_norm() == 0, ExcInternalError());
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::l2_norm()
+// check PETScWrappers::MPI::Vector::l2_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
PetscScalar norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::mean_value()
+// check PETScWrappers::MPI::Vector::mean_value()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
PetscScalar sum = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::lp_norm(3)
+// check PETScWrappers::MPI::Vector::lp_norm(3)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
PetscScalar sum = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::all_zero
+// check PETScWrappers::MPI::Vector::all_zero
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double sum = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator+=(Vector)
+// check PETScWrappers::MPI::Vector::operator+=(Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::operator-=(Vector)
+// check PETScWrappers::MPI::Vector::operator-=(Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::add (scalar)
+// check PETScWrappers::MPI::Vector::add (scalar)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
for (unsigned int i=0; i<v.size(); ++i)
v(i) = i;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::add(Vector)
+// check PETScWrappers::MPI::Vector::add(Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::add(scalar, Vector)
+// check PETScWrappers::MPI::Vector::add(scalar, Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::add(s,V,s,V)
+// check PETScWrappers::MPI::Vector::add(s,V,s,V)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
- test (v,w,x);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x(indices, MPI_COMM_WORLD);
+ test(v, w, x);
}
}
-// check PETScWrappers::Vector::sadd(s, Vector)
+// check PETScWrappers::MPI::Vector::sadd(s, Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::sadd(scalar, scalar, Vector)
+// check PETScWrappers::MPI::Vector::sadd(scalar, scalar, Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::sadd(s,s,V,s,V)
+// check PETScWrappers::MPI::Vector::sadd(s,s,V,s,V)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
- test (v,w,x);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x(indices, MPI_COMM_WORLD);
+ test(v, w, x);
}
}
-// check PETScWrappers::Vector::sadd(s,s,V,s,V,s,V)
+// check PETScWrappers::MPI::Vector::sadd(s,s,V,s,V,s,V)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x,
- PETScWrappers::Vector &y)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x,
+ PETScWrappers::MPI::Vector &y)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
- PETScWrappers::Vector y (100);
- test (v,w,x,y);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector y(indices, MPI_COMM_WORLD);
+ test(v, w, x, y);
}
}
-// check PETScWrappers::Vector::scale
+// check PETScWrappers::MPI::Vector::scale
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::equ (s,V)
+// check PETScWrappers::MPI::Vector::equ (s,V)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- test (v,w);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ test(v, w);
}
}
-// check PETScWrappers::Vector::equ (s,V,s,V)
+// check PETScWrappers::MPI::Vector::equ (s,V,s,V)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
- test (v,w,x);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x(indices, MPI_COMM_WORLD);
+ test(v, w, x);
}
}
-// check PETScWrappers::Vector::ratio
+// check PETScWrappers::MPI::Vector::ratio
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
- test (v,w,x);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x(indices, MPI_COMM_WORLD);
+ test(v, w, x);
}
}
-// check PETScWrappers::Vector::operator = (Vector<PetscVector>)
+// check PETScWrappers::MPI::Vector::operator = (Vector<PetscVector>)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
Vector<PetscScalar> w (v.size());
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator = (Vector<T>) with T!=PetscScalar
+// check PETScWrappers::MPI::Vector::operator = (Vector<T>) with T!=PetscScalar
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
Vector<double> w (v.size());
Vector<float> x (v.size());
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check copy constructor PETScWrappers::Vector::Vector(Vector)
+// check copy constructor PETScWrappers::MPI::Vector::Vector(Vector)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some entries of the vector
for (unsigned int i=0; i<v.size(); ++i)
v.compress (VectorOperation::insert);
// then copy it
- PETScWrappers::Vector w (v);
+ PETScWrappers::MPI::Vector w (v);
// make sure they're equal
deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator() in set, and later in *= mode
+// check PETScWrappers::MPI::Vector::operator() in set, and later in *= mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator() in set, and later in /= mode
+// check PETScWrappers::MPI::Vector::operator() in set, and later in /= mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. have a bit pattern of where we
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::is_non_zero
+// check PETScWrappers::MPI::Vector::is_non_zero
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector. they are all positive
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check ::Vector (const PETScWrappers::Vector &) copy constructor
+// check ::Vector (const PETScWrappers::MPI::Vector &) copy constructor
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector.
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector (const ::Vector &) copy constructor
+// check PETScWrappers::MPI::Vector (const ::Vector &) copy constructor
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector.
Vector<double> w (v);
Vector<float> x (v);
- PETScWrappers::Vector w1 (w);
- PETScWrappers::Vector x1 (x);
+ PETScWrappers::MPI::Vector w1 (MPI_COMM_WORLD, w, w.size());
+ PETScWrappers::MPI::Vector x1 (MPI_COMM_WORLD, x, w.size());
for (unsigned int i=0; i<v.size(); ++i)
{
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check ::Vector::operator = (const PETScWrappers::Vector &)
+// check ::Vector::operator = (const PETScWrappers::MPI::Vector &)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector.
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
-// check PETScWrappers::Vector::operator = (const ::Vector &)
+// check PETScWrappers::MPI::Vector::operator = (const ::Vector &)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the
// vector.
Vector<float> x;
x=v;
- PETScWrappers::Vector w1;
+ PETScWrappers::MPI::Vector w1(MPI_COMM_WORLD, v.size(), v.size());
w1=w;
- PETScWrappers::Vector x1;
+ PETScWrappers::MPI::Vector x1(MPI_COMM_WORLD, v.size(), v.size());
x1=x;
for (unsigned int i=0; i<v.size(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- test (v);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v(indices, MPI_COMM_WORLD);
+ test(v);
}
}
#include "../tests.h"
#include <deal.II/base/logstream.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
// make sure that block vector iterator allows reading and writing correctly
#include "../tests.h"
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <fstream>
#include <iostream>
void test ()
{
- PETScWrappers::BlockVector v(2,1);
+ PETScWrappers::MPI::BlockVector v(2, MPI_COMM_WORLD, 1, 1);
v(0) = 1;
v(1) = 2;
// first check reading through a const
// iterator
{
- PETScWrappers::BlockVector::const_iterator i=v.begin();
+ PETScWrappers::MPI::BlockVector::const_iterator i=v.begin();
AssertThrow (*i == 1, ExcInternalError());
++i;
AssertThrow (*i == 2, ExcInternalError());
// same, but create iterator in a different
// way
{
- PETScWrappers::BlockVector::const_iterator
- i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
+ PETScWrappers::MPI::BlockVector::const_iterator
+ i=const_cast<const PETScWrappers::MPI::BlockVector &>(v).begin();
AssertThrow (*i == 1, ExcInternalError());
++i;
AssertThrow (*i == 2, ExcInternalError());
// read through a read-write iterator
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
AssertThrow (*i == 1, ExcInternalError());
++i;
AssertThrow (*i == 2, ExcInternalError());
// write through a read-write iterator
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
*i = 2;
++i;
// and read again
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
AssertThrow (*i == 2, ExcInternalError());
++i;
AssertThrow (*i == 3, ExcInternalError());
// like _01, except that we use operator[] instead of operator*
#include "../tests.h"
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <fstream>
#include <iostream>
void test ()
{
- PETScWrappers::BlockVector v(2,1);
+ PETScWrappers::MPI::BlockVector v(2, MPI_COMM_WORLD, 1, 1);
v(0) = 1;
v(1) = 2;
// first check reading through a const
// iterator
{
- PETScWrappers::BlockVector::const_iterator i=v.begin();
+ PETScWrappers::MPI::BlockVector::const_iterator i=v.begin();
AssertThrow (i[0] == 1, ExcInternalError());
AssertThrow (i[1] == 2, ExcInternalError());
}
// same, but create iterator in a different
// way
{
- PETScWrappers::BlockVector::const_iterator
- i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
+ PETScWrappers::MPI::BlockVector::const_iterator
+ i=const_cast<const PETScWrappers::MPI::BlockVector &>(v).begin();
AssertThrow (i[0] == 1, ExcInternalError());
AssertThrow (i[1] == 2, ExcInternalError());
}
// read through a read-write iterator
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
AssertThrow (i[0] == 1, ExcInternalError());
AssertThrow (i[1] == 2, ExcInternalError());
}
// write through a read-write iterator
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
i[0] = 2;
i[1] = 3;
}
// and read again
{
- PETScWrappers::BlockVector::iterator i = v.begin();
+ PETScWrappers::MPI::BlockVector::iterator i = v.begin();
AssertThrow (i[0] == 2, ExcInternalError());
AssertThrow (i[1] == 3, ExcInternalError());
}
#include "../tests.h"
#include <deal.II/base/logstream.h>
-#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
template <typename number>
-bool operator == (const PETScWrappers::BlockVector &v1,
- const PETScWrappers::BlockVector &v2)
+bool operator == (const PETScWrappers::MPI::BlockVector &v1,
+ const PETScWrappers::MPI::BlockVector &v2)
{
if (v1.size() != v2.size())
return false;
// iterators
if (true)
{
- PETScWrappers::BlockVector v1(ivector);
- PETScWrappers::BlockVector v2(ivector);
+ PETScWrappers::MPI::BlockVector v1(ivector, MPI_COMM_WORLD, ivector);
+ PETScWrappers::MPI::BlockVector v2(ivector, MPI_COMM_WORLD, ivector);
// initialize first vector with
// simple loop
v1(i) = i;
// initialize other vector
// through iterators
- PETScWrappers::BlockVector::iterator p2 = v2.begin();
+ PETScWrappers::MPI::BlockVector::iterator p2 = v2.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p2)
*p2 = i;
Assert (p2==v2.end(), ExcInternalError());
deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
};
- // Check 1: initialization via
- // iterators
- if (true)
- {
- PETScWrappers::BlockVector v1(ivector);
-
- // initialize first vector with
- // simple loop
- for (unsigned int i=0; i<v1.size(); ++i)
- v1(i) = i;
- // initialize other vector
- // through iterators into first
- // vector
- PETScWrappers::BlockVector v2(ivector, v1.begin(), v1.end());
- // check that the two vectors are equal
- deallog << "Check 2: " << (v1==v2 ? "true" : "false") << std::endl;
- };
-
- // Check 3: loop forward and back
+ // Check 2: loop forward and back
// and check that things are the
// same
if (true)
{
- PETScWrappers::BlockVector v1(ivector);
+ PETScWrappers::MPI::BlockVector v1(ivector, MPI_COMM_WORLD, ivector);
// initialize first vector with
// simple loop
for (unsigned int i=0; i<v1.size(); ++i)
v1(i) = i;
- PETScWrappers::BlockVector::iterator p1 = v1.begin();
+ PETScWrappers::MPI::BlockVector::iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
AssertThrow (*p1 == i, ExcInternalError());
// if we came thus far,
// everything is alright
- deallog << "Check 3: true" << std::endl;
+ deallog << "Check 2: true" << std::endl;
};
- // Check 4: same, but this time
+ // Check 3: same, but this time
// with const iterators
if (true)
{
- PETScWrappers::BlockVector v1(ivector);
+ PETScWrappers::MPI::BlockVector v1(ivector, MPI_COMM_WORLD, ivector);
// initialize first vector with
// simple loop
for (unsigned int i=0; i<v1.size(); ++i)
v1(i) = i;
- PETScWrappers::BlockVector::const_iterator p1 = v1.begin();
+ PETScWrappers::MPI::BlockVector::const_iterator p1 = v1.begin();
for (unsigned int i=0; i<v1.size(); ++i, ++p1)
AssertThrow (*p1 == i, ExcInternalError());
// if we came thus far,
// everything is alright
- deallog << "Check 4: true" << std::endl;
+ deallog << "Check 3: true" << std::endl;
};
- // Checks 5-14: use some standard
+ // Checks 4-13: use some standard
// algorithms
if (true)
{
- PETScWrappers::BlockVector v1(ivector);
+ PETScWrappers::MPI::BlockVector v1(ivector, MPI_COMM_WORLD, ivector);
// initialize first vector with
// simple loop
for (unsigned int i=0; i<v1.size(); ++i)
// check std::distance
// algorithm
- deallog << "Check 5: "
+ deallog << "Check 4: "
<< (std::distance (v1.begin(), v1.end()) ==
static_cast<signed int>(v1.size()) ?
"true" : "false")
<< std::endl;
// check std::copy
- PETScWrappers::BlockVector v2(ivector);
+ PETScWrappers::MPI::BlockVector v2(ivector, MPI_COMM_WORLD, ivector);
std::copy (v1.begin(), v1.end(), v2.begin());
- deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
+ deallog << "Check 5: " << (v1 == v2 ? "true" : "false") << std::endl;
// check std::transform
std::transform (v1.begin(), v1.end(), v2.begin(),
std::bind (std::multiplies<double>(),
std::placeholders::_1,
2.0));
+ v2.compress(VectorOperation::insert);
v2 *= 1./2.;
- deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
+ deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
// check operators +/-, +=/-=
- deallog << "Check 8: "
+ deallog << "Check 7: "
<< (std::distance(v1.begin(), v1.begin()+3) == 3 ?
"true" : "false")
<< std::endl;
- deallog << "Check 9: "
+ deallog << "Check 8: "
<< (std::distance(v1.end()-6, v1.end()) == 6 ?
"true" : "false")
<< std::endl;
- deallog << "Check 10: "
+ deallog << "Check 9: "
<< (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
"true" : "false")
<< std::endl;
- deallog << "Check 11: "
+ deallog << "Check 10: "
<< (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
"true" : "false")
<< std::endl;
- deallog << "Check 12: "
+ deallog << "Check 11: "
<< (std::distance((v1.end()-=4), v1.end()) == 4 ?
"true" : "false")
<< std::endl;
// check advance
- PETScWrappers::BlockVector::iterator p2 = v1.begin();
+ PETScWrappers::MPI::BlockVector::iterator p2 = v1.begin();
std::advance (p2, v1.size());
- deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl;
+ deallog << "Check 12: " << (p2 == v1.end() ? "true" : "false") << std::endl;
- PETScWrappers::BlockVector::const_iterator p3 = v1.begin();
+ PETScWrappers::MPI::BlockVector::const_iterator p3 = v1.begin();
std::advance (p3, v1.size());
- deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl;
- };
-
- // Check 15: initialization through
- // iterators
- if (true)
- {
- PETScWrappers::BlockVector v1(ivector);
- // initialize first vector with
- // simple loop
- for (unsigned int i=0; i<v1.size(); ++i)
- v1(i) = i;
-
- // initialize a normal vector
- // from it
- Vector<double> v2(v1.begin(), v1.end());
-
- // and reverse way
- PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
- deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl;
+ deallog << "Check 13: " << (p3 == v1.end() ? "true" : "false") << std::endl;
};
- // Check 16: initialization through
- // iterators. variant with one
- // constant object
+ // Check 14: operator[]
if (true)
{
- PETScWrappers::BlockVector v1(ivector);
- // initialize first vector with
- // simple loop
- for (unsigned int i=0; i<v1.size(); ++i)
- v1(i) = i;
-
- // initialize a normal vector
- // from it
- const Vector<double> v2(v1.begin(), v1.end());
-
- // and reverse way
- PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
- deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl;
- };
-
- // Check 17: initialization through
- // iterators. variant with two
- // constant object
- if (true)
- {
- PETScWrappers::BlockVector v1(ivector);
- // initialize first vector with
- // simple loop
- for (unsigned int i=0; i<v1.size(); ++i)
- v1(i) = i;
-
- // initialize a normal vector
- // from it
- const Vector<double> v2(v1.begin(), v1.end());
-
- // and reverse way
- const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
- deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl;
- };
-
- // Check 18: initialization through
- // iterators. variant with three
- // constant object
- if (true)
- {
- PETScWrappers::BlockVector v0(ivector);
- // initialize first vector with
- // simple loop
- for (unsigned int i=0; i<v0.size(); ++i)
- v0(i) = i;
-
- const PETScWrappers::BlockVector v1 = v0;
-
- // initialize a normal vector
- // from it
- const Vector<double> v2(v1.begin(), v1.end());
-
- // and reverse way
- const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
- deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl;
- };
-
- // Check 19: operator[]
- if (true)
- {
- PETScWrappers::BlockVector v1(ivector);
+ PETScWrappers::MPI::BlockVector v1(ivector, MPI_COMM_WORLD, ivector);
for (unsigned int i=0; i<v1.size(); ++i)
v1(i) = i;
for (unsigned int i=0; i<v1.size(); ++i)
{
- const PETScWrappers::BlockVector::iterator p = (v1.begin()+i);
+ const PETScWrappers::MPI::BlockVector::iterator p = (v1.begin()+i);
for (unsigned int j=0; j<v1.size(); ++j)
AssertThrow (p[(signed)j-(signed)i] == j, ExcInternalError());
};
// if we came thus far,
// everything is alright
- deallog << "Check 19: true" << std::endl;
+ deallog << "Check 14: true" << std::endl;
};
}
return 0;
}
-
DEAL::Check 12: true
DEAL::Check 13: true
DEAL::Check 14: true
-DEAL::Check 15: true
-DEAL::Check 16: true
-DEAL::Check 17: true
-DEAL::Check 18: true
-DEAL::Check 19: true
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
testproblem.five_point(A);
A.compress (VectorOperation::insert);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
- GrowingVectorMemory<PETScWrappers::Vector> mem;
- SolverCG<PETScWrappers::Vector> solver(control,mem);
+ GrowingVectorMemory<PETScWrappers::MPI::Vector> mem;
+ SolverCG<PETScWrappers::MPI::Vector> solver(control,mem);
PreconditionIdentity preconditioner;
check_solve (solver, control, A,u,f, preconditioner);
}
- GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
+ GrowingVectorMemory<PETScWrappers::MPI::Vector>::release_unused_memory ();
}
DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii8SolverCGINS_13PETScWrappers6VectorEEE
+DEAL::Solver type: N6dealii8SolverCGINS_13PETScWrappers3MPI6VectorEEE
DEAL:cg::Starting value 31.00
DEAL:cg::Convergence step 43 value 0.0008189
DEAL::Solver stopped after 43 iterations
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
testproblem.five_point(A);
A.compress (VectorOperation::insert);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
- GrowingVectorMemory<PETScWrappers::Vector> mem;
- SolverBicgstab<PETScWrappers::Vector> solver(control,mem);
+ GrowingVectorMemory<PETScWrappers::MPI::Vector> mem;
+ SolverBicgstab<PETScWrappers::MPI::Vector> solver(control,mem);
PreconditionIdentity preconditioner;
check_solve (solver, control, A,u,f, preconditioner);
}
- GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
+ GrowingVectorMemory<PETScWrappers::MPI::Vector>::release_unused_memory ();
}
DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii14SolverBicgstabINS_13PETScWrappers6VectorEEE
+DEAL::Solver type: N6dealii14SolverBicgstabINS_13PETScWrappers3MPI6VectorEEE
DEAL::Solver stopped within 48 - 51 iterations
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
- GrowingVectorMemory<PETScWrappers::Vector> mem;
- SolverGMRES<PETScWrappers::Vector> solver(control,mem);
+ GrowingVectorMemory<PETScWrappers::MPI::Vector> mem;
+ SolverGMRES<PETScWrappers::MPI::Vector> solver(control,mem);
PreconditionIdentity preconditioner;
check_solve (solver, control, A,u,f, preconditioner);
}
- GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
+ GrowingVectorMemory<PETScWrappers::MPI::Vector>::release_unused_memory ();
}
DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii11SolverGMRESINS_13PETScWrappers6VectorEEE
+DEAL::Solver type: N6dealii11SolverGMRESINS_13PETScWrappers3MPI6VectorEEE
DEAL:GMRES::Starting value 31.00
DEAL:GMRES::Convergence step 75 value 0.0008096
DEAL::Solver stopped after 75 iterations
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
- GrowingVectorMemory<PETScWrappers::Vector> mem;
- SolverMinRes<PETScWrappers::Vector> solver(control,mem);
+ GrowingVectorMemory<PETScWrappers::MPI::Vector> mem;
+ SolverMinRes<PETScWrappers::MPI::Vector> solver(control,mem);
PreconditionIdentity preconditioner;
check_solve (solver, control, A,u,f, preconditioner);
}
- GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
+ GrowingVectorMemory<PETScWrappers::MPI::Vector>::release_unused_memory ();
}
DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii12SolverMinResINS_13PETScWrappers6VectorEEE
+DEAL::Solver type: N6dealii12SolverMinResINS_13PETScWrappers3MPI6VectorEEE
DEAL:minres::Starting value 31.0000
DEAL:minres::Convergence step 43 value 0.000691560
DEAL::Solver stopped after 43 iterations
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
- GrowingVectorMemory<PETScWrappers::Vector> mem;
- SolverQMRS<PETScWrappers::Vector> solver(control,mem);
+ GrowingVectorMemory<PETScWrappers::MPI::Vector> mem;
+ SolverQMRS<PETScWrappers::MPI::Vector> solver(control,mem);
PreconditionIdentity preconditioner;
check_solve (solver, control, A,u,f, preconditioner);
}
- GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
+ GrowingVectorMemory<PETScWrappers::MPI::Vector>::release_unused_memory ();
}
DEAL::Size 32 Unknowns 961
-DEAL::Solver type: N6dealii10SolverQMRSINS_13PETScWrappers6VectorEEE
+DEAL::Solver type: N6dealii10SolverQMRSINS_13PETScWrappers3MPI6VectorEEE
DEAL:QMRS::Starting value 31.0000
DEAL:QMRS::Convergence step 46 value 0.000906349
DEAL::Solver stopped after 46 iterations
// check FullMatrix::vmult
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check FullMatrix::Tvmult
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check FullMatrix::vmult_add
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check FullMatrix::Tvmult_add
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check FullMatrix::matrix_scalar_product
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check FullMatrix::matrix_norm_square
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (30);
+ IndexSet indices(30);
+ indices.add_range(0, 30);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
test (v);
}
// check FullMatrix::matrix_norm_square
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_full_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
PETScWrappers::FullMatrix m(v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x (indices, MPI_COMM_WORLD);
test (v,w,x);
}
#include "../tests.h"
#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/base/index_set.h>
#include <fstream>
mat.compress(VectorOperation::insert);
{
- PETScWrappers::Vector src, dst;
- src.reinit(5);
- dst.reinit(5);
+ IndexSet indices(5);
+ indices.add_range(0, 5);
+ PETScWrappers::MPI::Vector src, dst;
+ src.reinit(indices, MPI_COMM_WORLD);
+ dst.reinit(indices, MPI_COMM_WORLD);
src(0) = 1.0;
src(1) = 2.0;
src.compress(VectorOperation::insert);
-1.000e+00 6.667e-01 0.000e+00 0.000e+00 0.000e+00
-5.000e-01 6.667e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 1.000e+00 6.667e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 5.000e-01 6.667e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
-4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.365e-01 6.355e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.674e-01 6.511e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-9.367e-01 6.333e-01 0.000e+00 0.000e+00 0.000e+00
-4.675e-01 6.500e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 9.367e-01 6.333e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 4.675e-01 6.500e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-1.000e+00 6.667e-01 0.000e+00 0.000e+00 0.000e+00
-5.000e-01 6.667e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 1.000e+00 6.667e-01 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 5.000e-01 6.667e-01 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
-1.000e+00 2.000e+00 0.000e+00 0.000e+00 0.000e+00
-1.000e+00 2.000e+00 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 1.000e+00 2.000e+00 0.000e+00 0.000e+00 0.000e+00
+[Proc0 0-4] 1.000e+00 2.000e+00 0.000e+00 0.000e+00 0.000e+00
DEAL:0::OK
#include "../tests.h"
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
// then do a single matrix-vector
// multiplication with subsequent formation
// of the matrix norm
- PETScWrappers::Vector v1(N*N), v2(N*N);
+ IndexSet indices(N*N);
+ indices.add_range(0, N*N);
+ PETScWrappers::MPI::Vector v1(indices, MPI_COMM_WORLD),
+ v2(indices, MPI_COMM_WORLD);
for (unsigned int i=0; i<N*N; ++i)
v1(i) = i;
matrix.vmult (v2, v1);
#include "../testmatrix.h"
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
u = 0.;
#include "../testmatrix.h"
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
u = 0.;
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PetscFDMatrix A(size, dim);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
f.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
u = 0.;
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
f = 1.;
A.compress (VectorOperation::insert);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
u = 0.;
f = 1.;
A.compress (VectorOperation::insert);
- PETScWrappers::Vector t=u;
+ PETScWrappers::MPI::Vector t=u;
PETScWrappers::SolverPreOnly solver(control);
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ IndexSet indices(dim);
+ indices.add_range(0, dim);
+ PETScWrappers::MPI::Vector f(indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector u(indices, MPI_COMM_WORLD);
u = 0.;
f = 1.;
A.compress (VectorOperation::insert);
// solver.set_symmetric_mode(true);
solver.solve(A,u,f);
- PETScWrappers::Vector tmp(dim);
+ PETScWrappers::MPI::Vector tmp(dim);
deallog << "residual = " << A.residual (tmp, u, f)
<< std::endl;
}
}
-
// check SparseMatrix::add(other, factor)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
// now forbidden
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
// check SparseMatrix::vmult
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check SparseMatrix::Tvmult
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check SparseMatrix::vmult_add
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check SparseMatrix::Tvmult_add
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check SparseMatrix::matrix_scalar_product
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// check SparseMatrix::matrix_norm_square
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (30);
+ IndexSet indices(30);
+ indices.add_range(0, 30);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
test (v);
}
// check SparseMatrix::matrix_norm_square
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w,
- PETScWrappers::Vector &x)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w,
+ PETScWrappers::MPI::Vector &x)
{
PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
for (unsigned int i=0; i<m.m(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
- PETScWrappers::Vector x (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x (indices, MPI_COMM_WORLD);
test (v,w,x);
}
-// when calling PETScWrappers::Vector::operator() (), the return type is a
+// when calling PETScWrappers::MPI::Vector::operator() (), the return type is a
// reference object, not a reference to the actual element. this leads to the
// funny situation that an assignment like v2(i)=v1(i) isn't really what it
// looks like: it tries to copy the reference objects, not the values they
// this was fixed 2004-04-05, and this test checks that it works
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int i=0; i<v.size(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// this is equivalent to the petsc_vector_assign_01 test, except that we use
+// this is equivalent to the petsc vector_assign_01 test, except that we use
// operator+= instead of operator=. Now, this does not present a problem,
// since the compiler does not automatically generate a version of this
// operator, but simply performs the conversion to PetscScalar, i.e. the
// wrote the test to make sure it works this way, let's keep it then...
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int i=0; i<v.size(); ++i)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// check PETScWrappers::Vector::operator==(PETScWrappers::Vector) for vectors that are not
-// equal
+// check PETScWrappers::MPI::Vector::operator==(PETScWrappers::MPI::Vector)
+// for vectors that are not equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// check PETScWrappers::Vector::operator==(PETScWrappers::Vector) for vectors that are
-// equal
+// check PETScWrappers::MPI::Vector::operator==(PETScWrappers::MPI::Vector)
+// for vectors that are equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
if (i%3 == 0)
w(i) = i+1.;
}
+ v.compress(VectorOperation::insert);
+ w.compress(VectorOperation::insert);
// but then copy elements and make sure the
// vectors are actually equal
v = w;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// check PETScWrappers::Vector::operator!=(PETScWrappers::Vector) for vectors that are not
-// equal
+// check PETScWrappers::MPI::Vector::operator!=(PETScWrappers::MPI::Vector)
+// for vectors that are not equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// check PETScWrappers::Vector::operator!=(PETScWrappers::Vector) for vectors that are
-// equal
+// check PETScWrappers::MPI::Vector::operator!=(PETScWrappers::MPI::Vector)
+// for vectors that are equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector
}
// but then copy elements and make sure the
// vectors are actually equal
+ v.compress(VectorOperation::insert);
+ w.compress(VectorOperation::insert);
v = w;
AssertThrow (! (v!=w), ExcInternalError());
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
// restores the previous value of the stream precision
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
{
- PETScWrappers::Vector v (5);
+ IndexSet indices(5);
+ indices.add_range(0, 5);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
for (unsigned int i=0; i<v.size(); ++i)
v(i) = i*1.2345678901234567;
DEAL::3.14159
DEAL::across=false
+[Proc 0 0-4]
0.0000000000e+00
1.2345678901e+00
2.4691357802e+00
4.9382715605e+00
DEAL::across=true
-0.0000000000e+00 1.2345678901e+00 2.4691357802e+00 3.7037036704e+00 4.9382715605e+00
+[Proc0 0-4] 0.0000000000e+00 1.2345678901e+00 2.4691357802e+00 3.7037036704e+00 4.9382715605e+00
DEAL::3.14159
-// Test the constructor PETScWrappers::Vector(const Vec &) that takes an
+// Test the constructor PETScWrappers::MPI::Vector(const Vec &) that takes an
// existing PETSc vector.
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int i=0; i<v.size(); ++i)
// check that they're equal
Assert (v==w, ExcInternalError());
+ v.compress(VectorOperation::insert);
+ w.compress(VectorOperation::insert);
v=w;
deallog << "OK" << std::endl;
int ierr = VecCreateSeq (PETSC_COMM_SELF, 100, &vpetsc);
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
- PETScWrappers::Vector v (vpetsc);
- PETScWrappers::Vector w (100);
+ IndexSet indices(100);
+ indices.add_range(0, 100);
+ PETScWrappers::MPI::Vector v (indices, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector w (indices, MPI_COMM_WORLD);
test (v,w);
}
-// check PETScWrappers::Vector::size()
+// check PETScWrappers::MPI::Vector::size()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the vector
for (unsigned int k=0; k<v.size(); k+=1+k)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v(100);
+ PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, 100, 100);
test (v);
}
}
-// check PETScWrappers::Vector::operator() in set-mode
+// check PETScWrappers::MPI::Vector::operator() in set-mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
deallog << "Complex test" << std::endl;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v(100);
+ PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, 100, 100);
test (v);
}
}
-// check PETScWrappers::Vector::operator() in add-mode
+// check PETScWrappers::MPI::Vector::operator() in add-mode
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set only certain elements of the vector. have a bit pattern of
// where we actually wrote elements to
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
test (v);
}
-// check PETScWrappers::Vector::l1_norm()
+// check PETScWrappers::MPI::Vector::l1_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
test (v);
}
}
-// check PETScWrappers::Vector::l2_norm()
+// check PETScWrappers::MPI::Vector::l2_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
test (v);
}
}
-// check PETScWrappers::Vector::linfty_norm()
+// check PETScWrappers::MPI::Vector::linfty_norm()
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v)
+void test (PETScWrappers::MPI::Vector &v)
{
// set some elements of the vector
double norm = 0;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
test (v);
}
-// check PETScWrappers::Vector::operator*(Vector) on two vectors that are
+// check PETScWrappers::MPI::Vector::operator*(Vector) on two vectors that are
// not orthogonal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each
// vector, and record the expected scalar
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 100, 100);
test (v,w);
}
// deal.II includes
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
// on vector
// vector elements
-void test_vector (PETScWrappers::Vector &v)
+void test_vector (PETScWrappers::MPI::Vector &v)
{
deallog << "Check vector access" << std::endl;
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (5);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 5, 5);
test_vector (v);
deallog << "vector:" << std::endl;
return 0;
}
-
-
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
int main(int argc, char **argv)
{
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ PETScWrappers::MPI::Vector f(MPI_COMM_WORLD, dim, dim);
+ PETScWrappers::MPI::Vector u(MPI_COMM_WORLD, dim, dim);
f = 1.;
u = 0.;
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
int main(int argc, char **argv)
{
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ PETScWrappers::MPI::Vector f(MPI_COMM_WORLD, dim, dim);
+ PETScWrappers::MPI::Vector u(MPI_COMM_WORLD, dim, dim);
f = 1.;
u = 0.;
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ PETScWrappers::MPI::Vector f(MPI_COMM_WORLD, dim, dim);
+ PETScWrappers::MPI::Vector u(MPI_COMM_WORLD, dim, dim);
f = 1.;
A.compress (VectorOperation::insert);
f.compress (VectorOperation::insert);
}
}
-
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PetscFDMatrix A(size, dim);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ PETScWrappers::MPI::Vector f(MPI_COMM_WORLD, dim, dim);
+ PETScWrappers::MPI::Vector u(MPI_COMM_WORLD, dim, dim);
f = 1.;
A.compress (VectorOperation::insert);
f.compress (VectorOperation::insert);
}
}
-
#include <iomanip>
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
#include <deal.II/lac/vector_memory.h>
PETScWrappers::SparseMatrix A(dim, dim, 5);
testproblem.five_point(A);
- PETScWrappers::Vector f(dim);
- PETScWrappers::Vector u(dim);
+ PETScWrappers::MPI::Vector f(MPI_COMM_WORLD, dim, dim);
+ PETScWrappers::MPI::Vector u(MPI_COMM_WORLD, dim, dim);
f = 1.;
A.compress (VectorOperation::insert);
f.compress (VectorOperation::insert);
}
}
-
// check SparseMatrix::add(other, factor)
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
#include <fstream>
#include <iostream>
// check assignment of elements in Vector
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/vector.h>
#include <fstream>
#include <iostream>
void test ()
{
const unsigned int s = 10;
- PETScWrappers::Vector v(s);
+ PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, s, s);
for (unsigned int k=0; k<v.size(); ++k)
v(k) = k;
v.compress (VectorOperation::insert);
- PETScWrappers::Vector v2(s);
+ PETScWrappers::MPI::Vector v2(MPI_COMM_WORLD, s, s);
for (int k=0; k<v2.size(); ++k)
v2(k) = PetscScalar (k,-k);
// See notes in petsc/vector_assign_01.cc
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int k=0; k<v.size(); ++k)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (100);
- PETScWrappers::Vector w (100);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 100, 100);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 100, 100);
test (v,w);
}
-// this is equivalent to the petsc_vector_assign_01 test, except that we use
+// this is equivalent to the petsc_parallel_vector_assign_01 test, except that we use
// operator+= instead of operator=. This is also not exciting...
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int k=0; k<v.size(); ++k)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (20);
- PETScWrappers::Vector w (20);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 20, 20);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 20, 20);
test (v,w);
// Some output
-// check PETScWrappers::Vector::operator==(PETScWrappers::Vector) for vectors that are not
-// equal
+// check PETScWrappers::MPI::Vector::operator==(PETScWrappers::MPI::Vector)
+// for vectors that are not equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each vector
for (unsigned int k=0; k<v.size(); ++k)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (20);
- PETScWrappers::Vector w (20);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 20, 20);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 20, 20);
test (v,w);
// SOme output
-// check PETScWrappers::Vector::operator==(PETScWrappers::Vector) for vectors that are
-// equal
+// check PETScWrappers::MPI::Vector::operator==(PETScWrappers::MPI::Vector)
+// for vectors that are equal
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set only certain elements of each vector
for (unsigned int k=0; k<v.size(); ++k)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (20);
- PETScWrappers::Vector w (20);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 20, 20);
+ PETScWrappers::MPI::Vector w (MPI_COMM_WORLD, 20, 20);
test (v,w);
// Output
// restores the previous value of the stream precision
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
{
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
{
- PETScWrappers::Vector v (5);
+ PETScWrappers::MPI::Vector v (MPI_COMM_WORLD, 5, 5);
for (unsigned int k=0; k<v.size(); ++k)
v(k) = PetscScalar (k*1.2345678901234567,2.*k*1.2345678901234567);
// See comments in tests/petsc/vector_wrap_01.cc
#include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <fstream>
#include <iostream>
#include <vector>
-void test (PETScWrappers::Vector &v,
- PETScWrappers::Vector &w)
+void test (PETScWrappers::MPI::Vector &v,
+ PETScWrappers::MPI::Vector &w)
{
// set the first vector
for (unsigned int k=0; k<v.size(); ++k)
int ierr = VecCreateSeq (PETSC_COMM_SELF, 100, &vpetsc);
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
- PETScWrappers::Vector v (vpetsc);
- PETScWrappers::Vector w (100);
+ PETScWrappers::MPI::Vector v (vpetsc);
+ PETScWrappers::MPI::Vector w (PETSC_COMM_SELF, 100, 100);
test (v,w);
}
#include <deal.II/numerics/data_out.h>\r
#include <deal.II/lac/full_matrix.h>\r
#include <deal.II/lac/petsc_sparse_matrix.h>\r
-#include <deal.II/lac/petsc_vector.h>\r
+#include <deal.II/lac/petsc_parallel_vector.h>\r
#include <deal.II/lac/petsc_solver.h>\r
#include <deal.II/lac/petsc_precondition.h>\r
\r
DoFHandler<2> dof_handler;\r
\r
PETScWrappers::SparseMatrix A;\r
- PETScWrappers::Vector b, x;\r
+ PETScWrappers::MPI::Vector b, x;\r
ConstraintMatrix constraints;\r
\r
TableHandler output_table;\r
\r
A.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(),\r
dof_handler.max_couplings_between_dofs());\r
- b.reinit (dof_handler.n_dofs());\r
- x.reinit (dof_handler.n_dofs());\r
+ b.reinit (MPI_COMM_WORLD, dof_handler.n_dofs(), dof_handler.n_dofs());\r
+ x.reinit (MPI_COMM_WORLD, dof_handler.n_dofs(), dof_handler.n_dofs());\r
\r
// some output\r
output_table.add_value ("cells", triangulation.n_active_cells());\r
PETScWrappers::PreconditionBlockJacobi preconditioner (A);\r
cg_solver.solve (A, x, b, preconditioner);\r
\r
- PETScWrappers::Vector res(x);\r
+ PETScWrappers::MPI::Vector res(x);\r
A.residual(res,x,b);\r
AssertThrow(res.l2_norm()<1e-3,\r
ExcInternalError());\r
#include <deal.II/numerics/data_out.h>\r
#include <deal.II/lac/full_matrix.h>\r
#include <deal.II/lac/petsc_sparse_matrix.h>\r
-#include <deal.II/lac/petsc_vector.h>\r
+#include <deal.II/lac/petsc_parallel_vector.h>\r
#include <deal.II/lac/slepc_solver.h>\r
\r
#include <fstream>\r
FE_Q<2> fe;\r
DoFHandler<2> dof_handler;\r
\r
- PETScWrappers::SparseMatrix A, B;\r
- std::vector<PETScWrappers::Vector> x;\r
- std::vector<double> lambda;\r
- ConstraintMatrix constraints;\r
+ PETScWrappers::SparseMatrix A, B;\r
+ std::vector<PETScWrappers::MPI::Vector> x;\r
+ std::vector<double> lambda;\r
+ ConstraintMatrix constraints;\r
\r
TableHandler output_table;\r
};\r
dof_handler.max_couplings_between_dofs());\r
\r
x.resize (1);\r
- x[0].reinit (dof_handler.n_dofs ());\r
+ x[0].reinit (MPI_COMM_WORLD, dof_handler.n_dofs(), dof_handler.n_dofs());\r
lambda.resize (1);\r
lambda[0] = 0.;\r
\r
\r
{\r
const double precision = 1e-7;\r
- PETScWrappers::Vector Ax(x[0]), Bx(x[0]);\r
+ PETScWrappers::MPI::Vector Ax(x[0]), Bx(x[0]);\r
for (unsigned int i=0; i < x.size(); ++i)\r
{\r
B.vmult(Bx,x[i]);\r
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_compatibility.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/slepc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
for (unsigned int j=0; j<u[i].size(); ++j)
u[i][j] = static_cast<double>(Testing::rand())/static_cast<double>(RAND_MAX);
+ for (auto &vector : u)
+ vector.compress(VectorOperation::insert);
+
solver.set_initial_space(u);
solver.solve(A,B,v,u,v.size());
diagonal.diag(B);
B.compress (VectorOperation::insert);
- std::vector<PETScWrappers::Vector> u(n_eigenvalues,
- PETScWrappers::Vector(dim));
+ std::vector<PETScWrappers::MPI::Vector>
+ u(n_eigenvalues, PETScWrappers::MPI::Vector(MPI_COMM_WORLD, dim, dim));
std::vector<PetscScalar> v(n_eigenvalues);
PETScWrappers::set_option_value("-st_ksp_type","cg");
}
}
-
#include <deal.II/base/logstream.h>
#include <deal.II/lac/petsc_compatibility.h>
#include <deal.II/lac/petsc_sparse_matrix.h>
-#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_solver.h>
#include <deal.II/lac/slepc_solver.h>
#include <deal.II/lac/petsc_precondition.h>
for (unsigned int j=0; j<u[i].size(); ++j)
u[i][j] = static_cast<double>(Testing::rand())/static_cast<double>(RAND_MAX);
+ for (auto &vector : u)
+ vector.compress(VectorOperation::insert);
+
solver.set_initial_space(u);
// solve
solver.solve(A,v,u,v.size());
testproblem.three_point(A);
A.compress (VectorOperation::insert);
- std::vector<PETScWrappers::Vector> u(n_eigenvalues,
- PETScWrappers::Vector(dim));
+ std::vector<PETScWrappers::MPI::Vector>
+ u(n_eigenvalues, PETScWrappers::MPI::Vector(MPI_COMM_WORLD, dim, dim));
std::vector<PetscScalar> v(n_eigenvalues);
{