This example solves the weak form of the standard Laplace equation,
using the Galerkin Finite Element method. is a spatially varying scalar field (e.g. potential). and are 'nabla' (divergence operator) and 'laplacian' (laplace operator) respectively and given by,
The generalised Laplace equation,
where is the rank two, positive definite and symmetric conductivity tensor, can be reduced to the standard Laplace equation by setting (identity tensor).
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/laplace_equation mkdir laplace_equation-build cd laplace_equation-build cmake -DOpenCMISSLibs_DIR=/path/to/opencmisslib/install ../laplace_equation make
This will create the example executable "laplace_equation" in ./src/fortran/ directory.
Fortran version:
cd ./src/fortran/ ./laplace_equation
Python version:
cd ./laplace_equation/src/python source /path/to/opencmisslibs/install/.../.../virtualenvironments/oclibs_pyXY_release/bin/activate python laplace_equation.py Note: If the above fails, try the following. cd ./laplace_equation/src/python PYTHONPATH="/path/to/opencmisslibs/install/.../.../Release/opencmiss.iron" python laplace_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 solutions ( and ).
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.