/// @file /// Test creation, use, and destruction of a blocked element restriction with multiple components in the lvector, and libCEED owns ind pointer /// \test Test creation, use, and destruction of a blocked element restriction with multiple components in the lvector, and libCEED owns ind pointer #include #include #include #include int main(int argc, char **argv) { Ceed ceed; CeedVector x, y; CeedInt num_elem = 8; CeedInt elem_size = 2; CeedInt num_blk = 2; CeedInt blk_size = 5; CeedInt num_comp = 3; CeedInt ind[elem_size*num_elem]; CeedInt *ceed_ind = malloc(sizeof(CeedInt)*elem_size*num_elem); CeedScalar a[num_comp*(num_elem + 1)]; const CeedScalar *xx, *yy; CeedInt layout[3]; CeedElemRestriction r; CeedInit(argv[1], &ceed); CeedVectorCreate(ceed, num_comp*(num_elem+1), &x); for (CeedInt i=0; i 0 && i < num_elem ? 2.0 : 1.0)) // LCOV_EXCL_START printf("Error in restricted array x[%d][%d] = %f\n", j, i, (double)xx[i+j*(num_elem+1)]); // LCOV_EXCL_STOP } } CeedVectorRestoreArrayRead(x, &xx); CeedVectorDestroy(&x); CeedVectorDestroy(&y); CeedElemRestrictionDestroy(&r); CeedDestroy(&ceed); return 0; }