Skip to content

Commit

Permalink
Further updates/changes
Browse files Browse the repository at this point in the history
  • Loading branch information
williamhunter committed Sep 18, 2015
1 parent fab730f commit c89d881
Show file tree
Hide file tree
Showing 41 changed files with 183 additions and 274 deletions.
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changes

v0.1.1
---
1. SymPy related: All *_K.py files in data directory, corrected TypeError: 'Symbol' object is not iterable

v0.1.2
---
1. Moved ToPy from Google Code to GitHub.
1. Updated files, moved a few things around, renamed/deleted a few, etc. No changes to the core.
3 changes: 0 additions & 3 deletions CHANGES.txt

This file was deleted.

20 changes: 20 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Prerequisites

1. Start by installig Python 2.7 (32-bit works fine), download from the official site.
2. Windows only: Make sure Python is in your Path Environment Variable.
1. If you don't know how to add it, please search the web.
2. Check if Python works by typing it into a *cmd* shell.
3. Check if 'pip' works, also by typing it into a *cmd* shell. If it doesn't work, add Python27\Scripts to the Environement Variables too.
4. When using 'pip', run 'cmd' as Administrator.
5. Install NumPy+MKL for Python 2.7 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
5. Install PySparse, also from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
6. Install PyVTK, also from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
7. Install matplotlib via `pip`
8. Install SymPy via `pip`

If everything installed correctly, you're set.

# Installing ToPy
In a shell ('cmd' window on Windows), type:

python setup.py install
File renamed without changes.
10 changes: 0 additions & 10 deletions PKG-INFO

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# ToPy #
## Topology Optimization using Python ##
![ToPy Logo](/images/topy_logo3d.png)

# ToPy
## Topology Optimization using Python

Exported from Google Code. Please see the wiki branch for now (_not much there_); I'll upload everything in due course when I have a bit more time (I have a 'real' job).

## Plans (not cast in stone, not necessarily in this order) ##
## Plans (not cast in stone, not necessarily in this order)
1. Upload all the code, and update my contact details.
2. Create a wiki page for the installation, currently a PDF.
2. Show how to define a problem via Gmsh, or at least with the help of Gmsh. I'm not sure this is even going to be possible, and I need to get up to speed with Gmsh...
3. Create a simple Tkinter (no, I'm *not* going to use the amazing Qt lib, it's yet another set of dependencies and things I need to think about) interface (GUI) to define simple problems instead of typing it out in a text editor. The idea is that you specify the type of problem and dimension (2D or 3D) and ToPy creates a Gmsh msh file for you. You can then easily view the node and element numbers (in Gmsh) which will make defining ToPy problems much easier. You then use the same Tkinter GUI to specify restraints and regions, regenerate the msh file and reload it in Gmsh. Once you're happy, ToPy creates a tpd file and solves.
4. Use Gmsh instead of Paraview to view results, can use Gmsh's timestep ability visualise how the domain changes (I think?).

```
William Hunter
```
William Hunter

13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
# ==============================================================================
# ToPy -- Topology optimization with Python.
# Copyright (C) 2012, 2015, William Hunter.
# ==============================================================================
"""

from core.topology import *
from core.visualisation import *
from core.elements import *

__version__ = "0.1.2"
__author__ = "William Hunter <whunter.za at gmail dot com>"
8 changes: 3 additions & 5 deletions core/data/H18B_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/H8T_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/H8_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/H8bar_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/Q4T_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/Q4_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/Q4bar_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/Q5B_K.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# =============================================================================
# Write the stiffness matrix of finite element to file. The created file name
# is equal to the string between the underscores of *this* file's name, plus a
Expand All @@ -8,10 +8,8 @@
#
# gives a file named ELEM.K in the same directory.
#
# Author: William Hunter <[email protected]>
# Date: 14-01-2008
# Last change: 03-04-2012 (corrected TypeError: 'Symbol' object is not iterable)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/data/matlcons.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""
"""
# ==============================================================================
# Material constants and finite element dimensions.
#
# Author: William Hunter <[email protected]>
# Date: 01-06-2007
# Last change: 18-11-2008
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# ==============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/elements.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"""
"""
# =============================================================================
# Finite element stiffness matrices.
#
# To define your own finite elements, see Python scripts in 'data' directory.
#
# Author: William Hunter <[email protected]>
# Date: 01-06-2007
# Last change: 15-12-2008 (spell check)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
4 changes: 4 additions & 0 deletions core/mesher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
"""
8 changes: 3 additions & 5 deletions core/parser.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""
"""
# =============================================================================
# Parse a ToPy problem definition (TPD) file to a Python dictionary.
#
# Author: William Hunter <[email protected]>
# Date: 01-06-2007
# Last change: 15-12-2008 (spell check)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/topology.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""
"""
# =============================================================================
# A class to optimise the topology of a design domain for defined boundary
# conditions. Data is read from an input file, see 'examples' directory.
#
# Author: William Hunter <[email protected]>
# Date: 01-06-2007
# Last change: 15-12-2008 (spell check)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
8 changes: 3 additions & 5 deletions core/visualisation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"""
"""
# =============================================================================
# Functions in order to visualise 2D and 3D NumPy arrays.
#
# Author: William Hunter <[email protected]>
# Date: 01-06-2007
# Last change: 15-12-2008 (spell check)
# Copyright (C) 2008, William Hunter.
# Author: William Hunter
# Copyright (C) 2008, 2015, William Hunter.
# =============================================================================
"""

Expand Down
Loading

0 comments on commit c89d881

Please sign in to comment.