Subject: [Ffc] Tensor contraction bug

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 17 Feb 2010 11:19:53 +0000

I've run into a tensor contraction bug. The jit log contains:

 In member function ‘virtual void
form_96980ae3ebe60648ee99493c681869c0377c12ac_exterior_facet_integral_0_0::tabulate_tensor(double*,
const double* const*, const ufc::cell&, unsigned int) const’:
form_96980ae3ebe60648ee99493c681869c0377c12ac.h:1952: error: ‘detJ’ was
not declared in this scope
error: command 'gcc' failed with exit status 1

It seems to related to linear forms which have only an exterior facet
integral. In the generated code I see:

    . . . .
    const double J_11 = x[2][1] - x[0][1];

    // Compute determinant of Jacobian

    // Compute inverse of Jacobian

    // Get vertices on edge
    static unsigned int edge_vertices[3][2] = {{1, 2}, {0, 2}, {0, 1}};
    . . . .

Which looks like the detJ has been stripped out, despite being used
later in the code.

Garth

---

From: Anders Logg <[email-masked]>
Date: Wed, 17 Feb 2010 12:36:19 +0100

On Wed, Feb 17, 2010 at 11:19:53AM +0000, Garth N. Wells wrote:
> _______________________________________________
> Mailing list: https://launchpad.net/~ffc
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~ffc
> More help   : https://help.launchpad.net/ListHelp

ok. Do you have a simple test that fails?

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 17 Feb 2010 11:44:50 +0000

> ok. Do you have a simple test that fails?

Nope. I'll send you the solver off-line.

Garth

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 17 Feb 2010 13:49:38 +0000

> ok. Do you have a simple test that fails?

Attached is a simple problem that fails.

Garth

BDM = FiniteElement("Brezzi-Douglas-Marini", "triangle", 1)
tau   = TestFunction(BDM)
sigma = TrialFunction(BDM)
U0    = Coefficient(BDM)

L = dot(tau, U0)*ds
#include <dolfin.h>
#include "MixedPoisson.h"

using namespace dolfin;

int main()
{
  // Source term
  class MyFunction : public Expression {};

  // Create mesh and source term
  UnitSquare mesh(32, 32);
  MyFunction f;

  // Define PDE
  MixedPoisson::FunctionSpace V(mesh);
  MixedPoisson::LinearForm L(V);
  L.U0 = f;
}

---

From: Anders Logg <[email-masked]>
Date: Wed, 17 Feb 2010 16:07:18 +0100

> Attached is a simple problem that fails.

Should be fixed now.

--
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 17 Feb 2010 15:08:34 +0000

>> Attached is a simple problem that fails.

Did you push it?

Garth