> Next I would like to assemble a n by n covariance matrix A,
>
> for (int i = 0; i < n; ++i)
> for (int j = 0; j < n; ++j)
> {
> A[i][j] = f(D[i], D[j]); // f is some function depending on two points
> }
I see. So for this, you need the support points of all degrees of freedom
(which you denote by D[i] above). You can get those by calling
DoFTools::map_dofs_to_support_points().
> I would also like to associate the vector $y$ with the quadrature points since
> I would like to use them later, e.g.,
> [...]
The key here is that you need an index of the sort
quadrature_point(q_index).global_index()
in your code snippet. Such a function doesn't exist -- we don't usually
consider a global numbering of quadrature points, we only ever number them on
each cell.
But you can compute something like this:
const unsigned int global_q_index
= cell->active_cell_index() * n_q_points + q_index;
This just enumerates them one cell after the other. Your 'y' vector then must
have size
triangulation.n_active_cells() * quadrature.size();