xref: /libCEED/tests/t320-basis.c (revision 00d548f6cce3ebb77e7917d79b50a2a368cad12e)
1 /// @file
2 /// Test creation and destruction of a 2D Simplex non-tensor H1 basis
3 /// \test Test creation and distruction 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     b;
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   buildmats(q_ref, q_weight, interp, grad);
21 
22   CeedBasisCreateH1(ceed, CEED_TOPOLOGY_TRIANGLE, 1, P, Q, interp, grad, q_ref, q_weight, &b);
23   CeedBasisView(b, stdout);
24 
25   CeedBasisDestroy(&b);
26   CeedDestroy(&ceed);
27   return 0;
28 }
29