duneuro is an open-source C++ software library for solving partial differential equations in neurosciences using mesh bases methods. It is based on the DUNE library and its main features include solving the electroencephalography (EEG) and magnetoencephalography (MEG) forward problem and providing simulations for brain stimulation.

Applications
currently implemented applications are: EEG, MEG, tDCS
Meshes
Tetrahedral and hexahedral meshes are implemented with support for geometry adaption
CG-FEM
the classical continuous Galerkin finite element method with various source models (e.g. Subtraction, St. Venant, Whitney)
DG-FEM
a discontinuous Galerkin finite element method
multi-dimensional
besides 3d simulations, 2d simulations are supported for visualization purposes
scripting
Python and Matlab bindings are provided for a more convenient usage
DUNE
the DUNE library is used for solving partial differential equations

The main library is dual licensed under the GNU Public License version 2 with a special runtime exception, or the Lesser GNU Public License version 3 or any later version of the latter. For specific license information, please see the LICENSE documents in the code repositories.

The current development version can be found on GitLab . We are currently in the process of making duneuro publicly available, which is why you might still face some issues getting duneuro to run. In the future we plan to provide binary versions of the Python and Matlab bindings, but this is currently a work in progress.

In order to download, configure and compile duneuro, you can use the following script and configuration-files

Publications that make use of, or extend the duneuro library:

Python bindings

Python bindings are optional and supported through the additional module duneuro-py. For generating python bindings, we use the pybind11 library ( GitHub ) which is included in duneuro-py as a git submodule.

import duneuro as dp
config = {
  'type' : 'fitted',
  'solver_type' : 'cg',
  'element_type' : 'tetrahedron',
  'volume_conductor' : {
    'grid.filename' : 'path/to/your/grid.msh',
    'tensors.filename' : 'path/to/your/tensors.txt'
  }
}
driver = dp.MEEGDriver3d(config)

Matlab bindings

Matlab bindings are optional and supported through the additional module duneuro-matlab.

config = []
config.type' = 'fitted';
config.solver_type' = 'cg';
config.element_type' = 'tetrahedron';
config.volume_conductor.grid.filename' = 'path/to/your/grid.msh';
config.volume_conductor.tensors.filename' = 'path/to/your/tensors.txt';
driver = duneuro_meeg(config)