xref: /libCEED/tests/t303-basis.c (revision 00d548f6cce3ebb77e7917d79b50a2a368cad12e)
1 /// @file
2 /// Test that length of BasisApply input/output vectors is incompatible with basis dimensions
3 /// \test Test that topological and geometric dimensions of basis match
4 #include <ceed.h>
5 #include <math.h>
6 
7 int main(int argc, char **argv) {
8   Ceed       ceed;
9   CeedBasis  b;
10   CeedVector U, V;
11   CeedInt    Q = 8, P = 2, num_comp = 1, dim = 3, len = pow((CeedScalar)(Q), dim);
12 
13   CeedInit(argv[1], &ceed);
14 
15   CeedVectorCreate(ceed, len, &U);
16   CeedVectorCreate(ceed, len + 1, &V);
17 
18   CeedBasisCreateTensorH1Lagrange(ceed, dim, num_comp, P, Q, CEED_GAUSS, &b);
19 
20   // Basis apply will error because dimensions don't agree
21   CeedBasisApply(b, 1, CEED_NOTRANSPOSE, CEED_EVAL_INTERP, U, V);
22 
23   // LCOV_EXCL_START
24   CeedBasisDestroy(&b);
25   CeedVectorDestroy(&U);
26   CeedVectorDestroy(&V);
27   CeedDestroy(&ceed);
28   return 0;
29   // LCOV_EXCL_STOP
30 }
31