xref: /libCEED/tests/t210-elemrestriction.c (revision 619db83ca0bfb3c95755a4b437abc8047796c977)
1 /// @file
2 /// Test creation and view of an element restriction
3 /// \test Test creation and view of an element restriction
4 #include <ceed.h>
5 
6 int main(int argc, char **argv) {
7   Ceed ceed;
8 
9   CeedInt num_elem = 3;
10   CeedInt ind[2*num_elem];
11 
12   CeedElemRestriction r;
13 
14   CeedInit(argv[1], &ceed);
15 
16   for (CeedInt i=0; i<num_elem; i++) {
17     ind[2*i+0] = i;
18     ind[2*i+1] = i+1;
19   }
20   CeedElemRestrictionCreate(ceed, num_elem, 2, 1, 1, num_elem+1, CEED_MEM_HOST,
21                             CEED_USE_POINTER, ind, &r);
22 
23   CeedElemRestrictionView(r, stdout);
24 
25   CeedElemRestrictionDestroy(&r);
26   CeedDestroy(&ceed);
27   return 0;
28 }
29