SciML / FEniCS.jl

A scientific machine learning (SciML) wrapper for the FEniCS Finite Element library in the Julia programming language
https://docs.sciml.ai/FEniCS/stable/
Other
96 stars 25 forks source link

Change representation of FEniCS objects from str to repr #77

Closed CFBaptista closed 4 years ago

CFBaptista commented 4 years ago

I noticed that some (as of yet unwrapped) FEniCS objects in Julia were showing up differently than in Python.

Julia:

> using FEniCS
> mesh = UnitSquareMesh(8, 8)
> Expression(FEniCS.fenics.CellDiameter(mesh.pyobject))
"diameter"

Python:

> from fenics import *
> mesh = UnitSquareMesh(8, 8)
> CellDiameter(mesh)
CellDiameter(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 0))

This is due to:

show(io::IO, obj::fenicsobject) = show(io, str(obj))

which can be fixed by changing it in to:

show(io::IO, obj::fenicsobject) = show(io, repr(obj))