DoFTools::extract_locally_relevant_dofs (dof_handler,locally_relevant_dofs);
PETScWrappers::MPI::Vector force;
- force.reinit (mpi_communicator, locally_owned_dofs);
+ force.reinit (locally_owned_dofs, mpi_communicator);
Assert(!force.has_ghost_elements(), ExcInternalError());
ConstraintMatrix constraints (locally_relevant_dofs);
IndexSet local_relevant(numproc*2);
local_relevant.add_range(1,2);
- PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active);
- PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant);
+ PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
// set local values
vb(myid*2)=myid*2.0;
IndexSet local_relevant(numproc*2);
local_relevant.add_range(1,2);
- PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active);
- PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant);
- PETScWrappers::MPI::Vector v2(MPI_COMM_WORLD, local_active, local_relevant);
+ PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v2(local_active, local_relevant, MPI_COMM_WORLD);
vb = 1.5;
v2 = vb;
IndexSet local_relevant(numproc*2);
local_relevant.add_range(1,2);
- PETScWrappers::MPI::Vector vb(MPI_COMM_WORLD, local_active);
- PETScWrappers::MPI::Vector v(MPI_COMM_WORLD, local_active, local_relevant);
+ PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
// set local values
vb(myid*2)=myid*2.0;
VectorTools::interpolate(dofh,
ConstantFunction<dim>(1),
x);
- x.compress ();
const double norm = x.l2_norm();
if (myid == 0)
deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs()
DoFTools::extract_locally_relevant_dofs (dofh1,
dof1_locally_relevant_dofs);
- PETScWrappers::MPI::Vector u1(MPI_COMM_WORLD, dof1_locally_owned_dofs, dof1_locally_relevant_dofs);
+ PETScWrappers::MPI::Vector u1(dof1_locally_owned_dofs, dof1_locally_relevant_dofs, MPI_COMM_WORLD);
- PETScWrappers::MPI::Vector out(MPI_COMM_WORLD, dof1_locally_owned_dofs);
+ PETScWrappers::MPI::Vector out(dof1_locally_owned_dofs, MPI_COMM_WORLD);
FETools::interpolation_difference
(dofh1, cm1, u1, dofh2, cm2, out);
local_dof_indices,
vector);
}
- vector.compress (Add);
+ vector.compress (VectorOperation::add);
}
// now check that no entries were generated
local_dof_indices,
vector);
}
- vector.compress (Add);
+ vector.compress (VectorOperation::add);
}
// now check that no entries were generated
local_dof_indices,
vector);
}
- vector.compress (Add);
+ vector.compress (VectorOperation::add);
}
// now check that no entries were generated
VectorTools::interpolate(dofh,
TemperatureInitialValues<dim>(),
x);
- x.compress();
TrilinosWrappers::MPI::Vector x_rel;
x_rel.reinit(relevant_set, MPI_COMM_WORLD);
x_rel = x;
trans.interpolate(x);
x_rel.reinit(relevant_set, MPI_COMM_WORLD);
- x_rel.compress();
ConstraintMatrix cm(relevant_set);
DoFTools::make_hanging_node_constraints (dofh, cm);
VectorTools::interpolate(dofh,
TemperatureInitialValues<dim>(),
x_ref);
- x_ref.compress();
x_ref -= x;
double err = x_ref.linfty_norm();
VectorTools::interpolate(dofh,
ConstantFunction<dim> (1.),
x_ref);
- x_ref.compress();
TrilinosWrappers::MPI::Vector x1 (x_ref);
}
else
{
- Assert( tr.begin_active()->subdomain_id()==types::artificial_subdomain_id,
+ Assert( tr.begin_active()->subdomain_id()==numbers::artificial_subdomain_id,
ExcInternalError() );
}
VectorTools::interpolate(dofh,
TemperatureInitialValues<dim>(),
x);
- x.compress();
TrilinosWrappers::MPI::Vector x_rel;
x_rel.reinit(relevant_set, MPI_COMM_WORLD);
x_rel = x;
trans.interpolate(x);
x_rel.reinit(relevant_set, MPI_COMM_WORLD);
- x_rel.compress();
ConstraintMatrix cm(relevant_set);
DoFTools::make_hanging_node_constraints (dofh, cm);
VectorTools::interpolate(dofh,
TemperatureInitialValues<dim>(),
x_ref);
- x_ref.compress();
x_ref -= x;
double err = x_ref.linfty_norm();
DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
- PETScWrappers::MPI::Vector x(MPI_COMM_WORLD,locally_owned_dofs);
- PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs, locally_relevant_dofs);
+ PETScWrappers::MPI::Vector x(locally_owned_dofs, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector solution(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<dim,PETScWrappers::MPI::Vector> soltrans(dh);
DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
- PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs);
+ PETScWrappers::MPI::Vector solution(locally_owned_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<dim,PETScWrappers::MPI::Vector> soltrans(dh);
solution = 2;
soltrans.deserialize(solution);
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
- PETScWrappers::MPI::Vector x (MPI_COMM_WORLD, locally_owned_dofs);
- PETScWrappers::MPI::Vector x2 (MPI_COMM_WORLD, locally_owned_dofs);
- PETScWrappers::MPI::Vector solution (MPI_COMM_WORLD, locally_owned_dofs, locally_relevant_dofs);
- PETScWrappers::MPI::Vector solution2 (MPI_COMM_WORLD, locally_owned_dofs, locally_relevant_dofs);
+ PETScWrappers::MPI::Vector x (locally_owned_dofs, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector x2 (locally_owned_dofs, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector solution (locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector solution2 (locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans2 (dh);
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
- PETScWrappers::MPI::Vector solution (MPI_COMM_WORLD, locally_owned_dofs);
- PETScWrappers::MPI::Vector solution2 (MPI_COMM_WORLD, locally_owned_dofs);
+ PETScWrappers::MPI::Vector solution (locally_owned_dofs, MPI_COMM_WORLD);
+ PETScWrappers::MPI::Vector solution2 (locally_owned_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans2 (dh);
solution = 2;
mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1);
- mat.compress();
+ mat.compress(VectorOperation::add);
std::vector<types::global_dof_index> rows(1,1);
mat.clear_rows(rows);
mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1);
- mat.compress();
+ mat.compress(VectorOperation::add);
// mat.write_ascii();
if (myid==0)
mat.add(0, 0, 1.0);
- mat.compress();
+ mat.compress(VectorOperation::add);
if (myid==0)
deallog << "done" << std::endl;
Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
- vec.compress();
+ vec.compress(VectorOperation::insert);
// verify correctness so far
{
cm.distribute (vec);
// verify correctness
- vec.compress ();
-
if (myid != 0)
Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
ExcInternalError());
vec.block(0)(i) = i;
for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
vec.block(1)(i) = i;
- vec.compress();
+ vec.compress(VectorOperation::add);
// verify correctness so far
{
cm.distribute (vec);
// verify correctness
- vec.compress ();
-
if (myid != 0)
Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
ExcInternalError());
Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
- vec.compress();
+ vec.compress(VectorOperation::insert);
// verify correctness so far
{
cm.distribute (vec);
// verify correctness
- vec.compress ();
-
if (myid != 0)
Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
ExcInternalError());
}
cm.distribute_local_to_global (local_vector, local_dof_indices, vector);
}
- vector.compress();
+ vector.compress(VectorOperation::add);
}
double norm = vector.l2_norm();
if (myid == 0)
}
cm.distribute_local_to_global (local_vector, local_dof_indices, vector);
}
- vector.compress();
+ vector.compress(VectorOperation::add);
}
double norm = vector.l2_norm();
if (myid == 0)
DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
- PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
+ PETScWrappers::MPI::Vector solution(locally_owned_dofs,locally_relevant_dofs, MPI_COMM_WORLD);
parallel::distributed::SolutionTransfer<2,PETScWrappers::MPI::Vector> soltrans(dh);
locally_owned_dofs = dh.locally_owned_dofs ();
DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
- PETScWrappers::MPI::Vector tmp(MPI_COMM_WORLD,dh.n_dofs(),dh.n_locally_owned_dofs());
+ PETScWrappers::MPI::Vector tmp(locally_owned_dofs, MPI_COMM_WORLD);
soltrans.interpolate (tmp);
- solution.reinit(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
+ solution.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
solution = tmp;
// make sure no processor is
DoFTools::extract_locally_relevant_dofs (dof_handler,
locally_relevant_dofs);
- locally_relevant_solution.reinit (mpi_communicator,
- locally_owned_dofs,
- locally_relevant_dofs);
- system_rhs.reinit (mpi_communicator,
- dof_handler.n_dofs(),
- dof_handler.n_locally_owned_dofs());
+ locally_relevant_solution.reinit (locally_owned_dofs,
+ locally_relevant_dofs,
+ mpi_communicator);
+ system_rhs.reinit (locally_owned_dofs, mpi_communicator);
system_rhs = 0;
constraints.clear ();
system_rhs);
}
- system_matrix.compress ();
- system_rhs.compress ();
+ system_matrix.compress (VectorOperation::add);
+ system_rhs.compress (VectorOperation::add);
}
DoFTools::extract_locally_relevant_dofs (dof_handler,
locally_relevant_dofs);
- locally_relevant_solution.reinit (mpi_communicator,
- locally_owned_dofs,
- locally_relevant_dofs);
- system_rhs.reinit (mpi_communicator,
- dof_handler.n_dofs(),
- dof_handler.n_locally_owned_dofs());
+ locally_relevant_solution.reinit (locally_owned_dofs,
+ locally_relevant_dofs,
+ mpi_communicator);
+ system_rhs.reinit (locally_owned_dofs, mpi_communicator);
system_rhs = 0;
constraints.clear ();
vec.block(0)(i) = i;
for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
vec.block(1)(i) = i;
- vec.compress();
+ vec.compress(VectorOperation::insert);
// verify correctness so far
{
cm.distribute (vec);
// verify correctness
- vec.compress ();
-
if (myid != 0)
Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
ExcInternalError());
Assert (vec.local_range().second == 100*myid+100, ExcInternalError());
for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
vec(i) = i;
- vec.compress();
+ vec.compress(VectorOperation::insert);
// verify correctness so far
{
cm.distribute (vec);
// verify correctness
- vec.compress ();
-
if (myid != 0)
Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
ExcInternalError());