Get gradients at the flux points

Hi,

I am using _compute_basegrads_graph to calculate the gradient of solution to be used in the simulation. And furthermore, I also want to get gradient at the flux points. So I simply add the following expressions in the graph:

        # Above are the same as the compute_grads_graph in baseadvecdiff/system.py
        # To calculate interpolated gradient at flux points
        g3 = self.backend.graph()

        # Interpolate these gradients to the flux points
        for l in k['eles/gradcoru_fpts']:
            g3.add(l, deps=deps(l,  'eles/gradcoru_u'))
        g3.commit()

        return g1, g2, g3

But it kept complaining about the KeyError as in:

  File "/scratch/zhenyang/software/Anaconda/anaconda/envs/pyfr_linsolver/lib/python3.10/site-packages/pyfr/solvers/baselinadvecdiff/system.py", line 64, in _compute_basegrads_graph
    g3.add(l, deps=deps(l,  'eles/gradcoru_u'))
  File "/scratch/zhenyang/software/Anaconda/anaconda/envs/pyfr_linsolver/lib/python3.10/site-packages/pyfr/backends/base/types.py", line 337, in add
    rdeps = [self.knodes[d] for d in adeps]
  File "/scratch/zhenyang/software/Anaconda/anaconda/envs/pyfr_linsolver/lib/python3.10/site-packages/pyfr/backends/base/types.py", line 337, in <listcomp>
    rdeps = [self.knodes[d] for d in adeps]
KeyError: <pyfr.backends.openmp.provider.OpenMPUnorderedMetaKernel object at 0x14b0829e9480>

Could you spot the problem with the implementation? Thanks in advance.

Regards,
Zhenyang

The problem is the dependency deps=deps(l, 'eles/gradcoru_u'). No kernel eles/gradcoru_u has ever been added to the graph g3 hence the key error when PyFR attempts to look up what it refers to.

Regards, Freddie.