/// @file /// Test integration with a 2D Simplex non-tensor H1 basis /// \test Test integration with a 2D Simplex non-tensor H1 basis #include #include #include "t320-basis.h" CeedScalar feval(CeedScalar x1, CeedScalar x2) { return x1*x1 + x2*x2 + x1*x2 + 1; } int main(int argc, char **argv) { Ceed ceed; CeedVector In, Out, Weights; const CeedInt P = 6, Q = 4, dim = 2; CeedBasis b; CeedScalar q_ref[dim*Q], q_weight[Q]; CeedScalar interp[P*Q], grad[dim*P*Q]; CeedScalar xr[] = {0., 0.5, 1., 0., 0.5, 0., 0., 0., 0., 0.5, 0.5, 1.}; const CeedScalar *out, *weights; CeedScalar in[P], sum; buildmats(q_ref, q_weight, interp, grad); CeedInit(argv[1], &ceed); CeedBasisCreateH1(ceed, CEED_TOPOLOGY_TRIANGLE, 1, P, Q, interp, grad, q_ref, q_weight, &b); // Interpolate function to quadrature points for (int i=0; i 100.*CEED_EPSILON) // LCOV_EXCL_START printf("%f != %f\n", sum, 17./24.); // LCOV_EXCL_STOP CeedVectorRestoreArrayRead(Out, &out); CeedVectorRestoreArrayRead(Weights, &weights); CeedVectorDestroy(&In); CeedVectorDestroy(&Out); CeedVectorDestroy(&Weights); CeedBasisDestroy(&b); CeedDestroy(&ceed); return 0; }