Hi all,

I've got a domain Omega that splits into two domains Omega_1, Omega_2, and
it'd like to define an expression based on a GenericFunction `b` that lives
in Omega_1.
I went ahead and did something along the lines of

================ *snip* ================
void eval(Array<double>& tau,

          const Array<double>& x,

          const ufc::cell& c

          ) const

{

  Array<double> v(x.size());

  b->eval(v, x, c);
  Cell cell(*mesh, c.index);

  // Define the output scalar based on v and cell.

}
================ *snip* ================

where `mesh` is the submesh on Omega_1.

Then, I'd like to use this expression in the weak form of a PDE that's
defined on the whole Omega. I did

================ *snip* ================
tau = MyExpression(submesh_1, b) # defined by the C++ code above
F = ... dx # something on Omega
F += tau * v * dx(1)
================ *snap* ================

And bang! This fails with

*** Error:   Unable to create mesh entity.
*** Reason:  Mesh entity index 287 out of range [0, 287] for entity of
dimension 2.

I assume it's the cell(*mesh, c.index) in the above code -- is c.index the
index in the Omega-mesh?

This could be fixed by providing the Omega-mesh to MyExpression(), but I'm
not sure if
b->eval(v, x, c);
still does what it's supposed to do then (since b is only defined on
Omega_1).

Any hints here?

--Nico
_______________________________________________
fenics-support mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics-support

Reply via email to