xref: /libCEED/tests/t210-elemrestriction.c (revision 4fee36f0a30516a0b5ad51bf7eb3b32d83efd623)
15a86f033Sjeremylt /// @file
25a86f033Sjeremylt /// Test creation and view of an element restriction
35a86f033Sjeremylt /// \test Test creation and view of an element restriction
45a86f033Sjeremylt #include <ceed.h>
55a86f033Sjeremylt 
65a86f033Sjeremylt int main(int argc, char **argv) {
75a86f033Sjeremylt   Ceed                ceed;
8d1d35e2fSjeremylt   CeedInt             num_elem = 3;
9d1d35e2fSjeremylt   CeedInt             ind[2 * num_elem];
10*4fee36f0SJeremy L Thompson   CeedElemRestriction elem_restriction;
115a86f033Sjeremylt 
125a86f033Sjeremylt   CeedInit(argv[1], &ceed);
135a86f033Sjeremylt 
14d1d35e2fSjeremylt   for (CeedInt i = 0; i < num_elem; i++) {
155a86f033Sjeremylt     ind[2 * i + 0] = i;
165a86f033Sjeremylt     ind[2 * i + 1] = i + 1;
175a86f033Sjeremylt   }
18*4fee36f0SJeremy L Thompson   CeedElemRestrictionCreate(ceed, num_elem, 2, 1, 1, num_elem + 1, CEED_MEM_HOST, CEED_USE_POINTER, ind, &elem_restriction);
195a86f033Sjeremylt 
20*4fee36f0SJeremy L Thompson   CeedElemRestrictionView(elem_restriction, stdout);
215a86f033Sjeremylt 
22*4fee36f0SJeremy L Thompson   CeedElemRestrictionDestroy(&elem_restriction);
235a86f033Sjeremylt   CeedDestroy(&ceed);
245a86f033Sjeremylt   return 0;
255a86f033Sjeremylt }
26