All Projects → williamhunter → Topy

williamhunter / Topy

Licence: other
Topology Optimization using Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Topy

simsopt
Simons Stellarator Optimizer Code
Stars: ✭ 28 (-89.93%)
Mutual labels:  optimization
OptimalTransport.jl
Optimal transport algorithms for Julia
Stars: ✭ 64 (-76.98%)
Mutual labels:  optimization
Stringsareevil
Reducing memory allocations from 7.5GB to 32KB
Stars: ✭ 260 (-6.47%)
Mutual labels:  optimization
topology
General topology in Coq [maintainers=@amiloradovsky,@Columbus240,@stop-cran]
Stars: ✭ 36 (-87.05%)
Mutual labels:  topology
RBP
Recurrent Back Propagation, Back Propagation Through Optimization, ICML 2018
Stars: ✭ 35 (-87.41%)
Mutual labels:  optimization
ForBES
Generic and efficient MATLAB solver for nonsmooth optimization problems
Stars: ✭ 19 (-93.17%)
Mutual labels:  optimization
NCVX
NCVX: A User-Friendly and Scalable Package for Nonconvex Optimization in Machine Learning
Stars: ✭ 19 (-93.17%)
Mutual labels:  optimization
Scikit Tda
Topological Data Analysis for Python🐍
Stars: ✭ 268 (-3.6%)
Mutual labels:  topology
scipydirect
Python wrapper to the DIRECT global optimization algorithm with scipy.optimize compatible call syntax
Stars: ✭ 26 (-90.65%)
Mutual labels:  optimization
Dgtal
Digital Geometry Tools and Algorithm Library
Stars: ✭ 259 (-6.83%)
Mutual labels:  topology
PEPit
PEPit is a package enabling computer-assisted worst-case analyses of first-order optimization methods.
Stars: ✭ 41 (-85.25%)
Mutual labels:  optimization
MeshCore.jl
Curation and manipulation of general unstructured meshes for the Finite Element Methods (FEM).
Stars: ✭ 14 (-94.96%)
Mutual labels:  topology
Persistence
A topological data analysis library for Haskell
Stars: ✭ 26 (-90.65%)
Mutual labels:  topology
least-squares-cpp
A single header-only C++ library for least squares fitting.
Stars: ✭ 46 (-83.45%)
Mutual labels:  optimization
Deeplearning.ai Notes
These are my notes which I prepared during deep learning specialization taught by AI guru Andrew NG. I have used diagrams and code snippets from the code whenever needed but following The Honor Code.
Stars: ✭ 262 (-5.76%)
Mutual labels:  optimization
OpenJij
OpenJij : Framework for the Ising model and QUBO.
Stars: ✭ 57 (-79.5%)
Mutual labels:  optimization
pmap
Process Map Visualization of event analysis in R
Stars: ✭ 19 (-93.17%)
Mutual labels:  optimization
Mather
zzllrr mather(an offline tool for Math learning, education and research)小乐数学,离线可用的数学学习(自学或教学)、研究辅助工具。计划覆盖数学全部学科的解题、作图、演示、探索工具箱。目前是演示Demo版(抛转引玉),但已经支持数学公式编辑显示,部分作图功能,部分学科,如线性代数、离散数学的部分解题功能。最终目标是推动专业数学家、编程专家、教育工作者、科普工作者共同打造出更加专业级的Mather数学工具
Stars: ✭ 270 (-2.88%)
Mutual labels:  topology
Imager
Automated image compression for efficiently distributing images on the web.
Stars: ✭ 266 (-4.32%)
Mutual labels:  optimization
Ccodashboard
Welcome to the Continuous Cloud Optimization Power BI Dashboard GitHub Project. In this repository you will find all the guidance and files needed to deploy the Dashboard in your environment to take benefit of a single pane of glass to get insights about your Azure resources and services.
Stars: ✭ 256 (-7.91%)
Mutual labels:  optimization

pytest

ToPy

ToPy is a lightweight topology optimization framework for Python that can solve compliance (stiffness), mechanism synthesis and heat conduction problems in 2D and 3D. Please refer to the ToPy Wiki for further information.

Example of a ToPy result

An example TPD file and solution/result

Installation

NOTE: I've added a 0.4.1 release, which is older then the master branch, but will get you up and running with Python 2 and Pysparse if you're willing to use the Anaconda Python distribution

Once you've downloaded the dependencies (see the INSTALL file) all you need to do is the following:

Download the latest stable release from here: https://github.com/williamhunter/topy/releases/latest

Then do

$ cd topy/topy
$ python setup.py install

ToPy and Python 3

ToPy is fairly old. I started working on it in 2005 and finished it around 2009, so that implies that the stable release only works with Python 2. You can however pull the latest "unstable" version, which should work with Python 3 (thanks to the efforts of other people).

Getting started

The main class of ToPy is 'Topology'. It defines the main constraints, grid and parameters of optimization -- but you don't really have to bother yourself with this if you just want to get some results.

There are two ways of defining a problem

  1. TPD file: You define the problem with keywords (see Help) in a simple text file and solve via the command line. The text file must have the extension .tpd
  2. Config dictionary: This is similar to the TPD file approach, however, you define the problem directly in a Python file; it's very useful if you want to experiment and don't want to keep making changes to a text file. You can later save the Config keywords to a TPD file.

TPD (ToPy Problem Definition) file

There is a minimal set of parameters which is required for successful definition of a ToPy problem:

PROB_TYPE  : comp
PROB_NAME  : mbb_beam_minimal
ETA        : 0.5
DOF_PN     : 2
VOL_FRAC   : 0.5
FILT_RAD   : 1.5
P_FAC      : 3
ELEM_K     : Q4
NUM_ELEM_X : 60
NUM_ELEM_Y : 20
NUM_ELEM_Z : 0
NUM_ITER   : 10
FXTR_NODE_X: 1|21
FXTR_NODE_Y: 1281
LOAD_NODE_Y: 1
LOAD_VALU_Y: -1

You can read more about successful problem definition here.

When the TPD file is defined, then the rest is simple:

from topy import Topology

topology = Topology()
topology.load_tpd_file('file.tpd')

Config dictionary

First you have to define a config dictionary (note the similarity with a TPD file, especially the keywords):

config = {
     'DOF_PN': 2,
     'ELEM_K': 'Q4',
     'ETA': '0.5',
     'FILT_RAD': 1.5,
     'FXTR_NODE_X': range(1, 22),
     'FXTR_NODE_Y': 1281,
     'LOAD_NODE_Y': 1,
     'LOAD_VALU_Y': -1,
     'NUM_ELEM_X': 60,
     'NUM_ELEM_Y': 20,
     'NUM_ELEM_Z': 0,
     'NUM_ITER': 94,
     'PROB_NAME': 'beam_2d_reci',
     'PROB_TYPE': 'comp',
     'P_FAC': 3.0,
     'VOL_FRAC': 0.5
}

The requirements are the same as for the TPD file.

topology = Topology(config=config)

Optimization (solving the problem)

You can use the command line solution:

$ python topy/scripts/optimise.py <filename>.tpd

Or you can use a Python script:

import topy

config = {...}
t = topy.Topology(config)
t.set_top_params()
topy.optimise(t)

Visualization (seeing the result)

Module topy.visualization allows one to save the output as a .png image for 2D problems or as a .vtk file for 3D. The VTK files can be viewed with Mayavi or ParaView. You can animate the PNG images with the convert tool.

convert -delay 35 *.png anim.gif

Tutorials

Tutorials

How to cite ToPy

If you've used ToPy in your research work or find it useful in any way, please consider to cite:

@misc{Hunter2007william,
  author = {Hunter, William and others},
  title = {ToPy - Topology optimization with Python},
  year = {2017},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/williamhunter/topy}},
  }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].