1. Installation#

The dualcellspaces package is an add-on to the high-order finite element library NGSolve. Thus the main premise is that a sufficiently recent version of NGSolve is installed beforehand.

1.1. Get NGSolve#

The most simple way to install the NGSolve is to use pip (the python package installer):

python -m pip install numpy scipy matplotlib jupyter ipyparallel scikit-build
python -m pip install --upgrade ngsolve webgui_jupyter_widgets

For troubleshooting we refer to the various NGSolve installation tutorials NGS24 or the NGSolve Documentation.

If you do not want to update or modify your NGSolve installation you might want to consider installing NGSolve and the dualcellspaces add on in a virtual environment.

1.2. Install the Dual Cell Method add-on#

As the Dual Cell Method is not available in the core code of NGSolve the dualcellspaces add-on has to be installed.

Using pip#

The most simple way to install the add on is again to use pip via

if you have installed NGSolve via pip or binaries

pip install git+https://github.com/NGSolve/dcm.git

if your NGSolve was built from sources or you have a dev version (e.g., installed via pip install --pre ngsolve)

python -m pip install scikit-build-core pybind11_stubgen 
python -m pip install --no-build-isolation git+https://github.com/NGSolve/dcm.git

Working with the code#

If you also want to have the sources of the dualcellspaces module available you may clone them using

git clone https://github.com/NGSolve/dcm.git

Installation can be done either again using pip or building using CMake

python -m pip install scikit-build-core pybind11_stubgen 
cd dcm
python -m pip install --no-build-isolation .
python -m pip install pybind11_stubgen 
cd dcm
mkdir build
cd build
cmake ..
make -j4 install

Test the dualcellspaces installation#

Test whether the installation worked using

python -m dualcellspaces.demos.dc_intrules
python -m dualcellspaces.demos.test_spaces