Skip to content

Commit

Permalink
Add aero solver interface (mdolab#14)
Browse files Browse the repository at this point in the history
* Initial work for PYXLIGHT BaseSolver class

* Added BaseSolver method implementation checklist

* add `checkSolutionFailure`

* Added test for BaseSolver implementation

* More methods for optimization sensitivities and constraints

* Set current function names in AeroProblem

* add self.pointSetKwargs

* Modified test_solver_class to better compare values

* Added call counter, dat file writing, and plotting

* Fixes to get airfoil opt working

* black formatting

* Add coverage

* add python gitignore template

* flake8 fix

* add writeSolution method that calls other output methods

* Fix call to __call__ in `computeJacobianVectorProductFwd`

* Plotted original airfoil in light gray in airfoil plot

* Fixed AeroProblem DV output name in evalFunctionsSens by appending current aero problem name

* Added derivative check tests and fixed a bug in the FD

* Forgot to add FFD file, looks like shape variable at index 12 is particularly bad for CL derivative

* Added CP plotting and saving

* Fixed snake case (sorry Ali)

* Whoops, there was still more snake case

* Refined CP plot limits and added optimization animation tools

* Added friction coefficient plotting and better postprocessing tools

* Whoops, forgot to add the extension in postprocess

* Add "docs" to `extras_require` in `setup.py`

* Some fixes to limits on plots to update better

* New lines in docstrings

* Fixed airfoil limits in animation

* Made plot size bigger again

* Fix preFoil import

* fix other prefoil import

* add `solveCL` method

* `black -l 120 --target-version py39 .`

* flake8fix

* use numpy's assert_allclose rather than hand written relTol check

* Add API docs

* Update dependencies

* Added TODO to add options

* Fixed shape sensitivity test

* Add bounds on alpha during solveCL

* Remove old gitHub templates

* black formatting

* ignore vsCode settings and pre-commit config

* Kill all trailing whitespace and fix end of files

* Add backtracking to solveCL

* put failure check in the right place

* Split different solveCL settings into separate tests

* Randomise order of target CL's in solveCL test

* typo

* bump version

* Added correct TE thickness

* actually use the delta option

* Added fail flag to handle VISCAL fail

* Changed syntax to use pyxlight func instead of xfoil var directly

* try to debug codecov

* Fixed bug in FD when h is specified

* Added test for weird derivatives causing 60/63

* Ran black

* Changed test step size

* Changed the default number of panels to 284 in the source

* Added option to trip flow

* Added more tests, fixed matplotlib deprecation warnings, added ability to call from pyxlight import PYXLIGHT

* Improved docstrings

* Changed xfoilAnalysis import

* Fixed imports if only using xfoilAnalysis and added requirements to docs

* Added some pretty pictures to the docs

* Added gif to readme

* More docs and example

* Debugging readme gif

* Added example run script

* Added example gif

* Formatting changes

* Updated function values for higher number of panels

* Added mock imports for docs

* Changed mpl rcparams update method

* Filled in some missing docs

* Hopefully fixed autodoc problems

* Trying to figure out the source of the autodoc problem

* Trying removing matplotlib and niceplots from autodoc mock imports

* Added back matplotlib

* Trying matching work example from other repo in rst file

* That worked, slow and steady now

* Added AnimateAirfoilOpt heading

* Added top level heading

* Added reference label

* Added try excepts back to init

* Removed old pyXLIGHT interface

* Trying to make the docs look better

* First attempt at renaming pyXLIGHT to CMPLXFOIL

* Improved example to make it better behaved

* Added logo

* Modified install docs

* Formatted readme images

* New resizing

* Reized readme images

* Added svg version of logo

* Added logo to rtd

* Added new logo path for rtd

* Matched colors to pyoptsparse logo

* Changed readme to heading

* RTD logo not working for some reason

* Added new Azure status badge to readme

* Trying to quell the fury of flake8 and black

* Modified pyGeo CST stuff to work with updated interface

* Addressed most of Neil's comments

* Fixed problems with tests failing

* Improved plotting import procedure

* Oof, black

* Removed prefoil dependency and made pygeo and matplotlib optional

* Addressed most of Bernardo's comments

* Address some of Bernardo's comments

* flake8 fix

* Adjusted matplotlib import strategy

* Ran black

* Fixing flake8 complaints

* Moved niceplots print statement

* Removed annoying niceplots print statement

Co-authored-by: eytanadler <[email protected]>
Co-authored-by: Neil Wu <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2022
1 parent 383cf16 commit 1f5a188
Show file tree
Hide file tree
Showing 70 changed files with 8,987 additions and 1,133 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @mdolab/pyxlight_maintainers
* @mdolab/cmplxfoil_maintainers
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

3 changes: 2 additions & 1 deletion .github/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resources:
extends:
template: azure/azure_template.yaml@azure_template
parameters:
REPO_NAME: pyXLIGHT
REPO_NAME: CMPLXFOIL
GCC_CONFIG: config/defaults/config.LINUX_GFORTRAN.mk
INTEL_CONFIG: config/defaults/config.LINUX_INTEL.mk
COVERAGE: true
3 changes: 2 additions & 1 deletion .github/test_real.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -e
testflo -v . -n 1
cd tests
testflo -n 1 -v --coverage --coverpkg cmplxfoil
165 changes: 160 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,169 @@
.pre-commit-config.yaml
.vscode/*
.flake8

*.mod
*.o
*.a
*.so
*.pyc
*.autogen
config.mk
config/config*
*.out
*.egg-info

# Documentation Ignores
doc/_build/*
doc/_static/*
# ==============================================================================
# Github python gitignore template
# ==============================================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

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

# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
doc/_build/
doc/_static/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
10 changes: 5 additions & 5 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.


GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

Expand Down Expand Up @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)


These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
Expand Down Expand Up @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.


4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
Expand Down Expand Up @@ -225,7 +225,7 @@ impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.


8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
Expand Down Expand Up @@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS


How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Master makefile for pyXLIGHT. The actual makefile you want is:
# Master makefile for CMPLXFOIL. The actual makefile you want is:
# src/build/Makefile
# src_cs/build/Makefile

Expand All @@ -13,7 +13,7 @@ default:
echo " ";\
echo "The modify this config file as required. With the config file"; \
echo " specified, rerun 'make' and the build will start"; \
else make pyxlight_build;\
else make cmplxfoil_build;\
fi;

clean:
Expand All @@ -27,7 +27,7 @@ clean:
rm -fr src_cs/build/*.so
rm -f *~ config.mk;

pyxlight_build:
cmplxfoil_build:
ln -sf config/config.mk config.mk;
(cd src/build/ && make)
(cd src_cs/build/ && make)
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
pyXLIGHT
========
[![Build Status](https://dev.azure.com/mdolab/Public/_apis/build/status/mdolab.pyXLIGHT?repoName=mdolab%2FpyXLIGHT&branchName=main)](https://dev.azure.com/mdolab/Public/_build/latest?definitionId=40&repoName=mdolab%2FpyXLIGHT&branchName=main)
<h2 align="center">
<img src="/doc/assets/cmplxfoil_logo.svg" width="400" />
</h2>

[![Build Status](https://dev.azure.com/mdolab/Public/_apis/build/status/mdolab.CMPLXFOIL?repoName=mdolab%2FCMPLXFOIL&branchName=main)](https://dev.azure.com/mdolab/Public/_build/latest?definitionId=45&repoName=mdolab%2FCMPLXFOIL&branchName=main)
[![Documentation Status](https://readthedocs.com/projects/mdolab-pyxlight/badge/?version=latest&token=7a9e7987d2288b741e09686619f4cd425b1a7348ebbcca59c0d20b2ad5a003f6)](https://mdolab-pyxlight.readthedocs-hosted.com/en/latest/?badge=latest)

pyXLIGHT is a version of Mark Drela's XFOIL code with the GUI features removed.
CMPLXFOIL is a version of Mark Drela's XFOIL code with the GUI features removed.
Gradient computation is implemented with the complex-step method.

<p align="center">
<img src="/doc/assets/airfoil_opt.gif" width="500">
</p>

Documentation
-------------
Please see the [documentation](https://mdolab-pyxlight.readthedocs-hosted.com/en/latest/) for installation and usage details.

To locally build the documentation, enter the ``doc`` folder and run ``make html`` in the command line prompt.
You can then view the built documentation in the ``doc/_build/html/`` by opening ``index.html``.

Citing pyXLIGHT
Citing CMPLXFOIL
---------------
If you use pyXLIGHT, please see [this page](https://mdolab-pyxlight.readthedocs-hosted.com/en/latest/citation.html) for citation information.
If you use CMPLXFOIL, please see [this page](https://mdolab-pyxlight.readthedocs-hosted.com/en/latest/citation.html) for citation information.

License
-------
Expand Down
Loading

0 comments on commit 1f5a188

Please sign in to comment.