Skip to content
William Hunter edited this page Oct 1, 2018 · 20 revisions

Introduction

What is ToPy? ToPy is short for topology optimisation (optimization) using Python.

ToPy can solve one of three types of topology optimisation problems:

  1. minimum compliance (same as maximum stiffness),
  2. heat conduction or
  3. mechanism design (synthesis).

A problem is defined (created) by means of a simple text input file, called a TPD file, which stands for ToPy Problem Definition.

ToPy solves the defined problem to obtain a 2D (or 3D, depending on the input file) checker-free black-white (in 2D) or solid-void (in 3D) solution. The result is

  1. an optimally stiff structure for minimum compliance (maximum stiffness) problems,
  2. an optimal distribution of two materials for heat conduction problems and
  3. an optimal distribution of material for efficient mobility.

The 2D results are PNG (or any format that Matplotlib can save) files and the 3D results are legacy VTK files.

There is a tutorial to solve a 2D compliance problem here: Tutorials.

Limitations

  • ToPy only works with regular square (for 2D) and cubic (for 3D) meshes. Your mesh will therefore consist of perfectly square (for 2D) or perfectly cubic (for 3D) elements.
  • No GUI for defining problems (but maybe in the future, if I can come up with a simple way of doing it, actually, if I feel like doing it)
  • No CAD interface (although you can save the 3D files as STL files via ParaView, I'm sure there are other tricks too)

Background

The development was originally done on Linux (32-bit), but ToPy works on Windows (32 and 64-bit¹) and OS X¹ too.

ToPy was part of my master's thesis in mechanical engineering at the University of Stellenbosch, South Africa.

¹Thanks to Nikos Kaminakis for letting me know.

Examples

See Examples for some examples of the input (problem definition) files and their output after it was solved with ToPy.

Downloads

One of two places, you can either download via the releases page, or clone. NOTE: I recommend getting the stable release as the cloned (development) version will likely contain bugs.

Disclaimer (sort of)

I'm not a programmer by profession or training/education, so don't expect to see a coding masterpiece. The code is however well documented, it follows the prescribed Python syntax rules as far as possible, and probably most relevant: it works.