Getting NekMesh

Below is a set of instructions for installation and build of NekMesh on your computer. We support Linux, macOS and Windows.

NekMesh is built on and ships with the Nektar++ spectral element framework. However, for those interested only in NekMesh and not the wider Nektar++ framework, on this site we provide a number of smaller, NekMesh-only source and binary packages.

The easiest way for you to start using NekMesh is through Docker Images or Virtual Boxes, where we would have already setup the environments with all dependencies installed. If you’re running Docker, you can grab a complete version of NekMesh from Dockerhub:

docker pull nektarpp/nekmesh

The more advanced way, but also giving you more capabilities is by using one of our packages for Linux or macOS.

macOS

NekMesh is available directly on MacPorts as part of the nektarpp package. To install, use the command

sudo port install nektarpp

Homebrew users can use the nektar-homebrew tap:

brew tap mdave/nektar
brew install nektar

Linux

Packages are available for popular LTS versions of Linux distributions: specifically, Debian, Ubuntu and Fedora. Installations on how to add these repositories can be found on the Nektar++ website. Then to install, on Debian/Ubuntu run

sudo apt install nekmesh

or on Fedora,

sudo dnf install nekmesh

By building NekMesh from source you ensure to have our most recent capabilities, bug fixes and extensions with third-party libraries. The NekMesh source can be checked out from our git repository:

git clone https://gitlab.nektar.info/nektar/nektar.git

Depending on your experience with building open-source software, this might be straight-forward or take some time. Here we provide a short recommendation on the steps and flags that you should turn on during the compilation process, to get most functionality from NekMesh.

1. Install Dependencies

First, install the required dependencies:

On Linux (Ubuntu/Debian):
sudo apt install cmake libboost-all-dev libtinyxml-dev build-essential vtk
On macOS (using Homebrew):
brew install cmake boost tinyxml vtk 

2. Configure Build

Create a build directory and configure with CMake:

mkdir build && cd build && ccmake ..

There are several important CMake variables which are binary ON or OFF options which control functionality. The most important distinction

CMake option Description Additional packages
NEKTAR_UTILITY_MESHGEN Activates most NekMesh modules. None
NEKTAR_UTILITY_FIELDCONVERT Builds the post-processing FieldConvert executable, used for e.g. producing VTK files of meshes. None
NEKTAR_USE_MESHGEN Enables CAD-based modules, i.e. to generate meshes directly from STEP input. OpenCASCADE
NEKTAR_USE_CCM Activates Star-CCM+ input module libccmio
NEKTAR_USE_CGNS Activates the CGNS input module (for reading CGNS files) CGNS
NEKTAR_USE_VTK Enables VTK library for post-processing VTK
NEKTAR_USE_HDF5 Enables HDF5 mesh formats to be written. HDF5

3. Build and install

Now compile and install NekMesh on e.g. 4 processors with

make -j4 && make install

After installation, you can verify that the unit and functional tests are pass via ctest. Finally, you should be ready to use NekMesh, which by default is installed in the location

build/dist/bin/NekMesh

For usability, you can either elect to install CMake to a known location in your PATH such as /usr/local using CMake:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make install

or alternatively, add the current build/dist/bin directory to your PATH variable directly and persist this change in your .profile by running

export PATH=$(pwd)/dist/bin:$PATH >> ~/.profile

To check NekMesh is installed you can check whether the full list of input, output and processing modules is available with

NekMesh -l