96 Mat system_matrix, dummy;
97#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=5)
98 KSPGetOperators(rKspObject, &system_matrix, &dummy);
101 KSPGetOperators(rKspObject, &system_matrix, &dummy, &flag);
105 MatGetSize(system_matrix, &num_rows, &num_columns);
107 PetscInt num_local_rows, num_local_columns;
108 MatGetLocalSize(system_matrix, &num_local_rows, &num_local_columns);
112 if ((num_rows%2 != 0) || (num_local_rows%2 != 0))
114 TERMINATE(
"Wrong matrix parallel layout detected in PCLDUFactorisation.");
118 unsigned subvector_num_rows = num_rows/2;
119 unsigned subvector_local_rows = num_local_rows/2;
143 assert(global_size == num_rows/2);
147 ISCreateStride(PETSC_COMM_WORLD, high-low, 2*low, 2, &A11_local_rows);
148 ISCreateStride(PETSC_COMM_WORLD, global_size, 0, 2, &A11_columns);
150#if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 8)
151 MatCreateSubMatrix(system_matrix, A11_local_rows, A11_local_rows,
154 MatGetSubMatrix(system_matrix, A11_local_rows, A11_local_rows,
167 assert(global_size == num_rows/2);
171 ISCreateStride(PETSC_COMM_WORLD, high-low, 2*low+1, 2, &A22_local_rows);
172 ISCreateStride(PETSC_COMM_WORLD, global_size, 1, 2, &A22_columns);
174#if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 8)
175 MatCreateSubMatrix(system_matrix, A22_local_rows, A22_local_rows,
178 MatGetSubMatrix(system_matrix, A22_local_rows, A22_local_rows,
192 assert(global_size == num_rows/2);
196 ISCreateStride(PETSC_COMM_WORLD, high-low, 2*low, 2, &B_local_rows);
198 ISCreateStride(PETSC_COMM_WORLD, high-low, 2*low+1, 2, &B_columns);
200#if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR >= 8)
201 MatCreateSubMatrix(system_matrix, B_local_rows, B_columns,
204 MatGetSubMatrix(system_matrix, B_local_rows, B_columns,
233#if (PETSC_VERSION_MAJOR == 2 && PETSC_VERSION_MINOR == 2)