xref: /libCEED/tests/t320-basis.c (revision 2b730f8b5a9c809740a0b3b302db43a719c636b1)
152bfb9bbSJeremy L Thompson /// @file
252bfb9bbSJeremy L Thompson /// Test creation and destruction of a 2D Simplex non-tensor H1 basis
352bfb9bbSJeremy L Thompson /// \test Test creation and distruction of a 2D Simplex non-tensor H1 basis
452bfb9bbSJeremy L Thompson #include "t320-basis.h"
552bfb9bbSJeremy L Thompson 
6*2b730f8bSJeremy L Thompson #include <ceed.h>
7*2b730f8bSJeremy L Thompson 
852bfb9bbSJeremy L Thompson int main(int argc, char **argv) {
952bfb9bbSJeremy L Thompson   Ceed          ceed;
1052bfb9bbSJeremy L Thompson   const CeedInt P = 6, Q = 4, dim = 2;
1152bfb9bbSJeremy L Thompson   CeedBasis     b;
12d1d35e2fSjeremylt   CeedScalar    q_ref[dim * Q], q_weight[Q];
1352bfb9bbSJeremy L Thompson   CeedScalar    interp[P * Q], grad[dim * P * Q];
1452bfb9bbSJeremy L Thompson 
1580a9ef05SNatalie Beams   CeedInit(argv[1], &ceed);
1680a9ef05SNatalie Beams 
1780a9ef05SNatalie Beams   // Test skipped if using single precision
18*2b730f8bSJeremy L Thompson   if (CEED_SCALAR_TYPE == CEED_SCALAR_FP32) return CeedError(ceed, CEED_ERROR_UNSUPPORTED, "Test not implemented in single precision");
1980a9ef05SNatalie Beams 
20d1d35e2fSjeremylt   buildmats(q_ref, q_weight, interp, grad);
2152bfb9bbSJeremy L Thompson 
22*2b730f8bSJeremy L Thompson   CeedBasisCreateH1(ceed, CEED_TOPOLOGY_TRIANGLE, 1, P, Q, interp, grad, q_ref, q_weight, &b);
2352bfb9bbSJeremy L Thompson   CeedBasisView(b, stdout);
2452bfb9bbSJeremy L Thompson 
2552bfb9bbSJeremy L Thompson   CeedBasisDestroy(&b);
2652bfb9bbSJeremy L Thompson   CeedDestroy(&ceed);
2752bfb9bbSJeremy L Thompson   return 0;
2852bfb9bbSJeremy L Thompson }
29