Actual source code: vecnestimpl.h
petsc-3.3-p7 2013-05-11
2: #ifndef 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(((PetscObject)x)->comm,PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \
19: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(((PetscObject)x)->comm,PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \
20: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)y->data)->nb) \
21: SETERRQ2(((PetscObject)x)->comm,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(((PetscObject)w)->comm,PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",xarg); \
31: if (!((Vec_Nest*)y->data)->setup_called) SETERRQ1(((PetscObject)w)->comm,PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",yarg); \
32: if (!((Vec_Nest*)z->data)->setup_called) SETERRQ1(((PetscObject)w)->comm,PETSC_ERR_ARG_WRONG,"Nest vector argument %D not setup.",zarg); \
33: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)y->data)->nb) \
34: SETERRQ2(((PetscObject)w)->comm,PETSC_ERR_ARG_WRONG,"Nest vector arguments %D and %D have different numbers of blocks.",xarg,yarg); \
35: if (((Vec_Nest*)x->data)->nb != ((Vec_Nest*)z->data)->nb) \
36: SETERRQ2(((PetscObject)w)->comm,PETSC_ERR_ARG_WRONG,"Nest vector arguments %D and %D have different numbers of blocks.",xarg,zarg); \
37: } while (0)
39: #endif