xref: /libCEED/tests/t508-operator.c (revision 356036fa84f714fa73ef64c9a80ce2028dde816f)
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 <math.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 
9 #include "t500-operator.h"
10 
11 int main(int argc, char **argv) {
12   Ceed          ceed;
13   CeedQFunction qf, qf_2;
14   CeedOperator  op, op_2;
15 
16   CeedInit(argv[1], &ceed);
17 
18   CeedQFunctionCreateInterior(ceed, 1, setup, setup_loc, &qf);
19   CeedQFunctionCreateInterior(ceed, 1, mass, mass_loc, &qf_2);
20   CeedOperatorCreate(ceed, qf, CEED_QFUNCTION_NONE, CEED_QFUNCTION_NONE, &op);
21   CeedOperatorCreate(ceed, qf_2, CEED_QFUNCTION_NONE, CEED_QFUNCTION_NONE, &op_2);
22 
23   CeedOperatorReferenceCopy(op, &op_2);  // This destroys the previous op_2
24   if (op != op_2) printf("Error copying CeedOperator reference\n");
25 
26   CeedQFunctionDestroy(&qf);
27   CeedQFunctionDestroy(&qf_2);
28   CeedOperatorDestroy(&op);
29   CeedOperatorDestroy(&op_2);
30   CeedDestroy(&ceed);
31   return 0;
32 }
33