.. _diffusion-sinbc:

diffusion/sinbc.py
==================

**Description**


Laplace equation with Dirichlet boundary conditions given by a sine function
and constants.

Find :math:`t` such that:

.. math::
    \int_{\Omega} c \nabla s \cdot \nabla t
    = 0
    \;, \quad \forall s \;.

This example demonstrates how to use a hierarchical basis approximation - it
uses the fifth order Lobatto polynomial space for the solution. The adaptive
linearization is applied in order to save viewable results, see both the
options keyword and the ``post_process()`` function that computes the solution
gradient. Use the following commands to view the results (assuming default
output directory and names)::

  $ ./postproc.py -b -d't,plot_warp_scalar,rel_scaling=1' 2_4_2_refined_t.vtk --wireframe
  $ ./postproc.py -b 2_4_2_refined_grad.vtk

The :class:`sfepy.fem.meshio.UserMeshIO` class is used to refine the original
two-element mesh before the actual solution.


.. image:: /../gallery/images/diffusion-sinbc_grad.png
.. image:: /../gallery/images/diffusion-sinbc_t.png


:download:`source code </../examples/diffusion/sinbc.py>`

.. literalinclude:: /../examples/diffusion/sinbc.py

