This example demonstrates:
In [1]:
from dolfin import *
import numpy.linalg
mesh = SphericalShellMesh(mpi_comm_world(), 1)
for i in range(3):
mesh = refine(mesh)
for x in mesh.coordinates():
x /= numpy.linalg.norm(x)
Q = FunctionSpace(mesh, "DG", 0)
F = interpolate(Expression("x[0]*x[1]", degree=1), Q)
from IPython.display import HTML
xp = X3DOMParameters()
xp.set_color_map("gist_rainbow")
HTML(X3DOM.html(F, xp))
Out[1]:
In [ ]: