forked from williamhunter/topy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fab730f
commit c89d881
Showing
41 changed files
with
183 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# ToPy # | ||
## Topology Optimization using Python ## | ||
 | ||
|
||
# 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# ============================================================================== | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
# Author: William Hunter | ||
# Copyright (C) 2008, 2015, William Hunter. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# ============================================================================= | ||
""" | ||
|
||
|
Oops, something went wrong.