Medusa: coordinate free implementation of meshless methods

C++ library for solving PDEs with an intuitive syntax.

See features »

§ The Medusa Library

Medusa is an open source C++ library for solving partial differential equations (PDEs) using meshless methods. It enables the user to solve problems in complex domains in an intuitive and effective manner. The library is designed to promote readability while retaining the capability to solve problems effectively. Its aim is to provide the tools necessary to translate mathematical formulations of problems to C++ code in a clear and concise manner. The live demo below showcases some of the features.

§ Live demo

Use the canvas area below to see our library in action. By clicking the points on the canvas, you define a polygon domain $\Omega$. The library then automatically discretizes the domain and solves the problem $$ \begin{align*} -\nabla^2 u &= 1 && \text{in } \Omega, \\ u &= 0 && \text{on } \partial \Omega. \end{align*} $$ The values of the numerical solution at computational nodes are plotted over the drawn polygon.

The live demo of Medusa library is available for desktop browsers only.

Your browser does not support the HTML5 canvas tag.

Press Left Click to draw a point. Right Click to close the polygon.

A part of the source file for the above demonstration is shown below. The following lines define the problem in C++ code by directly translating the mathematical formulation above.

for (int i : domain.interior()) {
    -op.lap(i) = 1.0;
for (int i : domain.boundary()) {
    op.value(i) = 0.0;

To see more examples of problem definitions, see the features page. For explanation how the problem in the live demo is solved, see the tutorial.

§ Installation and documentation

Medusa is available for Linux and Mac operating systems and can easily be included in your C++ cmake project as a subdirectory. You can get the latest version of Medusa from our download page. To help you get started, we have written a short tutorial and extensive documentation is provided in the form of a complete API reference and numerous examples on our wiki page.

§ About

Medusa is developed by the Parallel and Distributed Systems Laboratory, Jožef Stefan Institute. More about its development, bugs, contribution guidelines and philosophy can be found on the about page.

One more thing: get in touch. If you're using Medusa, we would like to hear from you. Whether you are simply trying it out or facing issues, please email us at