21 #include "pism/inverse/IPTwoBlockVec.hh"
22 #include "pism/util/error_handling.hh"
30 MPI_Comm comm, comm_b;
31 ierr = PetscObjectGetComm((PetscObject)a, &comm);
PISM_CHK(ierr,
"PetscObjectGetComm");
32 ierr = PetscObjectGetComm((PetscObject)b, &comm_b);
PISM_CHK(ierr,
"PetscObjectGetComm");
33 assert(comm == comm_b);
37 ierr = VecGetOwnershipRange(a, &lo_a, &hi_a);
PISM_CHK(ierr,
"VecGetOwnershipRange");
43 ierr = VecGetOwnershipRange(b, &lo_b, &hi_b);
PISM_CHK(ierr,
"VecGetOwnershipRange");
49 ierr = ISCreateStride(comm,
m_na_local, lo_a, 1,
52 ierr = ISCreateStride(comm,
m_na_local, lo_a + lo_b, 1,
56 ierr = ISCreateStride(comm,
m_nb_local, lo_b, 1,
64 ierr = VecSetType(
m_ab,
"mpi");
PISM_CHK(ierr,
"VecSetType");
102 ierr = VecScatterBegin(s, a, b, INSERT_VALUES, m);
105 ierr = VecScatterEnd(s, a, b, INSERT_VALUES, m);
petsc::VecScatter m_scatter_a
petsc::VecScatter m_scatter_b
void scatter(Vec a, Vec b)
IPTwoBlockVec(Vec a, Vec b)
void gather(Vec a, Vec b)
void scatter_begin_end(VecScatter s, Vec a, Vec b, ScatterMode m)
#define PISM_CHK(errcode, name)