This example solves the weak form of the following Poisson equation,
using the Galerkin Finite Element method. is the positive definite and symmetric rank two conductivity tensor and is a function (non-linear in this example) of the dependent variable . The latter is a spatially varying scalar field (e.g. temperature).
The non-linear function or source term is an exponential function of that takes the following form.
Note that the conductivity tensor and parameters in the source term ( , and ) are, in general, functions of the independent variable (spatial coordinates) . Since material in this example is considered to be homogeneous, they remain constant throughout the domain. Furthermore, is set to be (identity tensor). With these simplifications the above governing equation reduces to
Only Dirichlet boundary conditions are prescribed in this example.
The fortran version of the example can be configured and built with CMake:
git clone https://github.com/OpenCMISS-Examples/nonlinear_poisson_equation mkdir nonlinear_poisson_equation-build cd nonlinear_poisson_equation-build cmake -DOpenCMISSLibs_DIR=/path/to/opencmisslib/install ../nonlinear_poisson_equation make
This will create the example executable "nonlinear_poisson_equation" in ./src/fortran/ directory.
Fortran version:
cd ./src/fortran/ ./nonlinear_poisson_equation
Python version:
cd ./nonlinear_poisson_equation/src/python source /path/to/opencmisslibs/install/.../.../virtualenvironments/oclibs_pyXY_release/bin/activate python nonlinear_poisson_equation.py Note: If the above fails, try the following. cd ./nonlinear_poisson_equation/src/python PYTHONPATH="/path/to/opencmisslibs/install/.../.../Release/opencmiss.iron" python nonlinear_poisson_equation.py
Results can be visualised by running visualise.cmgui with the Cmgui visualiser.
The following figure shows the finite element mesh (computational domain) and scalar field, (primary variable) and its derivative, (secondary variable).
Figure 1. (a) Finite element mesh (b) Primary variable solution (c) Secondary variable solution
The expected results from this example are available in expected_results folder.
There are no additional input files required for this example as it is self-contained.
License applicable to this example is described in LICENSE.