Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest committed Jan 15, 2019
2 parents 0aa504d + 1e063c3 commit 0666607
Show file tree
Hide file tree
Showing 23 changed files with 1,119 additions and 52 deletions.
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -24,9 +24,9 @@
author = 'Rory Conlin, Paul Kaneelil, Cristian Lacey, Susan Redmond, Dan Shaw, Amlan Sinha'

# The short X.Y version
version = '0.1'
version = '1.0.2'
# The full version, including alpha/beta/rc tags
release = 'beta'
release = 'Release Version'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -278,7 +278,7 @@
\begin{figure}[!h]
\centering
\includegraphics[scale=0.3]{logo.jpg}
\includegraphics[scale=0.3]{images/logo.jpg}
\end{figure}
\vspace*{10mm}
Expand Down
33 changes: 24 additions & 9 deletions docs/config_file_format.rst
Expand Up @@ -51,19 +51,17 @@ General Parameters
==================
:code:`[general]` contains the following parameters:

:user_spec_nodes: **(nx3 numpy array of floats)** User-specified nodes (nodes with provided loads and displacement boundary conditions) in the format :code:`'[[x1 y1 z1],[x2 y2 z2],...,[xn yn zn]]'`.
.. |br| raw:: html

:loads: **(nx6 numpy array of floats)** The forces and moments acting on each user-specified node in the format :code:`'[[Fx1,Fy1,Fz1,Mx1,My1,Mz1][Fx2,Fy2,Fz2,Mx2,My2,Mz2],...,[Fxn,Fyn,Fzn,Mxn,Myn,Mzn]]'`.

:fixtures: **(nx6 numpy array of ints)** The translational and rotational displacements for each user-specified node in the format :code:`'[[transx1,transy1,transz1,rotx1,roty1,rotz1],[transx2,transy2,transz2,rotx2,roty2,rotz2],...,[transxn,transyn,transzn,rotxn,rotyn,rotzn]]'`. Here :code:`transx1` is the translational degree of freedom in the x direction of the first user-specified node, and :code:`rotx1` is the rotational degree of freedom about the x-axis of the first user-specified node. A :code:`1` indicates fixed, while a :code:`0` indicates the node is free to move along or about the corresponding degree of freedom.
<br />

:user_spec_nodes: **(nx3 numpy array of floats)** User-specified nodes (nodes with provided loads and |br| displacement boundary conditions) in the format :code:`'[[x1 y1 z1],[x2 y2 z2],...,[xn yn zn]]'`.
:loads: **(nx6 numpy array of floats)** The forces and moments acting on each user-specified |br| node in the format |br| :code:`'[[Fx1,Fy1,Fz1,Mx1,My1,Mz1][Fx2,Fy2,Fz2,Mx2,My2,Mz2],...,[Fxn,Fyn,Fzn,Mxn,Myn,Mzn]]'`.
:fixtures: **(nx6 numpy array of ints)** The translational and rotational displacements for each |br| user-specified node in the format :code:`'[[tx1,ty1,tz1,rx1,ry1,rz1],[tx2,ty2,tz2,rx2,ry2,rz2],...,[txn,tyn,tzn,rxn,ryn,rzn]]'`. |br| Here :code:`tx1` is the translational degree of freedom in the x direction of the first |br| user-specified node, and :code:`rx1` is the rotational degree of freedom about the x-axis |br| of the first user-specified node. A :code:`1` indicates fixed, while a :code:`0` indicates |br| the node is free to move along or about the corresponding degree of freedom.
:num_rand_nodes: **(int)** Maximum number of random nodes.

:num_rand_edges: **(int)** Maximum number of random edges.

:properties_path: **(str)** Path to the properties CSV. For example, :code:`gastop-config/properties.csv`.

:domain: **(3x2 numpy array of floats)** Allowable domain in the format :code:`'[[xmin xmax],[ymin ymax],[zmin zmax]]'`.
:properties_path: **(str)** Path to the properties CSV, relative to the location of the config file. For example, :code:`../properties.csv`.
:domain: **(3x2 numpy array of floats)** Allowable domain in the format |br| :code:`'[[xmin xmax],[ymin ymax],[zmin zmax]]'`.

Fitness Function Parameters
===========================
Expand Down Expand Up @@ -167,3 +165,20 @@ Selector Parameters
:method: **(str)** Method for performing selection. *Options: inverse_square_rank_probability, tournament* *Default: inverse_square_rank_probability*
:tourn_size: **(int)** The number of truss indices in each tournament. Must be less than 32.
:tourn_prob: **(float)** The probability of the fittest truss in a tournament to be selected.

Properties Parsing
******************
While parsing the config file, GASTOp will read the path to a file that contains the user-specified property information from a CSV file. The file exists by default as :code:`properties.csv` with a few available material options:

.. csv-table::
:header: "beam","material","OD (m)","ID (m)","elastic_modulus (Pa)","yield_strength (Pa)","dens (kg/m^3)","poisson_ratio","cost ($/m)"
:widths: auto

0,steel,0.025,0.02,200000000000,250000000,8050,0.3,1
1,steel,0.012,0.01,200000000000,250000000,8050,0.3,0.75
2,aluminum,0.025,0.02,69000000000,95000000,2700,0.32,2
3,aluminum,0.012,0.01,69000000000,95000000,2700,0.32,1.5
4,2024 aluminum,0.042,0.032,69000000000,276000000,2700,0.32,3


Adding additional materials is as simple as adding a row to the default file, with all values separated by commas. One could also alternatively create a new properties file, duplicating the format of the default, replacing all material data, and specifying the path to the new properties file in the config file.
148 changes: 148 additions & 0 deletions docs/examples.rst
@@ -0,0 +1,148 @@
========
Examples
========

Pyramid Example Configuration File
***********************************

::

[general]
user_spec_nodes = '[[0,-.5,0],[0,.5,0],[0,0,1],[2,0,0]]'
loads = '[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,-10000,0,0,0]]'
fixtures = '[[1,1,1,1,1,1],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]'
num_rand_nodes = 10 # int
num_rand_edges = 10 # int
properties_path = 'gastop-config/properties.csv'
domain = '[[-1, -1, -1], [5, 1, 2]]'

::

[fitness_params]
equation = weighted_sum
[[parameters]]
goal_fos = 4
critical_nodes = '[3]'
w_fos = 10000
w_mass = 1
w_deflection = 100
::

[evaluator_params]
struct_solver = mat_struct_analysis_DSM
mass_solver = mass_basic
interferences_solver = blank_test
cost_solver = cost_calc

::

[ga_params]
num_threads = 1
pop_size = 1500
num_generations = 50
num_elite = 15
percent_mutation =
percent_crossover =
save_frequency = 5
save_filename_prefix = Recorded_States_

::

[monitor_params]
progress_fitness = True
progress_truss = True

::

# optional stuff

::

[random_params]
rng_seed =

::

[crossover_params]
node_crossover_method =
edge_crossover_method =
property_crossover_method =
[[node_crossover_params]]
[[edge_crossover_params]]
[[property_crossover_params]]

::

[mutator_params]
node_mutator_method =
edge_mutator_method =
property_mutator_method =
[[node_mutator_params]]
std =
[[edge_mutator_params]]
proportions =
[[property_mutator_params]]
proportions =

::

[selector_params]
method =
[[method_params]]
tourn_size =
tourn_prob =


Pyramid Example Results
************************

For this example there are three nodes that are fixed in all six degrees of
freedom at XYZ locations [0,-.5,0] , [0,.5,0] , [0,0,1]. A load is applied at
[2,0,0] in the negative Z direction with a magnitude of 10,000 N. The genetic
algorithm uses a population size of 1500, runs for 50 generations, and is
the structure is required to have a safety factor of four. The displacement is
minimized for node 3 which is the loaded node at [2,0,0]. To run this example
the command is as shown below:

.. code-block:: bash
$ gastop gastop-config/struct_making_test_init2.txt
The results of this simulation are:

.. image:: images/example1_structandprint.png
:alt: Simple Truss Optimization Result and Command Line Printout

Here the fixed nodes are shown in green, the loads are shown in red, and the
truss is shown in black. The blue lines show how the truss deforms under the
load magnified by a factor of 50 to be visible. The evolution of the
optimization algorithm is shown here:

.. figure:: /images/example1_sim.gif
:alt: Simple Truss Optimization Evolution


Cantilever Example Results
************************

For this example there are six nodes that are fixed in all six degrees of
freedom at XYZ locations [0,0,0], [0,0.001,1], [0,1.5,0], [0,1.5001,1], [0,3,0],
[0,3.0001,1]. Three loads are applied at [3,0,1], [3,1.5,1], [3,3,1] in the
negative Z direction, each with a magnitude of 1000 N. The genetic
algorithm uses a population size of 1000, runs for 250 generations, and is
the structure is required to have a safety factor of four. The displacement is
minimized for node 7 which is the middle loaded node at [3,1.5,1]. To run this
example the command is as shown below:

.. code-block:: bash
$ gastop gastop-config/init_cantilevered_test.txt
The results of this simulation are:

.. image:: images/example2_structandprint.png
:alt: Cantilevered Optimization Result and Command Line Printout

Here the fixed nodes are shown in green, the loads are shown in red, and the
truss is shown in black. The blue lines show how the truss deforms under the
load magnified by a factor of 50 to be visible.
File renamed without changes
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -9,4 +9,4 @@
usage
config_file_format
api

examples
11 changes: 11 additions & 0 deletions docs/lessons_and_future_work.aux
@@ -0,0 +1,11 @@
\relax
\@writefile{toc}{\contentsline {section}{\numberline {1}Design Decisions}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}GenAlg}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}Evaluator}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}Truss}{1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4}FitnessFunction}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5}Mutator}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.6}Selector}{2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.7}Crossover}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {2}Lessons Learned}{2}}
\@writefile{toc}{\contentsline {section}{\numberline {3}Future Work}{3}}

0 comments on commit 0666607

Please sign in to comment.