/// @file /// Test creation, evaluation, and destruction for qfunction /// \test Test creation, evaluation, and destruction for qfunction #include #include #include "t401-qfunction.h" int main(int argc, char **argv) { Ceed ceed; CeedVector in[16], out[16]; CeedVector Qdata, W, U, V; CeedQFunction qf_setup, qf_mass; CeedInt Q = 8; const CeedScalar *vv; CeedScalar w[Q], u[Q], v[Q], ctx[5] = {1, 2, 3, 4, 5}; CeedInit(argv[1], &ceed); CeedQFunctionCreateInterior(ceed, 1, setup, setup_loc, &qf_setup); CeedQFunctionAddInput(qf_setup, "w", 1, CEED_EVAL_INTERP); CeedQFunctionAddOutput(qf_setup, "qdata", 1, CEED_EVAL_INTERP); CeedQFunctionCreateInterior(ceed, 1, mass, mass_loc, &qf_mass); CeedQFunctionAddInput(qf_mass, "qdata", 1, CEED_EVAL_INTERP); CeedQFunctionAddInput(qf_mass, "u", 1, CEED_EVAL_INTERP); CeedQFunctionAddOutput(qf_mass, "v", 1, CEED_EVAL_INTERP); CeedQFunctionSetContext(qf_mass, &ctx, sizeof(ctx)); for (CeedInt i=0; i 1.e-14) // LCOV_EXCL_START printf("[%d] v %f != vv %f\n",i, v[i], vv[i]); // LCOV_EXCL_STOP CeedVectorRestoreArrayRead(V, &vv); CeedVectorDestroy(&W); CeedVectorDestroy(&U); CeedVectorDestroy(&V); CeedVectorDestroy(&Qdata); CeedQFunctionDestroy(&qf_setup); CeedQFunctionDestroy(&qf_mass); CeedDestroy(&ceed); return 0; }