Actual source code: vecnestimpl.h
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: #if !defined(PETSC_CLANG_STATIC_ANALYZER)
15: #define VecNestCheckCompatible2(x,xarg,y,yarg) do { \
19: if (!((Vec_Nest*)x->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)x),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \
20: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)x),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \
21: 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); \
22: } while (0)
24: #define VecNestCheckCompatible3(x,xarg,y,yarg,z,zarg) do { \
30: if (!((Vec_Nest*)x->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \
31: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \
32: if (!((Vec_Nest*)z->data)->setup_called) SETERRQ1(PetscObjectComm((PetscObject)w),PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",zarg); \
33: 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); \
34: 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); \
35: } while (0)
36: #else
37: template <typename Tv>
38: void VecNestCheckCompatible2(Tv,int,Tv,int);
39: template <typename Tv>
40: void VecNestCheckCompatible3(Tv,int,Tv,int,Tv,int);
41: #endif
43: #endif