Actual source code: vecnestimpl.h
1: #ifndef PETSC_VECNESTIMPL_H
2: #define PETSC_VECNESTIMPL_H
4: #include <petsc/private/vecimpl.h>
6: typedef struct {
7: PetscInt nb; /* n blocks */
8: Vec *v;
9: IS *is;
10: PetscBool setup_called;
11: } Vec_Nest;
13: #if !defined(PETSC_CLANG_STATIC_ANALYZER)
14: #define VecNestCheckCompatible2(x, xarg, y, yarg) \
15: do { \
18: PetscCheckSameComm(x, xarg, y, yarg); \
19: PetscCheck(((Vec_Nest *)x->data)->setup_called, PetscObjectComm((PetscObject)x), PETSC_ERR_ARG_WRONG, "Nest vector argument %d not setup.", xarg); \
20: PetscCheck(((Vec_Nest *)y->data)->setup_called, PetscObjectComm((PetscObject)x), PETSC_ERR_ARG_WRONG, "Nest vector argument %d not setup.", yarg); \
21: PetscCheck(((Vec_Nest *)x->data)->nb == ((Vec_Nest *)y->data)->nb, 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) \
25: do { \
29: PetscCheckSameComm(x, xarg, y, yarg); \
30: PetscCheckSameComm(x, xarg, z, zarg); \
31: PetscCheck(((Vec_Nest *)x->data)->setup_called, PetscObjectComm((PetscObject)w), PETSC_ERR_ARG_WRONG, "Nest vector argument %d not setup.", xarg); \
32: PetscCheck(((Vec_Nest *)y->data)->setup_called, PetscObjectComm((PetscObject)w), PETSC_ERR_ARG_WRONG, "Nest vector argument %d not setup.", yarg); \
33: PetscCheck(((Vec_Nest *)z->data)->setup_called, PetscObjectComm((PetscObject)w), PETSC_ERR_ARG_WRONG, "Nest vector argument %d not setup.", zarg); \
34: PetscCheck(((Vec_Nest *)x->data)->nb == ((Vec_Nest *)y->data)->nb, PetscObjectComm((PetscObject)w), PETSC_ERR_ARG_WRONG, "Nest vector arguments %d and %d have different numbers of blocks.", xarg, yarg); \
35: PetscCheck(((Vec_Nest *)x->data)->nb == ((Vec_Nest *)z->data)->nb, PetscObjectComm((PetscObject)w), PETSC_ERR_ARG_WRONG, "Nest vector arguments %d and %d have different numbers of blocks.", xarg, zarg); \
36: } while (0)
37: #else
38: template <typename Tv>
39: void VecNestCheckCompatible2(Tv, int, Tv, int);
40: template <typename Tv>
41: void VecNestCheckCompatible3(Tv, int, Tv, int, Tv, int);
42: #endif
44: #endif // PETSC_VECNESTIMPL_H