xref: /libCEED/tests/t508-operator.c (revision 947f93aa7135eb1759bf2866bd2fbd481436b113)
1 /// @file
2 /// Test creation, copying, and destruction for mass matrix operator
3 /// \test Test creation, copying, and destruction for mass matrix operator
4 #include <ceed.h>
5 #include <stdlib.h>
6 #include <math.h>
7 
8 #include "t500-operator.h"
9 
10 int main(int argc, char **argv) {
11   Ceed ceed;
12   CeedQFunction qf, qf_2;
13   CeedOperator op, op_2;
14 
15   CeedInit(argv[1], &ceed);
16 
17   CeedQFunctionCreateInterior(ceed, 1, setup, setup_loc, &qf);
18   CeedQFunctionCreateInterior(ceed, 1, mass, mass_loc, &qf_2);
19   CeedOperatorCreate(ceed, qf, CEED_QFUNCTION_NONE, CEED_QFUNCTION_NONE,
20                      &op);
21   CeedOperatorCreate(ceed, qf_2, CEED_QFUNCTION_NONE, CEED_QFUNCTION_NONE,
22                      &op_2);
23 
24   CeedOperatorReferenceCopy(op, &op_2); // This destroys the previous op_2
25   if (op != op_2)
26     // LCOV_EXCL_START
27     printf("Error copying CeedOperator reference\n");
28   // LCOV_EXCL_STOP
29 
30   CeedQFunctionDestroy(&qf);
31   CeedQFunctionDestroy(&qf_2);
32   CeedOperatorDestroy(&op);
33   CeedOperatorDestroy(&op_2);
34   CeedDestroy(&ceed);
35   return 0;
36 }
37