xref: /petsc/src/ksp/pc/impls/is/nn/nn.h (revision 9dd11ecf0918283bb567d8b33a92f53ac4ea7840)
1 #pragma once
2 
3 #include <petsc/private/pcisimpl.h>
4 
5 /*
6    Private context (data structure) for the NN preconditioner.
7 */
8 typedef struct {
9   /* First MUST come the following line, for the stuff that is common to FETI and Neumann-Neumann. */
10   PC_IS pcis;
11 
12   /* Then, everything else. */
13   Mat           coarse_mat;
14   Vec           coarse_x;
15   Vec           coarse_b;
16   KSP           ksp_coarse;
17   PetscScalar **DZ_IN; /* proc[k].DZ_IN[i][] = bit of vector to be received from processor i by proc. k  */
18   PetscScalar   factor_coarse_rhs;
19 } PC_NN;
20 
21 PETSC_EXTERN PetscErrorCode PCNNCreateCoarseMatrix(PC);
22 PETSC_EXTERN PetscErrorCode PCNNApplySchurToChunk(PC pc, PetscInt n, PetscInt *idx, PetscScalar *chunk, PetscScalar *array_N, Vec vec1_B, Vec vec2_B, Vec vec1_D, Vec vec2_D);
23 PETSC_EXTERN PetscErrorCode PCNNApplyInterfacePreconditioner(PC pc, Vec r, Vec z, PetscScalar *work_N, Vec vec1_B, Vec vec2_B, Vec vec3_B, Vec vec1_D, Vec vec2_D, Vec vec1_N, Vec vec2_N);
24 PETSC_EXTERN PetscErrorCode PCNNBalancing(PC pc, Vec r, Vec u, Vec z, Vec vec1_B, Vec vec2_B, Vec vec3_B, Vec vec1_D, Vec vec2_D, PetscScalar *work_N);
25