xref: /libCEED/tests/t320-basis.c (revision ad6481ce28fcfada16ee6d8a13bbacd137fe686a)
1 /// @file
2 /// Test creation and destruction of a 2D Simplex non-tensor H1 basis
3 /// \test Test creation and destruction of a 2D Simplex non-tensor H1 basis
4 #include "t320-basis.h"
5 
6 #include <ceed.h>
7 
8 int main(int argc, char **argv) {
9   Ceed          ceed;
10   const CeedInt p = 6, q = 4, dim = 2;
11   CeedBasis     basis;
12   CeedScalar    q_ref[dim * q], q_weight[q];
13   CeedScalar    interp[p * q], grad[dim * p * q];
14 
15   CeedInit(argv[1], &ceed);
16 
17   // Test skipped if using single precision
18   if (CEED_SCALAR_TYPE == CEED_SCALAR_FP32) return CeedError(ceed, CEED_ERROR_UNSUPPORTED, "Test not implemented in single precision");
19 
20   Build2DSimplex(q_ref, q_weight, interp, grad);
21   CeedBasisCreateH1(ceed, CEED_TOPOLOGY_TRIANGLE, 1, p, q, interp, grad, q_ref, q_weight, &basis);
22   CeedBasisView(basis, stdout);
23 
24   CeedBasisDestroy(&basis);
25   CeedDestroy(&ceed);
26   return 0;
27 }
28