Skip to content

Commit

Permalink
Merge pull request #13589 from peterrum/ldv_reinit
Browse files Browse the repository at this point in the history
LA::d::V:reinit() add check
  • Loading branch information
kronbichler committed Apr 4, 2022
2 parents 8e38737 + 9545137 commit 674807f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/deal.II/lac/la_parallel_vector.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,14 +643,17 @@ namespace LinearAlgebra
const MPI_Comm & comm_sm)
{
clear_mpi_requests();
partitioner = partitioner_in;

this->comm_sm = comm_sm;

// set vector size and allocate memory
const size_type new_allocated_size =
partitioner->locally_owned_size() + partitioner->n_ghost_indices();
resize_val(new_allocated_size, comm_sm);
if (partitioner.get() != partitioner_in.get())
{
partitioner = partitioner_in;
const size_type new_allocated_size =
partitioner->locally_owned_size() + partitioner->n_ghost_indices();
resize_val(new_allocated_size, comm_sm);
}

// initialize to zero
*this = Number();
Expand Down

0 comments on commit 674807f

Please sign in to comment.