Skip to content

Using locate_cell() mesh method on vertex of cell #3015

Discussion options

You must be logged in to vote

I thought this worked. And I think it does. But the relevant UFL geometry object is not correctly exported:

from firedrake import *
from ufl.classes import CellEdgeVectors # this object is not exported by UFL

mesh = UnitSquareMesh(2, 2)
cev = CellEdgeVectors(mesh)

expr = sum(outer(cev[i, :], cev[i, :]) for i in range(3))

cell_matrices = interpolate(expr, TensorFunctionSpace(mesh, "DG", 0, shape=(2, 2)))

Gives you what you want I think.

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
11 replies
@jmm1828
Comment options

@jmm1828
Comment options

@wence-
Comment options

@wence-
Comment options

Answer selected by jmm1828
@jmm1828
Comment options

@wence-
Comment options

@jmm1828
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants