summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-07-04 11:00:26 -0700
committerMarius Peter <blendoit@gmail.com>2019-07-04 11:00:26 -0700
commitcab1c2b9470ddc9099c4458daf2388d30ac12ca6 (patch)
treeb63a5fb97034aed4d8ae5effd0cef6e9d6de5ced
parent04e871de7e318fec404975176800ccebf9e5e741 (diff)
start packagification
-rw-r--r--__init__.py17
-rw-r--r--example_airfoil.py14
-rw-r--r--tools/creator.py (renamed from creator.py)0
-rw-r--r--tools/evaluator.py (renamed from evaluator.py)0
-rw-r--r--tools/generator.py (renamed from generator.py)2
5 files changed, 8 insertions, 25 deletions
diff --git a/__init__.py b/__init__.py
deleted file mode 100644
index dc031d0..0000000
--- a/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is part of Marius Peter's airfoil analysis package (this program).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
-__author__ = "Marius Peter"
-# __version__ = "2.3"
-# __revision__ = "2.3.1"
diff --git a/example_airfoil.py b/example_airfoil.py
index cf279d5..f09ea7f 100644
--- a/example_airfoil.py
+++ b/example_airfoil.py
@@ -1,13 +1,14 @@
"""This example illustrates the usage of creator, evaluator and generator.
+All the steps of airfoil creation & evaluation are detailed here;
+however, the generator.py module contains certain presets (default airfoils).
+
Create an airfoil;
Evaluate an airfoil;
Generate a population of airfoils & optimize.
"""
-import creator # Create geometry
-import evaluator # Evaluate geometry
-import generator # Iteratevely evaluate instances of geometry and optimize
+from tools import creator, evaluator, generator
import time
start_time = time.time()
@@ -36,10 +37,9 @@ BOTTOM_STRINGERS = 4
NOSE_TOP_STRINGERS = 3
NOSE_BOTTOM_STRINGERS = 5
-# population information & save path
-POP_SIZE = 1
SAVE_PATH = 'C:/Users/blend/github/UCLA_MAE_154B/save'
+
# Create airfoil instance
af = creator.Airfoil.from_dimensions(CHORD_LENGTH, SEMI_SPAN)
af.add_naca(NACA_NUM)
@@ -49,10 +49,10 @@ af.info_save(SAVE_PATH, 'foo_name')
# Create spar instance
af.spar = creator.Spar()
-# Define the spar coordinates and mass, stored in single spar object
+# All spar coordinates are stored in single Spar object
af.spar.add_coord(af, 0.23)
af.spar.add_coord(af, 0.57)
-# Automatically adds spar caps for each spar defined previously
+# Automatically adds spar caps for each spar previously defined
af.spar.add_spar_caps(SPAR_CAP_AREA)
af.spar.add_mass(SPAR_MASS)
af.spar.add_webs(SPAR_THICKNESS)
diff --git a/creator.py b/tools/creator.py
index 810df09..810df09 100644
--- a/creator.py
+++ b/tools/creator.py
diff --git a/evaluator.py b/tools/evaluator.py
index ad1f873..ad1f873 100644
--- a/evaluator.py
+++ b/tools/evaluator.py
diff --git a/generator.py b/tools/generator.py
index 6a2865d..0213828 100644
--- a/generator.py
+++ b/tools/generator.py
@@ -17,7 +17,7 @@ The generator.py module contains a single Population class,
which represents a collection of randomized airfoils.
"""
-import creator
+from tools import creator
def default_airfoil():
Copyright 2019--2024 Marius PETER