Installation Guide
Warning
OpenCMP is primarily tested on Linux (Ubuntu 20.04-21.01) and MacOS. The main functionality should work on Windows but users may have issues exporting results to .vtu.
Warning
NGSolve support for the Anaconda Python Distribution is currently experimental, please do not use NGSolve installed in this way with OpenCMP until further notice.
NOTE
Top-level directory refers to the highest level directory of OpenCMP. I.e., /users/…/opencmp.
Installing OpenCMP
Clone the GitHub repository.
Install
pip3
:Install the
opencmp
module from the top-level directory:pip3 install .
Install with optional dependencies here.
Optionally, run all the unit tests using
pytesting
from the top-level directory. Note,In order to run the tests, all optional dependencies must be installed.
For full information about running the tests see the README.md inside the pytests folder.
Go through the tutorials and other examples found in the “examples/” folder.
Custom Commands for OpenCMP
Using OpenCMP
opencmp
can be run usingopencmp config
instead ofpython3 -m opencmp config
, whereconfig
is the name of the configuration file.
Running OpenCMP Unit Tests
pytesting
from the top-level directory runs all the pytests. All optional dependencies must be installed.
Dependencies
Required
Python 3.7+
Optional
edt
- Needed for the Diffuse Interface Method.tabulate
- Needed to output results for mesh refinement and polynomial order convergence tests.pytest
- Needed for the unit tests.pytest-xdist
- requirespytest
. Can distribute tests across multiple CPUs to speed up test execution.
Command (from top-level directory) |
Dependencies Installed |
---|---|
|
|
|
|
|
|
|
|
|
|
To install
opencmp
with more than one dependency argument:pip3 install .[x,y]
Supplementary Information
WSL (Windows Subsystem for Linux)
WSL is the recommended platform for native Windows users to use OpenCMP.
To install WSL, go to the Microsoft Store. Install Ubuntu 20.04 LTS.
Python 3.7+ should come pre-installed. To check this, execute
python3 --version
.
Setting up WSL for OpenCMP
To be able to use the custom commands for OpenCMP, please perform the following.
In WSL, execute
nano ~/.bashrc
At the bottom of the file append the line
export PATH="/home/user/.local/bin:$PATH"
whereuser
is the username of your WSL unix profile.Press
CTRL+S
thenCTRL+X
. Exit WSL and restart the application.
ngsolve
, a required dependency for OpenCMP, has a graphics issue for WSL. To correct this, install a windows manager viasudo apt install ubuntu-desktop
Installing an X Server on WSL
WSL does not come with GUI (graphical user interface) application support (shortformed an “X server”). To view output plots or any graphical interface, perform the following.
Change display variables in WSL.
Execute
nano ~/.bashrc
. At the bottom of the page, appendexport DISPLAY=$(ip route list default | awk '{print $3}'):0
andexport LIBGL_ALWAYS_INDIRECT=1
(on separate lines).Press
CTRL+S
thenCTRL+X
. Exit WSL and restart the application.
Enable Public Access on your X11 server for Windows. Follow the tutorial here. Be sure to only follow the section “Allow WSL Access via Windows Firewall”.
Download VcXsrv. Navigate to
C:\Program Files\VcXsrv
and openxlaunch.exe
.Click Next until “Extra Settings” page. Check the box for “Disable Access Control”.
Save the configuration file somewhere useful. Ensure that you run the
config.xlaunch
file before executing code with any graphical output.