static char help[] = "Element closure restrictions in tensor/lexicographic/spectral-element ordering using DMPlex\n\n"; #include static PetscErrorCode ViewOffsets(DM dm, Vec X) { PetscInt num_elem, elem_size, num_comp, num_dof; PetscInt *elem_restr_offsets; const PetscScalar *x = NULL; const char *name; PetscFunctionBegin; PetscCall(PetscObjectGetName((PetscObject)dm, &name)); PetscCall(DMPlexGetLocalOffsets(dm, NULL, 0, 0, 0, &num_elem, &elem_size, &num_comp, &num_dof, &elem_restr_offsets)); PetscCall(PetscPrintf(PETSC_COMM_SELF,"DM %s offsets: num_elem %" PetscInt_FMT ", size %" PetscInt_FMT ", comp %" PetscInt_FMT ", dof %" PetscInt_FMT "\n",name, num_elem, elem_size, num_comp, num_dof)); if (X) PetscCall(VecGetArrayRead(X, &x)); for (PetscInt c=0; c