Skip to content

The weak key cache for ufl to FInAT conversion is too weak #3823

Open
@pbrubeck

Description

@pbrubeck

Suppose I'm building Q_k(hex) = Q_k(quad) x CG_k(interval) on an extruded mesh. Right now I see 2 calls to the FIAT constructor for CG, where I am only expecting a single one.

I suspect that the conversion takes in each factor in the tensor product from left to right. Q_k(quad) gets decomposed into CG_k(int) x CG_k(int) and the cache is used here, but the decomposition of the quad element is not referenced anywhere else in the hexahedral element, thus the cache is erased. For the next factor of the 3D element, CG_k(int), we have to call the constructor again.

I get the desired single call by doing _cache = {} in place of
https://github.com/firedrakeproject/tsfc/blob/b9158b262db6324afda1adbaf7dee3ec637d2686/tsfc/finatinterface.py#L273

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions