To give some background information, in FEniCS and in Firedrake master, CellSize gives the circumdiameter (twice the circumradius) of the cell.  This is not implemented for quads and extruded meshes in Firedrake (I hope...), since the circumradius isn't defined in general.

In the Firedrake bendy_changes branch, I tentatively changed CellSize to return (abs(JacobianDeterminant))**(1/dim) since this generalises better to non-simplicies, higher-order elements, etc.  However, this is a poor idea since it changes the behaviour of existing [simplex] code that depends sensitively on CellSize giving the cell circumdiameter.

On 1 October 2015 at 21:13, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
So you're using the 'bendy' branch in Firedrake as well?

If so, JacobianDeterminant gets torn apart into components of grad(x) [x = coordinate field] within UFL.

ufl/algorithms/change_to_reference.py:
    @memoized_handler
    def jacobian_determinant(self, o):
        domain = o.domain()
        J = self.jacobian(Jacobian(domain))
        return determinant_expr(J)

where determinant_expr is the obvious thing (use git grep determinant_expr from within a UFL subdirectory if you want to look at this)

Note there's some magic that maps JacobianDeterminant to the handler jacobian_determinant.

I think that pointing CellSize at JacobianDeterminant within Firedrake is something I'll revert in the future, since it's not backwards compatible for simplices (despite generalising well to other shapes).  Will need to find another name, or just let people use the UFL object, like for FacetNormal.


On 1 October 2015 at 21:01, Tuomas Karna <tuomas.karna@gmail.com> wrote:
Hi all,

We're trying to figure out what CellSize actually does.
Does anyone know where JacobianDeterminant gets turn into code?

- Tuomas


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake