.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/ex10_poisson-equation.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_ex10_poisson-equation.py: Poisson Equation ---------------- The `Poisson equation `_ with fixed boundaries on the bottom, top, left and right end-edges and a unit load, as given in Eq. :eq:`poisson` and Eq. :eq:`poisson-boundaries`, is solved on a rectangle. .. math:: :label: poisson \text{div}(\boldsymbol{\nabla} u) + f = 0 \quad \text{in} \quad \Omega .. math:: :label: poisson-boundaries u &= 0 \quad \text{on} \quad \Gamma_u f &= 1 \quad \text{in} \quad \Omega The Poisson equation is transformed into integral form representation by the `divergence (Gauss's) theorem `_, see Eq. :eq:`poisson-integral-form`. .. math:: :label: poisson-integral-form \int_\Omega \boldsymbol{\nabla} (\delta u) \cdot \boldsymbol{\nabla} (\Delta u) \ d\Omega = \int_\Omega \delta u \cdot f \ d\Omega .. GENERATED FROM PYTHON SOURCE LINES 31-55 .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/images/sphx_glr_ex10_poisson-equation_001.png :alt: ex10 poisson equation :srcset: /examples/images/sphx_glr_ex10_poisson-equation_001.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/felupe-ja/checkouts/latest/felupe/docs/examples/images/sphx_glr_ex10_poisson-equation_001.vtksz .. tab-set:: .. tab-item:: Static Scene .. image-sg:: /examples/images/sphx_glr_ex10_poisson-equation_002.png :alt: ex10 poisson equation :srcset: /examples/images/sphx_glr_ex10_poisson-equation_002.png :class: sphx-glr-single-img .. tab-item:: Interactive Scene .. offlineviewer:: /home/docs/checkouts/readthedocs.org/user_builds/felupe-ja/checkouts/latest/felupe/docs/examples/images/sphx_glr_ex10_poisson-equation_002.vtksz .. code-block:: Python import felupe as fem mesh = fem.Rectangle(n=2**5).triangulate() region = fem.RegionTriangle(mesh) u = fem.Field(region, dim=1) field = fem.FieldContainer([u]) boundaries = fem.BoundaryDict( bottom=fem.Boundary(u, fy=0), top=fem.Boundary(u, fy=1), left=fem.Boundary(u, fx=0), right=fem.Boundary(u, fx=1), ) boundaries.plot(show_lines=False).show() solid = fem.SolidBody(umat=fem.Laplace(), field=field) load = fem.SolidBodyForce(field=field, values=1.0) step = fem.Step([solid, load], boundaries=boundaries) job = fem.Job([step]).evaluate() view = mesh.view(point_data={"Field": u.values}) view.plot("Field").show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.493 seconds) .. _sphx_glr_download_examples_ex10_poisson-equation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ex10_poisson-equation.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ex10_poisson-equation.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ex10_poisson-equation.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_