xref: /libCEED/tests/t215-elemrestriction.c (revision 356036fa84f714fa73ef64c9a80ce2028dde816f)
1 /// @file
2 /// Test element restriction state counter
3 /// \test Test element restriction state counter
4 #include <ceed/backend.h>
5 
6 int main(int argc, char **argv) {
7   Ceed                ceed;
8   CeedInt             num_elem = 3;
9   CeedInt             ind[2 * num_elem];
10   const CeedInt      *offsets;
11   CeedElemRestriction elem_restriction;
12 
13   CeedInit(argv[1], &ceed);
14 
15   for (CeedInt i = 0; i < num_elem; i++) {
16     ind[2 * i + 0] = i;
17     ind[2 * i + 1] = i + 1;
18   }
19   CeedElemRestrictionCreate(ceed, num_elem, 2, 1, 1, num_elem + 1, CEED_MEM_HOST, CEED_USE_POINTER, ind, &elem_restriction);
20 
21   // Get offsets and fail to restore them
22   CeedElemRestrictionGetOffsets(elem_restriction, CEED_MEM_HOST, &offsets);
23 
24   CeedElemRestrictionDestroy(&elem_restriction);
25   // LCOV_EXCL_START
26   CeedDestroy(&ceed);
27   return 0;
28   // LCOV_EXCL_STOP
29 }
30