gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Values at quadrature points for derivatives of coefficients are not computed #3

Closed gmarkall closed 13 years ago

gmarkall commented 13 years ago

In UFL, we can have SpatialDerivative(Coefficient( ... ))

At the moment this is not treated correctly. It results in a totally messed up quadrature looop. E.g. from the diffusion RHS:

__shared__ double c_q1[24];
__shared__ double c_q0[6];
for(int i_g = 0; i_g < 6; i_g++)
{
  (c_q0[i_g] = 0.0);
  for(int i_r_0 = 0; i_r_0 < 3; i_r_0++)
  {
    (c_q0[i_g] += c0[i_r_0]);
  };
  for(int i_d_0 = 0; i_d_0 < 2; i_d_0++)
  {
    for(int i_d_1 = 0; i_d_1 < 2; i_d_1++)
    {
      (c_q1[((i_g + (6 * i_d_0)) + (2 * (6 * i_d_1)))] = 0.0);
      for(int i_r_0 = 0; i_r_0 < 3; i_r_0++)
      {
        (c_q1[((i_g + (6 * i_d_0)) + (2 * (6 * i_d_1)))] += c1[((i_d_1 + (2 * i_d_0)) + (2 * (2 * i_r_0)))]);
      };
    };
  };
};

We should be computing the gradient of c0. The loop nest should be completely nested.

gmarkall commented 13 years ago

Upon further inspection, there's nothing wrong with the loop nesting. However, we should still be computing the derivative at the quadrature points, which is currently not being done.

gmarkall commented 13 years ago

Fixed in commit 335eba5d0a342ab0485f.