-------------------------
Project description
-------------------------
This directory contains an implementation of a Mortar element FEM method
for the solving the KNP-EMI model and the EMI model.

-------------------------
Dependencies
-------------------------
To get the environment needed (all dependencies etc.) to run the code, download
the docker container by running:

docker run -t -v ~/repos/zenodo-uploads/knp-emi-v1:/home/fenics -i ceciledc/fenics_mixed_dimensional:05-02-20
or
singularity shell docker://ceciledc/fenics_mixed_dimensional:05-02-20

All meshes are generate automatically in the code where they are used, if they
do not already exist.

-------------------------
Running the code
-------------------------
To run all the numerical experiments, execute

$ python main.py

Each numerical experiments can be run by the run_*.py files, i.e. to run the
method of manufactured solutions test, execute

$ python run_MMM_test.py

-------------------------
Files
-------------------------
main.py:
    Script for running all simulations presented in paper, that is:
    - run_refinement_test.py
    - run_BC_test.py
    - run_test_MMS.py
    - run_2D_axonspy
    - run_3D_axonbundle.py

run_refinement_test.py:
    Run convergence test using refined 2D meshes with one neuron
    - mesh generated by 'make_mesh_refinement_test_meshes.py'

run_BC_test.py:
    Run test to compare solution with different size of the ECS on 2D mesh with
    one neuron
    - mesh generated by 'make_mesh_one_neuron_2d.py'
    and
    - mesh generated by 'make_mesh_one_neuron_extended_ECS_2d.py'

run_MMS_test.py:
    Run method of manufactured solutions (MMS) test on unit square
    - mesh generated by 'make_MMS_mesh.py'

run_2D_axons.py:
    Run simulations to compare the EMI and the KNP-EMI model on mesh with one
    and two intracellular compartment
    - mesh generated by 'make_2d_large_emi_block_mesh.py'
    - mesh generated by 'make_2d_large_emi_double_block_mesh.py'
    - mesh generated by 'make_2d_large_emi_double_block_wide.py'

run_3D_axonbundle.py:
    Run physiological simulation to explore ephaptic coupling in idealized
    3D neuron bundle mesh
    - mesh generated by 'make_3d_axon_mesh.py'

solver.py:
    Contains class for a FEM solver for the KNP-EMI problem

solver_emi.py:
    Contains class for a FEM solver for the EMI problem

utils.py:
    Contains class for setting up exact solutions, boundary terms, source terms
    and initial conditions for the method of manufactured solutions (MMS) test.

make_figures.py:
    Contains functions for plotting the results presented in Ellingsrud et al,
    2019 (https://arxiv.org/abs/1911.03211).
