16#ifdef DEAL_II_WITH_PETSC
26#ifdef DEAL_II_WITH_PETSC
41 const unsigned int local_rows,
42 const unsigned int local_columns)
44 do_reinit(communicator,
m,
n, local_rows, local_columns);
53 const std::vector<unsigned int> &local_rows_per_process,
54 const std::vector<unsigned int> &local_columns_per_process,
55 const unsigned int this_process)
57 Assert(local_rows_per_process.size() == local_columns_per_process.size(),
59 local_columns_per_process.size()));
65 local_rows_per_process[this_process],
66 local_columns_per_process[this_process]);
73 const unsigned int local_rows,
74 const unsigned int local_columns)
76 do_reinit(MPI_COMM_WORLD,
m,
n, local_rows, local_columns);
84 const std::vector<unsigned int> &local_rows_per_process,
85 const std::vector<unsigned int> &local_columns_per_process,
86 const unsigned int this_process)
88 Assert(local_rows_per_process.size() == local_columns_per_process.size(),
90 local_columns_per_process.size()));
96 local_rows_per_process[this_process],
97 local_columns_per_process[this_process]);
104 const unsigned int m,
105 const unsigned int n,
106 const unsigned int local_rows,
107 const unsigned int local_columns)
110 const PetscErrorCode ierr = MatDestroy(&
matrix);
113 do_reinit(communicator,
m,
n, local_rows, local_columns);
120 const unsigned int m,
121 const unsigned int n,
122 const std::vector<unsigned int> &local_rows_per_process,
123 const std::vector<unsigned int> &local_columns_per_process,
124 const unsigned int this_process)
126 Assert(local_rows_per_process.size() == local_columns_per_process.size(),
128 local_columns_per_process.size()));
131 const PetscErrorCode ierr = MatDestroy(&
matrix);
137 local_rows_per_process[this_process],
138 local_columns_per_process[this_process]);
145 const unsigned int n,
146 const unsigned int local_rows,
147 const unsigned int local_columns)
156 const unsigned int n,
157 const std::vector<unsigned int> &local_rows_per_process,
158 const std::vector<unsigned int> &local_columns_per_process,
159 const unsigned int this_process)
164 local_rows_per_process,
165 local_columns_per_process,
174 const PetscErrorCode ierr = MatDestroy(&
matrix);
204 const PetscErrorCode ierr = MatShellGetContext(A, &this_object);
217 const unsigned int m,
218 const unsigned int n,
219 const unsigned int local_rows,
220 const unsigned int local_columns)
228 PetscErrorCode ierr = MatCreateShell(communicator,
233 static_cast<void *
>(
this),
238 ierr = MatShellSetOperation(
241 reinterpret_cast<void (*)()
>(
245 ierr = MatSetFromOptions(
matrix);
MPI_Comm get_mpi_communicator() const
void reinit(const MPI_Comm communicator, const unsigned int m, const unsigned int n, const unsigned int local_rows, const unsigned int local_columns)
static int matrix_free_mult(Mat A, Vec src, Vec dst)
void do_reinit(const MPI_Comm comm, const unsigned int m, const unsigned int n, const unsigned int local_rows, const unsigned int local_columns)
virtual void vmult(VectorBase &dst, const VectorBase &src) const =0
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define AssertThrow(cond, exc)