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