Hello
It’s been a while since I’ve posted a question
Recently, while exploring the legacy DOLFIN code, I came across the MeshCoordinates()
function.
From posts ref1 and ref2, I thought it was a way to express the coordinate position of a declared mesh.
I ran a simple code with my Jupyter notebook,
from dolfin import * # version: 2019.1.0
lx, ly = 1.0, 1.0
elx, ely = 5, 5
msh = RectangleMesh(Point(0, 0), Point(lx, ly), elx, ely, diagonal="crossed")
x0, x1 = MeshCoordinates(msh)
print("x[0]: ", x0)
print("x[1]: ", x1)
the output was
x0: f_3[0]
x1: f_3[1]
The properties for the variables x0
, x1
were as follows,
x0: Indexed(Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 0), VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2)), 3), MultiIndex((FixedIndex(0),)))
x1: Indexed(Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 0), VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2)), 3), MultiIndex((FixedIndex(1),)))
but it was hard to visually figure out what values they represented, hence the posting question.
My questions are:
a) What should I understand about the output of this function?
(MeshCoordinate(msh)
seems to hold a lot of information.)
b) And in dolfinx
, what is the function that does the same thing as MeshCoordinates()
?
(Does this do the same thing as the tabulate_dof_coordinates()
function? )