Skip to main content

A modular approach for topology optimization

Project description

10.5281/zenodo.8138859 anaconda.org/aatmdelissen/pymoto pypi.org/project/pyMOTO

pyMOTO

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 $\frac{\textup{d}f}{\textup{d}f}=1$. Then the modules are executed in reverse order, each applying the chain rule. As example for a Module which maps $x\rightarrow y$, only the following operation needs to be implemented:

$$ \frac{\textup{d}f}{\textup{d}x} = \frac{\textup{d}f}{\textup{d}y}\frac{\textup{d}y}{\textup{d}x}\text{.} $$

In this way, the order of modules can easily be adapted without having to worry about sensitivities, as these are automatically calculated.

Quick start installation

  1. Make sure you have Python running in some kind of virtual environment (e.g. uv, conda, miniconda, venv)
  2. 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
  3. Download one of the examples found in the repository's example folder (here)
  4. 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).

Dependencies

  • 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.

License

pyMOTO is available under te MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymoto-1.5.1.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

pyMOTO-1.5.1-py3-none-any.whl (84.1 kB view details)

Uploaded Python 3

File details

Details for the file pymoto-1.5.1.tar.gz.

File metadata

  • Download URL: pymoto-1.5.1.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pymoto-1.5.1.tar.gz
Algorithm Hash digest
SHA256 a764078d9fe0fdbbe748071e5d38ec7b0d5486f54ed68e531c2cd99f05292400
MD5 a060b6a7d2de127b9925267e759e9a5a
BLAKE2b-256 10f7d2b084859bd8d8343b9d3140cde75a4319520023991f6a9d33169e66208d

See more details on using hashes here.

File details

Details for the file pyMOTO-1.5.1-py3-none-any.whl.

File metadata

  • Download URL: pyMOTO-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 84.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyMOTO-1.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c7386af3a15ccabd4dad8ad1c0965fb58d2e2e7d3f3a2e409179bbb636b0cff
MD5 e4d12f560aaa4e9e11fe951c91c65d3d
BLAKE2b-256 cf8f433f63cb59ea81668da9762ef32bbe84a94db527981a803cb69d874b230d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page