.. _diffusion-laplace_1d: diffusion/laplace_1d.py ======================= **Description** Laplace equation in 1D with a variable coefficient. Because the mesh is trivial in 1D, it is generated by :func:`mesh_hook()`, and registered using :class:`UserMeshIO `. Find :math:`t` such that: .. math:: \int_{\Omega} c(x) \tdiff{s}{x} \tdiff{t}{x} = 0 \;, \quad \forall s \;, where the coefficient :math:`c(x) = 0.1 + \sin(2 \pi x)^2` is computed in :func:`get_coef()`. View the results using:: $ ./postproc.py -b -d't,plot_warp_scalar,rel_scaling=1' --wireframe --view=-90,90,1.5,0,0,0 --roll=0 laplace_1d.vtk .. image:: /../gallery/images/diffusion-laplace_1d.png :download:`source code ` .. literalinclude:: /../examples/diffusion/laplace_1d.py