Modular topology optimization framework with semi-automatic derivatives. The two main types Module
and Signal
are used to implement a problem formulation to be optimized. The Module
implements functionality (and design
sensitivity calculations) and Signal
carries data of both the variables and their derivatives.
Sensitivity calculations are done based on backpropagation. The final value of interest is seeded with sensitivity
value Module
which maps
In this way, the order of modules can easily be adapted without having to worry about sensitivities, as these are automatically calculated.
- Make sure you have Python running in some kind of virtual environment (e.g. uv, conda, miniconda, venv)
- Install the pymoto Python package (and its dependencies)
- Option A (conda): If you are working with Conda, install by
conda install -c aatmdelissen pymoto
- Option B (pip): Type
pip install pymoto
into your console to install
- Option A (conda): If you are working with Conda, install by
- Download one of the examples found in the repository's example folder (here)
- Run the example by typing
python ex_....py
in the console
For development, a local installation of pyMOTO
can be done by first downloading/cloning the entire git repo, and then calling
pip install -e .
in the pyMOTO
folder (of course from within your virtual environment).
- numpy - Dense linear algebra and solvers
- scipy - Sparse linear algebra and solvers
- sympy - Symbolic differentiation for
MathGeneral
module - Matplotlib - Plotting and visualisation
- (optional) opt_einsum - Optimized function for
EinSum
module
For fast linear solvers for sparse matrices:
- (optional) pypardiso - Uses the Intel OneAPI PARDISO solver (recommended)
- (optional) scikit-umfpack - Fast LU linear solver based on UMFPACK
- (optional) scikit-sparse - Fast Cholesky solver based on CHOLMOD
- (optional) cvxopt - Another fast Cholesky solver based on CHOLMOD
Note on linear solvers for sparse matrices: Scipy implements a version of LU which is quite slow. To increase the
speed of the optimization, pypardiso
is recommended as it contains a very robust and flexible solver for symmetric
and asymmetric matrices. An alternative is scikit-umfpack
which provides a fast LU factorization. For symmetric
matrices a Cholesky factorization is recommended (not provided with Scipy), which can be used by either installing
scikit-sparse
or cvxopt
.
pyMOTO is available under te MIT License.