2: #if !defined(VecNest_impl_h)
3: #define VecNest_impl_h 5: #include <petsc/private/vecimpl.h> 7: typedef struct {
8: PetscInt nb; /* n blocks */
9: Vec *v;
10: IS *is;
11: PetscBool setup_called;
12: } Vec_Nest;
14: #define VecNestCheckCompatible2(x,xarg,y,yarg) do { \ 18: if (!((Vec_Nest*)x->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)x),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \ 19: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)x),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \ 20: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)y->data)->nb) SETERRQ2(PetscObjectComm((PetscObject)x),PETSC_ERR_ARG_WRONG,"Nest vector arguments %D and %D have different numbers of blocks.",xarg,yarg); \ 21: } while (0) 23: #define VecNestCheckCompatible3(x,xarg,y,yarg,z,zarg) do { \ 29: if (!((Vec_Nest*)x->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \ 30: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \ 31: if (!((Vec_Nest*)z->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",zarg); \ 32: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)y->data)->nb) SETERRQ2(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector arguments %D and %D have different numbers of blocks.",xarg,yarg); \ 33: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)z->data)->nb) SETERRQ2(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector arguments %D and %D have different numbers of blocks.",xarg,zarg); \ 34: } while (0) 36: #endif