Installation
NuSA requires Python 3.10 or newer.
Standard installation
Install the current release from PyPI:
pip install nusa
The default package includes the finite-element models, elements, plotting,
reporting, and meshio for reading triangular mesh files.
The historical nusa[mesh] extra remains accepted as a compatibility
alias, but meshio is installed by default and the extra is no longer
necessary.
Gmsh for mesh generation
Generating meshes from geometry with nusa.mesh.Modeler requires the
external Gmsh executable. Gmsh is not a Python
dependency of NuSA and is not installed by pip install nusa.
After installing Gmsh, verify that the executable is visible to NuSA:
gmsh --version
If that command works, Modeler.generate_mesh() should be able to find the
same executable on PATH.
Windows
Three practical options are:
install Gmsh into the same Python environment with
pip:python -m pip install gmsh gmsh --version
This route was validated with the NuSA 0.4.0 Windows release checks and keeps the Gmsh launcher in the same virtual environment as NuSA;
install a precompiled Gmsh application from the official Gmsh downloads and add its executable directory to
PATH;install the conda-forge package:
conda install -c conda-forge gmsh gmsh --version
Some conda installations expose Gmsh through gmsh.bat or gmsh.cmd.
NuSA detects these Windows launchers and runs them through cmd.exe.
If Gmsh is installed inside a Conda environment, its launcher may depend on
that environment’s Python installation. Activating an unrelated venv can
therefore make gmsh --version fail even though Gmsh is installed. In that
case, use Gmsh from the same Conda environment as NuSA, install a standalone
Gmsh executable, or invoke the Conda environment explicitly (for example,
conda run -n <env> gmsh --version).
macOS
The official Gmsh binaries can be used directly. Homebrew users can install the command-line application with:
brew install gmsh
gmsh --version
Linux
Use the package supplied by your distribution or an official Gmsh binary. On Debian/Ubuntu systems, for example:
sudo apt-get update
sudo apt-get install gmsh
gmsh --version
Google Colab
Colab runs on an Ubuntu-based environment, so Gmsh can be installed in the
notebook runtime with apt. See Google Colab for a complete installation,
solve, mesh-generation, and post-processing walkthrough.
The Gmsh installation is specific to the current Colab runtime and must be repeated when a new runtime is created.
Custom executable location
If Gmsh is installed but is not on PATH, pass its executable explicitly:
nodes, elements = modeler.generate_mesh(
gmsh_executable="/path/to/gmsh"
)
Development version
Install the current develop branch directly from GitHub:
pip install "nusa @ git+https://github.com/JorgeDeLosSantos/nusa.git@develop"
For contributor/development work:
git clone https://github.com/JorgeDeLosSantos/nusa.git
cd nusa
git checkout develop
python -m pip install -e ".[test]"
python -m pytest