├── .checkignore ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── help-wanted.md └── workflows │ ├── ci.yml │ └── testing_pr.yml ├── .gitignore ├── .pylintrc ├── .travis.yml ├── CITATION.cff ├── LICENSE.rst ├── README.md ├── bladex ├── __init__.py ├── blade.py ├── deform.py ├── meta.py ├── ndinterpolator.py ├── parameter_files │ ├── default.prm │ └── pptc.prm ├── params.py ├── profile │ ├── __init__.py │ ├── customprofile.py │ ├── nacaprofile.py │ └── profileinterface.py ├── propeller.py ├── reversepropeller.py └── shaft.py ├── code_formatter.sh ├── docs ├── Makefile ├── make.bat ├── make_rst.sh └── source │ ├── LICENSE.rst │ ├── _static │ └── logo_bladex.png │ ├── _summaries │ ├── bladex.blade.Blade._abs_to_norm.rst │ ├── bladex.blade.Blade._check_errors.rst │ ├── bladex.blade.Blade._check_params.rst │ ├── bladex.blade.Blade._check_string.rst │ ├── bladex.blade.Blade._compute_pitch_angle.rst │ ├── bladex.blade.Blade._generate_lower_face.rst │ ├── bladex.blade.Blade._generate_tip.rst │ ├── bladex.blade.Blade._generate_upper_face.rst │ ├── bladex.blade.Blade._import_occ_libs.rst │ ├── bladex.blade.Blade._induced_rake_from_skew.rst │ ├── bladex.blade.Blade._norm_to_abs.rst │ ├── bladex.blade.Blade._planar_to_cylindrical.rst │ ├── bladex.blade.Blade._write_blade_errors.rst │ ├── bladex.blade.Blade.apply_transformations.rst │ ├── bladex.blade.Blade.export_ppg.rst │ ├── bladex.blade.Blade.generate_iges.rst │ ├── bladex.blade.Blade.generate_stl.rst │ ├── bladex.blade.Blade.plot.rst │ ├── bladex.blade.Blade.rotate.rst │ ├── bladex.deform.Deformation._check_control_points.rst │ ├── bladex.deform.Deformation._check_deformed.rst │ ├── bladex.deform.Deformation._check_param.rst │ ├── bladex.deform.Deformation._check_spline.rst │ ├── bladex.deform.Deformation._optimum_control_points.rst │ ├── bladex.deform.Deformation.compute_all.rst │ ├── bladex.deform.Deformation.compute_control_points.rst │ ├── bladex.deform.Deformation.compute_deformed_parameters.rst │ ├── bladex.deform.Deformation.export_param_file.rst │ ├── bladex.deform.Deformation.generate_spline.rst │ ├── bladex.deform.Deformation.plot.rst │ ├── bladex.deform.Deformation.update_control_points.rst │ ├── bladex.ndinterpolator.RBF.beckert_wendland_c2_basis.rst │ ├── bladex.ndinterpolator.RBF.gaussian_spline.rst │ ├── bladex.ndinterpolator.RBF.inv_multi_quadratic_biharmonic_spline.rst │ ├── bladex.ndinterpolator.RBF.multi_quadratic_biharmonic_spline.rst │ ├── bladex.ndinterpolator.RBF.thin_plate_spline.rst │ ├── bladex.ndinterpolator.RBF.weights_matrix.rst │ ├── bladex.ndinterpolator.reconstruct_f.rst │ ├── bladex.ndinterpolator.scipy_bspline.rst │ ├── bladex.params.ParamFile.__str__.rst │ ├── bladex.params.ParamFile._check_params.rst │ ├── bladex.params.ParamFile.read_parameters.rst │ ├── bladex.params.ParamFile.write_parameters.rst │ ├── bladex.profilebase.ProfileBase._update_edges.rst │ ├── bladex.profilebase.ProfileBase.chord_length.rst │ ├── bladex.profilebase.ProfileBase.compute_camber_line.rst │ ├── bladex.profilebase.ProfileBase.compute_chord_line.rst │ ├── bladex.profilebase.ProfileBase.deform_camber_line.rst │ ├── bladex.profilebase.ProfileBase.interpolate_coordinates.rst │ ├── bladex.profilebase.ProfileBase.max_camber.rst │ ├── bladex.profilebase.ProfileBase.max_thickness.rst │ ├── bladex.profilebase.ProfileBase.plot.rst │ ├── bladex.profilebase.ProfileBase.reference_point.rst │ ├── bladex.profilebase.ProfileBase.reflect.rst │ ├── bladex.profilebase.ProfileBase.rotate.rst │ ├── bladex.profilebase.ProfileBase.scale.rst │ ├── bladex.profilebase.ProfileBase.translate.rst │ ├── bladex.profiles.CustomProfile._check_coordinates.rst │ ├── bladex.profiles.NacaProfile._check_args.rst │ └── bladex.profiles.NacaProfile._generate_coordinates.rst │ ├── _tutorials │ ├── pictures │ │ └── transformations.png │ ├── tutorial1generatefoils.html │ ├── tutorial2transformfoils.html │ ├── tutorial3generateblade.html │ └── tutorial4deformblade.html │ ├── blade.rst │ ├── code.rst │ ├── conf.py │ ├── contact.rst │ ├── contributing.rst │ ├── deform.rst │ ├── index.rst │ ├── ndinterpolator.rst │ ├── params.rst │ ├── profilebase.rst │ └── profiles.rst ├── joss-paper ├── paper.bib └── paper.md ├── readme ├── PPTC.png ├── blade_deformations.png ├── mola2019marine.bib ├── tezzele2018ecmi.bib └── transformations.png ├── setup.py ├── tests ├── __init__.py ├── test_blade.py ├── test_datasets │ ├── blade_down_after_transformation_no_reflect.npy │ ├── blade_down_after_transformation_reflect.npy │ ├── blade_up_after_transformation_no_reflect.npy │ ├── blade_up_after_transformation_reflect.npy │ ├── camber_spline.npy │ ├── deformed_camber.npy │ ├── deformed_chord.npy │ ├── deformed_pitch.npy │ ├── deformed_rake.npy │ ├── deformed_skew.npy │ ├── errors.txt │ ├── interp_xdown_unit_circle.npy │ ├── interp_xup_unit_circle.npy │ ├── interp_ydown_unit_circle.npy │ ├── interp_yup_unit_circle.npy │ ├── lower.iges │ ├── lower.stl │ ├── naca4_0012_xdown.npy │ ├── naca4_0012_xup.npy │ ├── naca4_0012_ydown.npy │ ├── naca4_0012_yup.npy │ ├── naca4_2412_xdown_cosine.npy │ ├── naca4_2412_xdown_linear.npy │ ├── naca4_2412_xup_cosine.npy │ ├── naca4_2412_xup_linear.npy │ ├── naca4_2412_ydown_cosine.npy │ ├── naca4_2412_ydown_linear.npy │ ├── naca4_2412_yup_cosine.npy │ ├── naca4_2412_yup_linear.npy │ ├── naca5_00012_xdown.npy │ ├── naca5_00012_xup.npy │ ├── naca5_00012_ydown.npy │ ├── naca5_00012_yup.npy │ ├── naca5_23012_xdown_cosine.npy │ ├── naca5_23012_xdown_linear.npy │ ├── naca5_23012_xup_cosine.npy │ ├── naca5_23012_xup_linear.npy │ ├── naca5_23012_ydown_cosine.npy │ ├── naca5_23012_ydown_linear.npy │ ├── naca5_23012_yup_cosine.npy │ ├── naca5_23012_yup_linear.npy │ ├── naca5_23112_xdown.npy │ ├── naca5_23112_xup.npy │ ├── naca5_23112_ydown.npy │ ├── naca5_23112_yup.npy │ ├── parameters.prm │ ├── parameters_corrupt.prm │ ├── parameters_corrupt_2.prm │ ├── parameters_corrupt_3.prm │ ├── parameters_corrupt_4.prm │ ├── parameters_corrupt_5.prm │ ├── parameters_corrupt_6.prm │ ├── pitch_control_points.npy │ ├── pitch_control_points_no_rbf.npy │ ├── pitch_updated_control_points.npy │ ├── planar_to_cylindrical_blade_down.npy │ ├── planar_to_cylindrical_blade_up.npy │ ├── propeller_and_shaft.iges │ ├── propeller_and_shaft.obj │ ├── propeller_and_shaft.stl │ ├── root.iges │ ├── root.stl │ ├── shaft.iges │ ├── shaft.stl │ ├── tip.iges │ ├── tip.stl │ ├── upper.iges │ └── upper.stl ├── test_deform.py ├── test_ndinterpolator.py ├── test_package.py ├── test_params.py ├── test_profileinterface.py ├── test_profiles.py ├── test_propeller.py └── test_shaft.py └── tutorials ├── README.md ├── data ├── boeing_707.csv └── transformations.png ├── tutorial-1-generate_foils.ipynb ├── tutorial-2-transform_foils.ipynb ├── tutorial-3-generate_blade.ipynb ├── tutorial-4-deform_blade.ipynb ├── tutorial-5-foils-customprofile.ipynb └── tutorial-6-blades-customprofile.ipynb /.checkignore: -------------------------------------------------------------------------------- 1 | # Ignore folder content 2 | tests/* -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tutorials/* linguist-vendored=true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | The piece of code that reproduce the bug. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Output** 20 | The obtained output. Please include the entire error trace. 21 | 22 | **Additional context** 23 | Add any other context about the problem here. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/help-wanted.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Help wanted 3 | about: Ask help for using the package 4 | title: '' 5 | labels: help wanted 6 | assignees: '' 7 | 8 | --- 9 | 10 | **The objective** 11 | A clear description of the purpose of your application. 12 | 13 | **Already tried tests** 14 | The snippet of code you have already tried in order to obtain the wanted outcome. 15 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: "Coverage Deploy to Codacy" 2 | 3 | on: push 4 | 5 | jobs: 6 | test_deploy: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | 12 | 13 | - name: Set up Python 14 | uses: actions/setup-python@v2 15 | with: 16 | python-version: 3.8 17 | 18 | - name: Setup conda 19 | uses: s-weigand/setup-conda@v1 20 | with: 21 | update-conda: true 22 | python-version: 3.8 23 | conda-channels: anaconda, conda-forge 24 | 25 | - name: Install Python dependencies 26 | run: | 27 | conda install --yes pythonocc-core=7.4.0 numpy scipy matplotlib pytest pytest-cov vtk 28 | git clone https://github.com/mathLab/Smithers 29 | cd Smithers 30 | python setup.py install 31 | cd .. 32 | 33 | - name: Test with pytest 34 | env: 35 | CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} 36 | shell: bash 37 | run: | 38 | python3 -m pytest --cov-report term --cov-report xml:cobertura.xml --cov=bladex 39 | curl -s https://coverage.codacy.com/get.sh -o CodacyCoverageReporter.sh 40 | chmod +x CodacyCoverageReporter.sh 41 | ./CodacyCoverageReporter.sh report -r cobertura.xml -t $CODACY_API_TOKEN 42 | 43 | 44 | - name: Test with pytest 45 | run: | 46 | python -m pytest tests 47 | 48 | -------------------------------------------------------------------------------- /.github/workflows/testing_pr.yml: -------------------------------------------------------------------------------- 1 | name: "Testing Pull Request" 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - "master" 7 | 8 | 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: [windows-latest, macos-latest, ubuntu-latest] 16 | python-version: [3.8, 3.9] 17 | 18 | steps: 19 | - uses: actions/checkout@v4 20 | 21 | 22 | - name: Set up Python 23 | uses: actions/setup-python@v4 24 | with: 25 | python-version: ${{ matrix.python-version }} 26 | 27 | - name: Setup Conda 28 | uses: conda-incubator/setup-miniconda@v3 29 | with: 30 | channels: conda-forge, defaults 31 | activate-environment: "" 32 | 33 | - name: Install Python dependencies on Linux/MacOS 34 | shell: bash -el {0} 35 | if: startsWith(matrix.os, 'windows') != true 36 | run: | 37 | conda create -n occ python=${{ matrix.python-version }} pythonocc-core 38 | conda info 39 | conda activate occ 40 | conda info 41 | python -m pip install --upgrade pip 42 | python -m pip install smithers[vtk] 43 | python -m pip install .[test] 44 | python -c 'import OCC' 45 | 46 | - name: Install Python dependencies on Windows 47 | if: startsWith(matrix.os, 'windows') 48 | run: | 49 | conda install --yes pythonocc-core 50 | python -m pip install --upgrade pip 51 | python -m pip install smithers[vtk] 52 | python -m pip install .[test] 53 | 54 | - name: Test with pytest on Windows 55 | if: startsWith(matrix.os, 'windows') 56 | run: python -m pytest 57 | 58 | - name: Test with pytest on Linux/MacOS 59 | shell: bash -el {0} 60 | if: startsWith(matrix.os, 'windows') != true 61 | run: | 62 | conda activate occ 63 | python -m pytest 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # mac file systems 2 | .DS_Store 3 | 4 | # compiled python codes 5 | *.pyc -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: true 2 | dist: xenial 3 | 4 | language: python 5 | 6 | service: docker 7 | 8 | jobs: 9 | include: 10 | - os: linux 11 | python: 3.7 12 | env: TOXENV=py37 13 | - os: osx 14 | osx_image: xcode12.2 15 | language: generic 16 | env: TOXENV=py37 17 | 18 | before_script: 19 | - "export DISPLAY=:99.0" 20 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 21 | sh -e /etc/init.d/xvfb start; 22 | sleep 3; 23 | fi 24 | 25 | before_install: 26 | # We do this conditionally because it saves us some downloading if the 27 | # version is the same. 28 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 29 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; 30 | else 31 | brew update; 32 | brew install python; 33 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; 34 | fi 35 | - python --version 36 | - chmod +x miniconda.sh 37 | - bash miniconda.sh -b -p $HOME/miniconda 38 | - export PATH="$HOME/miniconda/bin:$HOME/miniconda/lib:$PATH" 39 | - hash -r 40 | - conda config --set always_yes yes --set changeps1 no 41 | - conda update -q conda 42 | # Useful for debugging any issues with conda 43 | - conda info -a 44 | - conda config --add channels conda-forge 45 | 46 | install: 47 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 48 | conda create --yes -n test python=$TRAVIS_PYTHON_VERSION; 49 | else 50 | conda create --yes -n test python="3.7"; 51 | fi 52 | - source activate test 53 | - echo $LD_LIBRARY_PATH 54 | - echo $DYLD_LIBRARY_PATH 55 | - echo $PATH 56 | - python --version 57 | - conda install --yes -c conda-forge pythonocc-core=7.4.0 numpy scipy matplotlib pip nose sip=4.18 setuptools coveralls python=3.7; 58 | - python setup.py install 59 | 60 | script: 61 | - coverage run test.py 62 | 63 | after_success: 64 | - coveralls 65 | 66 | branches: 67 | only: 68 | - master 69 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: "Gadalla" 5 | given-names: "Mahmoud" 6 | orcid: "https://orcid.org/0000-0001-9507-9468" 7 | - family-names: "Tezzele" 8 | given-names: "Marco" 9 | orcid: "https://orcid.org/0000-0001-9747-6328" 10 | - family-names: "Mola" 11 | given-names: "Andrea" 12 | orcid: "https://orcid.org/0000-0002-4483-0212" 13 | - family-names: "Rozza" 14 | given-names: "Gianluigi" 15 | orcid: "https://orcid.org/0000-0002-0810-8812" 16 | title: "BladeX: Python Blade Morphing" 17 | version: 0.1 18 | doi: 10.21105/joss.01203 19 | date-released: 2019-02-4 20 | url: "https://github.com/mathLab/BladeX" 21 | -------------------------------------------------------------------------------- /LICENSE.rst: -------------------------------------------------------------------------------- 1 | License 2 | ============== 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2017-2019 BladeX contributors 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | -------------------------------------------------------------------------------- /bladex/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | BladeX init 3 | """ 4 | __all__ = ['ProfileInterface', 'NacaProfile', 'CustomProfile', 5 | 'ReversePropeller', 'Blade', 'Shaft', 'Propeller', 'Deformation', 6 | 'ParamFile', 'RBF', 'reconstruct_f', 'scipy_bspline'] 7 | 8 | from .meta import * 9 | from .profile import ProfileInterface 10 | from .profile import NacaProfile 11 | from .profile import CustomProfile 12 | from .blade import Blade 13 | from .shaft import Shaft 14 | from .propeller import Propeller 15 | from .deform import Deformation 16 | from .params import ParamFile 17 | from .ndinterpolator import RBF, reconstruct_f, scipy_bspline 18 | from .reversepropeller import ReversePropeller 19 | -------------------------------------------------------------------------------- /bladex/meta.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | '__project__', 3 | '__title__', 4 | '__author__', 5 | '__copyright__', 6 | '__license__', 7 | '__version__', 8 | '__mail__', 9 | '__maintainer__', 10 | '__status__'] 11 | 12 | __project__ = 'BladeX' 13 | __title__ = "bladex" 14 | __author__ = "Marco Tezzele, Mahmoud Gadalla" 15 | __copyright__ = "Copyright 2019-2021, BladeX contributors" 16 | __license__ = "MIT" 17 | __version__ = "0.1.0" 18 | __mail__ = 'marcotez@gmail.com, gadalla.mah@gmail.com' 19 | __maintainer__ = __author__ 20 | __status__ = "Stable" -------------------------------------------------------------------------------- /bladex/ndinterpolator.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy.spatial.distance import cdist 3 | from scipy.interpolate import splev 4 | 5 | 6 | class RBF(object): 7 | """ 8 | .. _ndinterpolator-label: 9 | 10 | RBF ndinterpolator 11 | ====================== 12 | 13 | Module focused on the implementation of the Radial Basis Functions 14 | interpolation technique. This technique is still based on the use of 15 | a set of parameters, the so-called control points, as for FFD, but RBF 16 | is interpolatory. Another important key point of RBF strategy relies in 17 | the way we can locate the control points: in fact, instead of FFD where 18 | control points need to be placed inside a regular lattice, with RBF we 19 | havo no more limitations. So we have the possibility to perform localized 20 | control points refiniments. 21 | 22 | :Theoretical Insight: 23 | As reference please consult M.D. Buhmann, Radial Basis Functions, 24 | volume 12 of Cambridge monographs on applied and computational 25 | mathematics. Cambridge University Press, UK, 2003. This implementation 26 | follows D. Forti and G. Rozza, Efficient geometrical parametrization 27 | techniques of interfaces for reduced order modelling: application to 28 | fluid-structure interaction coupling problems, International Journal 29 | of Computational Fluid Dynamics. 30 | 31 | RBF shape parametrization technique is based on the definition of a map 32 | :math:`\\mathcal{M}(\\boldsymbol{x}) : \\mathbb{R}^n \\rightarrow 33 | \\mathbb{R}^n`, that allows the possibility of transferring data across 34 | non-matching grids and facing the dynamic mesh handling. The map 35 | introduced is defines as follows 36 | 37 | .. math:: 38 | \\mathcal{M}(\\boldsymbol{x}) = p(\\boldsymbol{x}) + 39 | \\sum_{i=1}^{\\mathcal{N}_C} \\gamma_i 40 | \\varphi(\\| \\boldsymbol{x} - \\boldsymbol{x_{C_i}} \\|) 41 | 42 | where :math:`p(\\boldsymbol{x})` is a low_degree polynomial term, 43 | :math:`\\gamma_i` is the weight, corresponding to the a-priori selected 44 | :math:`\\mathcal{N}_C` control points, associated to the :math:`i`-th 45 | basis function, and :math:`\\varphi(\\| \\boldsymbol{x} - 46 | \\boldsymbol{x_{C_i}} \\|)` a radial function based on the Euclidean 47 | distance between the control points position :math:`\\boldsymbol{x_{C_i}}` 48 | and :math:`\\boldsymbol{x}`. A radial basis function, generally, is a 49 | real-valued function whose value depends only on the distance from the 50 | origin, so that :math:`\\varphi(\\boldsymbol{x}) = \\tilde{\\varphi}( 51 | \\|\\boldsymbol{x} \\|)`. 52 | 53 | The matrix version of the formula above is: 54 | 55 | .. math:: 56 | \\mathcal{M}(\\boldsymbol{x}) = \\boldsymbol{c} + 57 | \\boldsymbol{Q}\\boldsymbol{x} + 58 | \\boldsymbol{W^T}\\boldsymbol{d}(\\boldsymbol{x}) 59 | 60 | The idea is that after the computation of the weights and the 61 | polynomial terms from the coordinates of the control points before and 62 | after the deformation, we can deform all the points of the mesh 63 | accordingly. Among the most common used radial basis functions for 64 | modelling 2D and 3D shapes, we consider Gaussian splines, Multi- 65 | uadratic biharmonic splines, Inverted multi-quadratic biharmonic 66 | splines, Thin-plate splines, Beckert and Wendland :math:`C^2` basis all 67 | defined and implemented below. 68 | 69 | :param string basis: RBF basis function 70 | :param float radius: cut-off radius 71 | 72 | """ 73 | 74 | def __init__(self, basis, radius): 75 | self.bases = { 76 | 'gaussian_spline': 77 | self.gaussian_spline, 78 | 'multi_quadratic_biharmonic_spline': 79 | self.multi_quadratic_biharmonic_spline, 80 | 'inv_multi_quadratic_biharmonic_spline': 81 | self.inv_multi_quadratic_biharmonic_spline, 82 | 'thin_plate_spline': 83 | self.thin_plate_spline, 84 | 'beckert_wendland_c2_basis': 85 | self.beckert_wendland_c2_basis 86 | } 87 | 88 | if basis in self.bases: 89 | self.basis = self.bases[basis] 90 | else: 91 | raise NameError( 92 | """The name of the basis function is not correct. Check 93 | the documentation for all the available functions.""") 94 | 95 | self.radius = radius 96 | 97 | # The following static methods are the implementations 98 | # of the most common radial basis functions 99 | @staticmethod 100 | def gaussian_spline(X, r): 101 | """ 102 | It implements the following formula: 103 | 104 | .. math:: 105 | \\varphi(\\| \\boldsymbol{x} \\|) = 106 | e^{-\\frac{\\| \\boldsymbol{x} \\|^2}{r^2}} 107 | 108 | :param numpy.ndarray X: l2-norm between given inputs of a function 109 | and the locations to perform rbf approximation to that function. 110 | :param float r: smoothing length, also called the cut-off radius. 111 | 112 | :return: result: the result of the formula above. 113 | :rtype: float 114 | """ 115 | return np.exp(-(X * X) / (r * r)) 116 | 117 | @staticmethod 118 | def multi_quadratic_biharmonic_spline(X, r): 119 | """ 120 | It implements the following formula: 121 | 122 | .. math:: 123 | \\varphi(\\| \\boldsymbol{x} \\|) = 124 | \\sqrt{\\| \\boldsymbol{x} \\|^2 + r^2} 125 | 126 | :param numpy.ndarray X: l2-norm between given inputs of a function 127 | and the locations to perform rbf approximation to that function. 128 | :param float r: smoothing length, also called the cut-off radius. 129 | 130 | :return: result: the result of the formula above. 131 | :rtype: float 132 | """ 133 | return np.sqrt((X * X) + (r * r)) 134 | 135 | @staticmethod 136 | def inv_multi_quadratic_biharmonic_spline(X, r): 137 | """ 138 | It implements the following formula: 139 | 140 | .. math:: 141 | \\varphi(\\| \\boldsymbol{x} \\|) = 142 | (\\| \\boldsymbol{x} \\|^2 + r^2 )^{-\\frac{1}{2}} 143 | 144 | :param numpy.ndarray X: l2-norm between given inputs of a function 145 | and the locations to perform rbf approximation to that function. 146 | :param float r: smoothing length, also called the cut-off radius. 147 | 148 | :return: result: the result of the formula above. 149 | :rtype: float 150 | """ 151 | return 1.0 / (np.sqrt((X * X) + (r * r))) 152 | 153 | @staticmethod 154 | def thin_plate_spline(X, r): 155 | """ 156 | It implements the following formula: 157 | 158 | .. math:: 159 | \\varphi(\\| \\boldsymbol{x} \\|) = 160 | \\left\\| \\frac{\\boldsymbol{x} }{r} \\right\\|^2 161 | \\ln \\left\\| \\frac{\\boldsymbol{x} }{r} \\right\\| 162 | 163 | :param numpy.ndarray X: l2-norm between given inputs of a function 164 | and the locations to perform rbf approximation to that function. 165 | :param float r: smoothing length, also called the cut-off radius. 166 | 167 | :return: result: the result of the formula above. 168 | :rtype: float 169 | """ 170 | arg = X / r 171 | result = arg * arg 172 | result = np.where(arg > 0, result * np.log(arg), result) 173 | return result 174 | 175 | @staticmethod 176 | def beckert_wendland_c2_basis(X, r): 177 | """ 178 | It implements the following formula: 179 | 180 | .. math:: 181 | \\varphi(\\| \\boldsymbol{x} \\|) = 182 | \\left( 1 - \\frac{\\| \\boldsymbol{x} \\|}{r} \\right)^4 + 183 | \\left( 4 \\frac{\\| \\boldsymbol{x} \\|}{r} + 1 \\right) 184 | 185 | :param numpy.ndarray X: l2-norm between given inputs of a function 186 | and the locations to perform rbf approximation to that function. 187 | :param float r: smoothing length, also called the cut-off radius. 188 | 189 | :return: result: the result of the formula above. 190 | :rtype: float 191 | """ 192 | arg = X / r 193 | first = np.where((1 - arg) > 0, np.power((1 - arg), 4), 0) 194 | second = (4 * arg) + 1 195 | return first * second 196 | 197 | def weights_matrix(self, X1, X2): 198 | """ 199 | This method returns the following matrix: 200 | 201 | .. math:: 202 | \\boldsymbol{D_{ij}} = \\varphi(\\| \\boldsymbol{x_i} - 203 | \\boldsymbol{y_j} \\|) 204 | 205 | :param numpy.ndarray X1: the vector x in the formula above. 206 | :param numpy.ndarray X2: the vector y in the formula above. 207 | 208 | :return: matrix: the matrix D. 209 | :rtype: numpy.ndarray 210 | """ 211 | if X1.size == X1.shape[0]: 212 | X1 = X1.reshape(-1, 1) 213 | if X2.size == X2.shape[0]: 214 | X2 = X2.reshape(-1, 1) 215 | return self.basis(cdist(X1, X2), self.radius) 216 | 217 | 218 | def reconstruct_f(original_input, original_output, rbf_input, rbf_output, basis, 219 | radius): 220 | """ 221 | Reconstruct a function by using the radial basis function approximations. 222 | 223 | :param array_like original_input: the original values of function inputs. 224 | :param array_like original_output: the original values of function output. 225 | :param array_like rbf_input: the input data for RBF approximation. 226 | :param array_like rbf_output: the array elements to be updated with the RBF 227 | interpolated outputs after the approximation. 228 | :param string basis: radial basis function. 229 | :param float radius: smoothing length, also called the cut-off radius. 230 | 231 | :Example: 232 | >>> import numpy as np 233 | >>> from bladex.ndinterpolator import reconstruct_f 234 | >>> x = np.arange(10) 235 | >>> y = np.square(x) 236 | >>> radius = 10 237 | >>> n_interp = 50 238 | >>> x_rbf = np.linspace(x[0], x[-1], num=n_interp) 239 | >>> y_rbf = np.zeros(n_interp) 240 | >>> reconstruct_f(original_input=x, original_output=y, rbf_input=x_rbf, 241 | rbf_output=y_rbf, radius=radius, basis='beckert_wendland_c2_basis') 242 | 243 | """ 244 | radial = RBF(basis=basis, radius=radius) 245 | 246 | weights_coeff = np.linalg.solve( 247 | radial.weights_matrix(original_input, original_input), original_output) 248 | 249 | weights_rbf = radial.weights_matrix(rbf_input, original_input) 250 | 251 | for i in range(rbf_input.shape[0]): 252 | for j in range(original_input.shape[0]): 253 | rbf_output[i] += weights_coeff[j] * weights_rbf[i][j] 254 | 255 | 256 | def scipy_bspline(cv, npoints, degree): 257 | """ 258 | Construct B-Spline curve via the control points. 259 | 260 | :param array_like cv: control points vector (spline coefficients). 261 | :param int npoints: number of points on the curve. 262 | :param int degree: BSpline degree. 263 | """ 264 | c = cv.shape[0] 265 | # calculating BSpline knots 266 | kv = np.clip(np.arange(c+degree+1)-degree, 0, c-degree) 267 | # u is the array of points at which to return the value of the smoothed spline 268 | u = np.linspace(0, c-degree, npoints) 269 | # Calculate resulting spline 270 | # splev requires u, and a tuple which is a sequence of length 3 containing 271 | # the knots, coefficients, and degree of the spline. 272 | return np.array(splev(u, (kv, cv.T, degree))).T 273 | -------------------------------------------------------------------------------- /bladex/parameter_files/default.prm: -------------------------------------------------------------------------------- 1 | 2 | [Original parameters] 3 | # This section describes the radial distributions of the parameters: 4 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 5 | # at given radial sections. 6 | 7 | Radial sections = 0.3 8 | 0.4 9 | 0.5 10 | 0.6000000000000001 11 | 0.7000000000000002 12 | 0.8000000000000003 13 | 0.9000000000000001 14 | 1.0000000000000002 15 | 16 | Radial distribution of chord = 0.0 17 | 0.0 18 | 0.0 19 | 0.0 20 | 0.0 21 | 0.0 22 | 0.0 23 | 0.0 24 | 25 | Radial distribution of pitch = 0.0 26 | 0.0 27 | 0.0 28 | 0.0 29 | 0.0 30 | 0.0 31 | 0.0 32 | 0.0 33 | 34 | Radial distribution of rake = 0.0 35 | 0.0 36 | 0.0 37 | 0.0 38 | 0.0 39 | 0.0 40 | 0.0 41 | 0.0 42 | 43 | Radial distribution of skew = 0.0 44 | 0.0 45 | 0.0 46 | 0.0 47 | 0.0 48 | 0.0 49 | 0.0 50 | 0.0 51 | 52 | Radial distribution of camber = 0.0 53 | 0.0 54 | 0.0 55 | 0.0 56 | 0.0 57 | 0.0 58 | 0.0 59 | 0.0 60 | 61 | 62 | [Chord B-Spline] 63 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 64 | 65 | # degree of the B-Spline curve 66 | spline degree: 3 67 | 68 | # number of points to be evaluated with the B-Spline interpolation 69 | spline npoints: 500 70 | 71 | # number of the control points 72 | number of control points: 10 73 | 74 | # Y-deformations of the control points. 75 | control points Y-deformations = 0.0 76 | 0.0 77 | 0.0 78 | 0.0 79 | 0.0 80 | 0.0 81 | 0.0 82 | 0.0 83 | 0.0 84 | 0.0 85 | 86 | 87 | [Pitch B-Spline] 88 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 89 | 90 | # degree of the B-Spline curve 91 | spline degree: 3 92 | 93 | # number of points to be evaluated with the B-Spline interpolation 94 | spline npoints: 500 95 | 96 | # number of the control points 97 | number of control points: 10 98 | 99 | # Y-deformations of the control points. 100 | control points Y-deformations = 0.0 101 | 0.0 102 | 0.0 103 | 0.0 104 | 0.0 105 | 0.0 106 | 0.0 107 | 0.0 108 | 0.0 109 | 0.0 110 | 111 | 112 | [Rake B-Spline] 113 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 114 | 115 | # degree of the B-Spline curve 116 | spline degree: 3 117 | 118 | # number of points to be evaluated with the B-Spline interpolation 119 | spline npoints: 500 120 | 121 | # number of the control points 122 | number of control points: 10 123 | 124 | # Y-deformations of the control points. 125 | control points Y-deformations = 0.0 126 | 0.0 127 | 0.0 128 | 0.0 129 | 0.0 130 | 0.0 131 | 0.0 132 | 0.0 133 | 0.0 134 | 0.0 135 | 136 | 137 | [Skew B-Spline] 138 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 139 | 140 | # degree of the B-Spline curve 141 | spline degree: 3 142 | 143 | # number of points to be evaluated with the B-Spline interpolation 144 | spline npoints: 500 145 | 146 | # number of the control points 147 | number of control points: 10 148 | 149 | # Y-deformations of the control points. 150 | control points Y-deformations = 0.0 151 | 0.0 152 | 0.0 153 | 0.0 154 | 0.0 155 | 0.0 156 | 0.0 157 | 0.0 158 | 0.0 159 | 0.0 160 | 161 | 162 | [Camber B-Spline] 163 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 164 | 165 | # degree of the B-Spline curve 166 | spline degree: 3 167 | 168 | # number of points to be evaluated with the B-Spline interpolation 169 | spline npoints: 500 170 | 171 | # number of the control points 172 | number of control points: 10 173 | 174 | # Y-deformations of the control points. 175 | control points Y-deformations = 0.0 176 | 0.0 177 | 0.0 178 | 0.0 179 | 0.0 180 | 0.0 181 | 0.0 182 | 0.0 183 | 0.0 184 | 0.0 185 | -------------------------------------------------------------------------------- /bladex/parameter_files/pptc.prm: -------------------------------------------------------------------------------- 1 | 2 | [Original parameters] 3 | # This section describes the radial distributions of the parameters: 4 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 5 | # at given radial sections. 6 | 7 | Radial sections = 0.3 8 | 0.35 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.85 15 | 0.9 16 | 0.95 17 | 0.975 18 | 1.0 19 | 20 | Radial distribution of chord = 0.18 21 | 0.225 22 | 0.26168 23 | 0.325 24 | 0.37668 25 | 0.41668 26 | 0.42832 27 | 0.42616 28 | 0.41668 29 | 0.37668 30 | 0.31468 31 | 0.1 32 | 33 | Radial distribution of pitch = 1.4 34 | 1.455 35 | 1.505 36 | 1.578 37 | 1.62 38 | 1.635 39 | 1.614 40 | 1.582 41 | 1.531 42 | 1.458 43 | 1.411 44 | 1.355 45 | 46 | Radial distribution of rake = 0.0 47 | 0.002 48 | 0.005 49 | 0.0134 50 | 0.0235 51 | 0.03 52 | 0.0295 53 | 0.0265 54 | 0.0218 55 | 0.016132 56 | 0.0132 57 | 0.01 58 | 59 | Radial distribution of skew = 3.6262795 60 | -1.188323 61 | -4.4654502 62 | -7.440779 63 | -7.3840979 64 | -5.0367916 65 | -1.3257914 66 | 1.0856404 67 | 4.1448947 68 | 7.697235 69 | 9.5368917 70 | 11.397609 71 | 72 | Radial distribution of camber = 0.015 73 | 0.02 74 | 0.02399878 75 | 0.02899692 76 | 0.03012637 77 | 0.02969185 78 | 0.02850205 79 | 0.02784869 80 | 0.02565038 81 | 0.02329829 82 | 0.02179992 83 | 0.02 84 | 85 | 86 | [Chord B-Spline] 87 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 88 | 89 | # degree of the B-Spline curve 90 | spline degree: 3 91 | 92 | # number of points to be evaluated with the B-Spline interpolation 93 | spline npoints: 500 94 | 95 | # number of the control points 96 | number of control points: 10 97 | 98 | # Y-deformations of the control points. 99 | control points Y-deformations = 0.0 100 | 0.0 101 | 0.0 102 | 0.0 103 | 0.0 104 | 0.0 105 | 0.0 106 | 0.0 107 | 0.0 108 | 0.0 109 | 110 | 111 | [Pitch B-Spline] 112 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 113 | 114 | # degree of the B-Spline curve 115 | spline degree: 3 116 | 117 | # number of points to be evaluated with the B-Spline interpolation 118 | spline npoints: 500 119 | 120 | # number of the control points 121 | number of control points: 10 122 | 123 | # Y-deformations of the control points. 124 | control points Y-deformations = 0.0 125 | 0.0 126 | 0.0 127 | 0.0 128 | 0.0 129 | 0.0 130 | 0.0 131 | 0.0 132 | 0.0 133 | 0.0 134 | 135 | 136 | [Rake B-Spline] 137 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 138 | 139 | # degree of the B-Spline curve 140 | spline degree: 3 141 | 142 | # number of points to be evaluated with the B-Spline interpolation 143 | spline npoints: 500 144 | 145 | # number of the control points 146 | number of control points: 10 147 | 148 | # Y-deformations of the control points. 149 | control points Y-deformations = 0.0 150 | 0.0 151 | 0.0 152 | 0.0 153 | 0.0 154 | 0.0 155 | 0.0 156 | 0.0 157 | 0.0 158 | 0.0 159 | 160 | 161 | [Skew B-Spline] 162 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 163 | 164 | # degree of the B-Spline curve 165 | spline degree: 3 166 | 167 | # number of points to be evaluated with the B-Spline interpolation 168 | spline npoints: 500 169 | 170 | # number of the control points 171 | number of control points: 10 172 | 173 | # Y-deformations of the control points. 174 | control points Y-deformations = 0.0 175 | 0.0 176 | 0.0 177 | 0.0 178 | 0.0 179 | 0.0 180 | 0.0 181 | 0.0 182 | 0.0 183 | 0.0 184 | 185 | 186 | [Camber B-Spline] 187 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 188 | 189 | # degree of the B-Spline curve 190 | spline degree: 3 191 | 192 | # number of points to be evaluated with the B-Spline interpolation 193 | spline npoints: 500 194 | 195 | # number of the control points 196 | number of control points: 10 197 | 198 | # Y-deformations of the control points. 199 | control points Y-deformations = 0.0 200 | 0.0 201 | 0.0 202 | 0.0 203 | 0.0 204 | 0.0 205 | 0.0 206 | 0.0 207 | 0.0 208 | 0.0 209 | -------------------------------------------------------------------------------- /bladex/profile/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Profile init 3 | """ 4 | __all__ = ['ProfileInterface', 'NacaProfile', 'CustomProfile'] 5 | 6 | from .profileinterface import ProfileInterface 7 | from .nacaprofile import NacaProfile 8 | from .customprofile import CustomProfile 9 | -------------------------------------------------------------------------------- /bladex/profile/nacaprofile.py: -------------------------------------------------------------------------------- 1 | """ 2 | Derived module from profilebase.py to provide the airfoil coordinates for 3 | standard Naca profiles. 4 | """ 5 | from scipy.interpolate import splev, splrep 6 | import numpy as np 7 | from .profileinterface import ProfileInterface 8 | 9 | class NacaProfile(ProfileInterface): 10 | """ 11 | Generate 4- and 5-digit NACA profiles. 12 | 13 | The NACA airfoils are airfoil shapes for aircraft wings developed by the 14 | National Advisory Committee for Aeronautics (NACA). The shape of the NACA 15 | airfoils is described using a series of digits following the word "NACA". 16 | The parameters in the numerical code can be entered into equations to 17 | precisely generate the cross-section of the airfoil and calculate its 18 | properties. 19 | 20 | The NACA four-digit series describes airfoil by the format MPTT, where: 21 | 22 | - M/100: indicates the maximum camber in percentage, with respect to the 23 | chord length. 24 | 25 | - P/10: indicates the location of the maximum camber measured from the 26 | leading edge. The location is normalized by the chord length. 27 | 28 | - TT/100: the maximum thickness as fraction of the chord length. 29 | 30 | The profile 00TT refers to a symmetrical NACA airfoil. 31 | 32 | The NACA five-digit series describes more complex airfoil shapes. 33 | Its format is: LPSTT, where: 34 | 35 | - L: the theoretical optimum lift coefficient at ideal 36 | angle-of-attack = 0.15*L 37 | 38 | - P: the x-coordinate of the point of maximum camber 39 | (max camber at x = 0.05*P) 40 | 41 | - S: indicates whether the camber is simple (S=0) or reflex (S=1) 42 | TT/100: the maximum thickness in percent of chord, as in a four-digit 43 | NACA airfoil code 44 | 45 | References: 46 | 47 | - Moran, Jack (2003). An introduction to theoretical and computational 48 | aerodynamics. Dover. p. 7. ISBN 0-486-42879-6. 49 | 50 | - Abbott, Ira (1959). Theory of Wing Sections: Including a Summary of 51 | Airfoil Data. New York: Dover Publications. p. 115. ISBN 978-0486605869. 52 | 53 | :param str digits: 4 or 5 digits that describes the NACA profile 54 | :param int n_points: number of discrete points that represents the 55 | airfoil profile. Default value is 240 56 | :param bool cosine_spacing: if True, then a cosine spacing is used for the 57 | airfoil coordinate distribution, otherwise linear spacing is used. 58 | Default value is True 59 | :raises ValueError: if n_points is not positive 60 | :raises TypeError: if n_points is not of type int 61 | :raises SyntaxError: if digits is not a string 62 | :raises Exception: if digits is not of length 4 or 5 63 | """ 64 | 65 | def __init__(self, digits, n_points=240, cosine_spacing=True): 66 | super(NacaProfile, self).__init__() 67 | self.digits = digits 68 | self.n_points = n_points 69 | self.cosine_spacing = cosine_spacing 70 | self._check_args() 71 | self.generate_coordinates() 72 | self.generate_parameters(convention='british') 73 | 74 | def _check_args(self): 75 | """ 76 | Private method to check that the number of the airfoil discrete points 77 | is a positive integer. 78 | """ 79 | if not isinstance(self.digits, str): 80 | raise TypeError('digits must be of type string.') 81 | if isinstance(self.n_points, float): 82 | self.n_points = int(self.n_points) 83 | if not isinstance(self.n_points, int): 84 | raise TypeError('n_points must be of type integer.') 85 | if self.n_points < 0: 86 | raise ValueError('n_points must be positive.') 87 | 88 | def generate_parameters(self, convention='british'): 89 | return super().generate_parameters(convention) 90 | 91 | def generate_coordinates(self): 92 | """ 93 | Private method that generates the coordinates of the NACA 4 or 5 digits 94 | airfoil profile. The method assumes a zero-thickness trailing edge, and 95 | no half-cosine spacing. 96 | """ 97 | a0 = +0.2969 98 | a1 = -0.1260 99 | a2 = -0.3516 100 | a3 = +0.2843 101 | a4 = -0.1036 # zero thickness TE 102 | 103 | x = np.linspace(0.0, 1.0, num=self.n_points) 104 | 105 | if len(self.digits) == 4: 106 | # Returns n+1 points in [0 1] for the given 4-digits NACA string 107 | m = float(self.digits[0]) / 100.0 108 | p = float(self.digits[1]) / 10.0 109 | t = float(self.digits[2:]) / 100.0 110 | 111 | # half-thickness distribution 112 | yt = 5 * t * (a0 * np.sqrt(x) + a1 * x + a2 * np.power(x, 2) + 113 | a3 * np.power(x, 3) + a4 * np.power(x, 4)) 114 | 115 | if p == 0: 116 | # Symmetric foil 117 | self.xup_coordinates = np.linspace(0.0, 1.0, num=self.n_points) 118 | self.yup_coordinates = yt 119 | self.xdown_coordinates = np.linspace( 120 | 0.0, 1.0, num=self.n_points) 121 | self.ydown_coordinates = -yt 122 | else: 123 | # Cambered foil 124 | xc1 = np.asarray([xx for xx in x if xx <= p]) 125 | xc2 = np.asarray([xx for xx in x if xx > p]) 126 | yc1 = m / np.power(p, 2) * xc1 * (2 * p - xc1) 127 | yc2 = m / np.power(1 - p, 2) * (1 - 2 * p + xc2) * (1 - xc2) 128 | # Y-coordinates of camber line 129 | yc = np.append(yc1, yc2) 130 | 131 | if self.cosine_spacing: 132 | # points are generated according to cosine distribution of 133 | # the X-coordinates of the chord 134 | dyc1_dx = m / np.power(p, 2) * (2 * p - 2 * xc1) 135 | dyc2_dx = m / np.power(1 - p, 2) * (2 * p - 2 * xc2) 136 | dyc_dx = np.append(dyc1_dx, dyc2_dx) 137 | theta = np.arctan(dyc_dx) 138 | self.xup_coordinates = x - yt * np.sin(theta) 139 | self.yup_coordinates = yc + yt * np.cos(theta) 140 | self.xdown_coordinates = x + yt * np.sin(theta) 141 | self.ydown_coordinates = yc - yt * np.cos(theta) 142 | else: 143 | # Linear spacing distribution of the foil coordinates 144 | self.xup_coordinates = np.linspace( 145 | 0.0, 1.0, num=self.n_points) 146 | self.xdown_coordinates = np.linspace( 147 | 0.0, 1.0, num=self.n_points) 148 | self.yup_coordinates = yc + yt 149 | self.ydown_coordinates = yc - yt 150 | 151 | elif len(self.digits) == 5: 152 | # Returns n+1 points in [0 1] for the given 5-digits NACA string 153 | cld = float(self.digits[0]) * 0.15 154 | p = 5.0 * float(self.digits[1]) / 100.0 155 | s = float(self.digits[2]) 156 | t = float(self.digits[3:]) / 100.0 157 | 158 | # half-thickness distribution 159 | yt = 5 * t * (a0 * np.sqrt(x) + a1 * x + a2 * np.power(x, 2) + 160 | a3 * np.power(x, 3) + a4 * np.power(x, 4)) 161 | 162 | if s == 1: 163 | # Relfex camber 164 | P = np.array([0.1, 0.15, 0.2, 0.25]) 165 | M = np.array([0.13, 0.2170, 0.318, 0.441]) 166 | K = np.array([51.99, 15.793, 6.520, 3.191]) 167 | elif s == 0: 168 | # Standard camber 169 | P = np.array([0.05, 0.1, 0.15, 0.2, 0.25]) 170 | M = np.array([0.0580, 0.1260, 0.2025, 0.2900, 0.3910]) 171 | K = np.array([361.4, 51.64, 15.957, 6.643, 3.230]) 172 | else: 173 | raise ValueError( 174 | 'For NACA "LPSTT" the value of "S" can be either 0 or 1.') 175 | 176 | if p == 0: 177 | # Symmetric foil 178 | self.xup_coordinates = np.linspace(0.0, 1.0, num=self.n_points) 179 | self.yup_coordinates = yt 180 | self.xdown_coordinates = np.linspace( 181 | 0.0, 1.0, num=self.n_points) 182 | self.ydown_coordinates = -yt 183 | else: 184 | # Cambered foil 185 | spl_m = splrep(P, M) 186 | spl_k = splrep(M, K) 187 | m = splev(p, spl_m) 188 | k1 = splev(m, spl_k) 189 | xc1 = np.asarray([xx for xx in x if xx <= m]) 190 | xc2 = np.asarray([xx for xx in x if xx > m]) 191 | yc1 = k1 / 6.0 * (np.power(xc1, 3) - 3 * m * np.power(xc1, 2) + 192 | np.power(m, 2) * (3 - m) * xc1) 193 | yc2 = k1 / 6.0 * np.power(m, 3) * (1 - xc2) 194 | yc = np.append(yc1, yc2) 195 | 196 | if self.cosine_spacing: 197 | # points are generated according to cosine distribution of 198 | # the X-coordinates of the chord 199 | zc = cld / 0.3 * yc 200 | dyc1_dx = 1.0 / 6.0 * k1 * ( 201 | 3 * np.power(xc1, 2) - 6 * m * xc1 + np.power(m, 2) * 202 | (3 - m)) 203 | dyc2_dx = np.tile(-1.0 / 6.0 * k1 * np.power(m, 3), 204 | len(xc2)) 205 | dyc_dx = np.append(dyc1_dx, dyc2_dx) 206 | theta = np.arctan(dyc_dx) 207 | self.xup_coordinates = x - yt * np.sin(theta) 208 | self.yup_coordinates = zc + yt * np.cos(theta) 209 | self.xdown_coordinates = x + yt * np.sin(theta) 210 | self.ydown_coordinates = zc - yt * np.cos(theta) 211 | else: 212 | # Linear spacing distribution of the foil coordinates 213 | self.xup_coordinates = np.linspace( 214 | 0.0, 1.0, num=self.n_points) 215 | self.xdown_coordinates = np.linspace( 216 | 0.0, 1.0, num=self.n_points) 217 | self.yup_coordinates = yc + yt 218 | self.ydown_coordinates = yc - yt 219 | 220 | else: 221 | raise Exception 222 | 223 | -------------------------------------------------------------------------------- /bladex/propeller.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module for the propeller with shaft bottom-up parametrized construction. 3 | """ 4 | import numpy as np 5 | from OCC.Core.IGESControl import IGESControl_Writer 6 | from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_Sewing 7 | from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Fuse 8 | from OCC.Extend.DataExchange import write_stl_file 9 | from OCC.Display.SimpleGui import init_display 10 | from smithers.io.obj import ObjHandler, WavefrontOBJ 11 | from smithers.io.stlhandler import STLHandler 12 | 13 | 14 | class Propeller(object): 15 | """ 16 | Bottom-up parametrized propeller (including shaft) construction. 17 | The constructor requires PythonOCC to be installed. 18 | 19 | :param shaft.Shaft shaft: shaft to be added to the propeller 20 | :param blade.Blade blade: blade of the propeller 21 | :param int n_blades: number of blades composing the propeller 22 | :cvar OCC.Core.TopoDS.TopoDS_Solid shaft_solid: solid shaft 23 | :cvar OCC.Core.TopoDS.TopoDS_Shell sewed_full_body: propeller with shaft shell 24 | """ 25 | 26 | def __init__(self, shaft, blade, n_blades): 27 | self.shaft_solid = shaft.generate_solid() 28 | 29 | blade.apply_transformations(reflect=True) 30 | blade_solid = blade.generate_solid( 31 | max_deg=2, display=False, errors=None 32 | ) 33 | blades = [] 34 | blades.append(blade_solid) 35 | for i in range(n_blades - 1): 36 | blade.rotate(rad_angle=1.0 * 2.0 * np.pi / float(n_blades)) 37 | blade_solid = blade.generate_solid( 38 | max_deg=2, display=False, errors=None 39 | ) 40 | blades.append(blade_solid) 41 | blades_combined = blades[0] 42 | for i in range(len(blades) - 1): 43 | boolean_union = BRepAlgoAPI_Fuse(blades_combined, blades[i + 1]) 44 | boolean_union.Build() 45 | if not boolean_union.IsDone(): 46 | raise RuntimeError("Unsuccessful assembling of blade") 47 | blades_combined = boolean_union.Shape() 48 | self.blades_solid = blades_combined 49 | 50 | boolean_union = BRepAlgoAPI_Fuse(self.shaft_solid, blades_combined) 51 | boolean_union.Build() 52 | result_compound = boolean_union.Shape() 53 | 54 | sewer = BRepBuilderAPI_Sewing(1e-2) 55 | sewer.Add(result_compound) 56 | sewer.Perform() 57 | self.sewed_full_body = sewer.SewedShape() 58 | 59 | def generate_iges(self, filename): 60 | """ 61 | Export the .iges CAD for the propeller with shaft. 62 | 63 | :param string filename: path (with the file extension) where to store 64 | the .iges CAD for the propeller and shaft 65 | :raises RuntimeError: if the solid assembling of blades is not 66 | completed successfully 67 | """ 68 | iges_writer = IGESControl_Writer() 69 | iges_writer.AddShape(self.sewed_full_body) 70 | iges_writer.Write(filename) 71 | 72 | def generate_stl(self, filename): 73 | """ 74 | Export the .stl CAD for the propeller with shaft. 75 | 76 | :param string filename: path (with the file extension) where to store 77 | the .stl CAD for the propeller and shaft 78 | :raises RuntimeError: if the solid assembling of blades is not 79 | completed successfully 80 | """ 81 | write_stl_file(self.sewed_full_body, filename) 82 | 83 | def generate_obj(self, filename, region_selector="by_coords", **kwargs): 84 | """ 85 | Export the .obj CAD for the propeller with shaft. The resulting 86 | file contains two regions: `propellerTip` and `propellerStem`, selected 87 | according to the criteria passed in the parameter `region_selector`. 88 | 89 | :param string filename: path (with the file extension). 90 | :param string region_selector: Two selectors available: 91 | 92 | * `by_coords`: We compute :math:`x`, the smallest X coordinate of 93 | the solid which represents the blades of the propeller. Then all 94 | the polygons (belonging to both blades and shaft) composed of 95 | points whose X coordinate is greater than :math:`x` are 96 | considered to be part of the region `propellerTip`. The rest 97 | belongs to `propellerStem`; 98 | * `blades_and_stem`: The two regions are simply given by the two 99 | solids which are used in :func:`__init__`. 100 | :raises RuntimeError: if the solid assembling of blades is not 101 | completed successfully 102 | """ 103 | 104 | # we write the propeller to STL, then re-open it to obtain the points 105 | write_stl_file(self.shaft_solid, "/tmp/temp_shaft.stl") 106 | shaft = STLHandler.read("/tmp/temp_shaft.stl") 107 | write_stl_file(self.blades_solid, "/tmp/temp_blades.stl") 108 | blades = STLHandler.read("/tmp/temp_blades.stl") 109 | 110 | obj_instance = WavefrontOBJ() 111 | 112 | # add vertexes. first of all we check for duplicated vertexes 113 | all_vertices = np.concatenate( 114 | [shaft["points"], blades["points"]], axis=0 115 | ) 116 | 117 | # unique_mapping maps items in all_vertices to items in unique_vertices 118 | unique_vertices, unique_mapping = np.unique( 119 | all_vertices, return_inverse=True, axis=0 120 | ) 121 | obj_instance.vertices = unique_vertices 122 | 123 | def cells_to_np(cells): 124 | cells = np.asarray(cells) 125 | return unique_mapping[cells.flatten()].reshape(-1, cells.shape[1]) 126 | 127 | # append a list of cells to obj_instance.polygons, possibly with a 128 | # region name 129 | def append_cells(cells, region_name=None): 130 | if region_name is not None: 131 | obj_instance.regions_change_indexes.append( 132 | ( 133 | np.asarray(obj_instance.polygons).shape[0], 134 | len(obj_instance.regions), 135 | ) 136 | ) 137 | obj_instance.regions.append(region_name) 138 | 139 | if len(obj_instance.polygons) == 0: 140 | obj_instance.polygons = np.array(cells_to_np(cells)) 141 | else: 142 | obj_instance.polygons = np.concatenate( 143 | [obj_instance.polygons, cells_to_np(cells)], axis=0 144 | ) 145 | 146 | shaft_cells = np.asarray(shaft["cells"]) 147 | # the 0th point in blades if the last+1 point in shaft 148 | blades_cells = np.asarray(blades["cells"]) + len(shaft["points"]) 149 | 150 | if region_selector == "blades_and_stem": 151 | defaultKwargs = {'blades_name' : 'blades', 'shaft_name' : 'shaft'} 152 | kwargs = {**defaultKwargs, **kwargs} 153 | append_cells(blades_cells, region_name=kwargs['blades_name']) 154 | append_cells(shaft_cells, region_name=kwargs['shaft_name']) 155 | 156 | elif region_selector == "by_coords": 157 | defaultKwargs = {'blades_name' : 'blades', 'shafthead_name' : 'shaftHead', 'shafttail_name' : 'shaftTail'} 158 | kwargs = {**defaultKwargs, **kwargs} 159 | minimum_blades_x = np.min(blades["points"][:, 0]) 160 | maximum_blades_x = np.max(blades["points"][:, 0]) 161 | shaft_x = shaft["points"][:, 0] 162 | 163 | if np.count_nonzero(shaft_x > maximum_blades_x) >= np.count_nonzero(shaft_x < maximum_blades_x): 164 | tip_boolean_array = shaft["points"][:, 0] <= maximum_blades_x 165 | 166 | elif np.count_nonzero(shaft_x < maximum_blades_x) > np.count_nonzero(shaft_x > maximum_blades_x): 167 | tip_boolean_array = shaft["points"][:, 0] >= minimum_blades_x 168 | 169 | shaft_cells_tip = np.all( 170 | tip_boolean_array[shaft_cells.flatten()].reshape( 171 | -1, shaft_cells.shape[1] 172 | ), 173 | axis=1, 174 | ) 175 | 176 | append_cells( 177 | shaft_cells[shaft_cells_tip], 178 | region_name=kwargs['shafthead_name'], 179 | ) 180 | append_cells( 181 | shaft_cells[np.logical_not(shaft_cells_tip)], 182 | region_name=kwargs['shafttail_name'], 183 | ) 184 | append_cells( 185 | blades_cells, 186 | region_name=kwargs['blades_name'], 187 | ) 188 | else: 189 | raise ValueError("This selector is not supported at the moment") 190 | 191 | # this is needed because indexes start at 1 192 | obj_instance.polygons += 1 193 | 194 | ObjHandler.write(obj_instance, filename) 195 | 196 | def generate_obj_blades(self, filename): 197 | """ 198 | Export the .obj CAD for the blades. 199 | 200 | :param string filename: path (with the file extension). 201 | """ 202 | 203 | # we write the propeller to STL, then re-open it to obtain the points 204 | write_stl_file(self.blades_solid, "/tmp/temp_blades.stl") 205 | blades = STLHandler.read("/tmp/temp_blades.stl") 206 | 207 | obj_instance = WavefrontOBJ() 208 | 209 | # add vertexes. first of all we check for duplicated vertexes 210 | all_vertices = blades["points"] 211 | # unique_mapping maps items in all_vertices to items in unique_vertices 212 | unique_vertices, unique_mapping = np.unique( 213 | all_vertices, return_inverse=True, axis=0 214 | ) 215 | obj_instance.vertices = unique_vertices 216 | 217 | def cells_to_np(cells): 218 | cells = np.asarray(cells) 219 | return unique_mapping[cells.flatten()].reshape(-1, cells.shape[1]) 220 | # append a list of cells to obj_instance.polygons, possibly with a 221 | # region name 222 | def append_cells(cells): 223 | obj_instance.regions_change_indexes.append( 224 | ( 225 | np.asarray(obj_instance.polygons).shape[0], 226 | len(obj_instance.regions), 227 | ) 228 | ) 229 | obj_instance.regions.append('blades') 230 | 231 | if len(obj_instance.polygons) == 0: 232 | obj_instance.polygons = np.array(cells_to_np(cells)) 233 | else: 234 | obj_instance.polygons = np.concatenate( 235 | [obj_instance.polygons, cells_to_np(cells)], axis=0 236 | ) 237 | 238 | blades_cells = np.asarray(blades["cells"]) 239 | 240 | append_cells(blades_cells) 241 | obj_instance.polygons += 1 242 | 243 | ObjHandler.write(obj_instance, filename) 244 | 245 | def display(self): 246 | """ 247 | Display the propeller with shaft. 248 | """ 249 | display, start_display = init_display()[:2] 250 | display.DisplayShape(self.sewed_full_body, update=True) 251 | start_display() 252 | -------------------------------------------------------------------------------- /bladex/shaft.py: -------------------------------------------------------------------------------- 1 | import os 2 | from OCC.Core.IGESControl import IGESControl_Reader 3 | from OCC.Extend.DataExchange import read_stl_file 4 | from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakeSolid, BRepBuilderAPI_Sewing 5 | import OCC.Core.TopoDS 6 | from OCC.Display.SimpleGui import init_display 7 | 8 | class Shaft(object): 9 | """ 10 | Bottom-up parametrized shaft construction. 11 | 12 | :param string filename: path (with the file extension) of a .stl or .iges file with 13 | stored shaft information. 14 | :cvar string filename: path (with the file extension) of a .stl or .iges file with 15 | stored shaft information. 16 | :raises Exception: if the extension in the filename is not in .stl or .iges formats. 17 | """ 18 | 19 | def __init__(self, filename): 20 | self.filename = filename 21 | 22 | def generate_solid(self): 23 | """ 24 | Generate an assembled solid shaft using the BRepBuilderAPI_MakeSolid 25 | algorithm. This method requires PythonOCC to be installed. 26 | 27 | :raises RuntimeError: if the assembling of the solid shaft is not 28 | completed successfully 29 | :return: solid shaft 30 | :rtype: OCC.Core.TopoDS.TopoDS_Solid 31 | """ 32 | ext = os.path.splitext(self.filename)[1][1:] 33 | if ext == 'stl': 34 | shaft_compound = read_stl_file(self.filename) 35 | elif ext == 'iges': 36 | iges_reader = IGESControl_Reader() 37 | iges_reader.ReadFile(self.filename) 38 | iges_reader.TransferRoots() 39 | shaft_compound = iges_reader.Shape() 40 | else: 41 | raise Exception('The shaft file is not in iges/stl formats') 42 | sewer = BRepBuilderAPI_Sewing(1e-2) 43 | sewer.Add(shaft_compound) 44 | sewer.Perform() 45 | result_sewed_shaft = sewer.SewedShape() 46 | shaft_solid_maker = BRepBuilderAPI_MakeSolid() 47 | shaft_solid_maker.Add(OCC.Core.TopoDS.topods_Shell(result_sewed_shaft)) 48 | if not shaft_solid_maker.IsDone(): 49 | raise RuntimeError('Unsuccessful assembling of solid shaft') 50 | shaft_solid = shaft_solid_maker.Solid() 51 | return shaft_solid 52 | 53 | def display(self): 54 | """ 55 | Display the shaft. 56 | """ 57 | shaft_solid = self.generate_solid() 58 | display, start_display = init_display()[:2] 59 | display.DisplayShape(shaft_solid, update=True) 60 | start_display() 61 | -------------------------------------------------------------------------------- /code_formatter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ####################################### 4 | 5 | required_command="yapf unexpand" 6 | code_directories="bladex tests" 7 | 8 | ####################################### 9 | 10 | usage() { 11 | echo 12 | echo -e "\tUsage: $0 [files]" 13 | echo 14 | echo -e "\tIf not files are specified, script formats all ".py" files" 15 | echo -e "\tin code directories ($code_directories); otherwise, formats" 16 | echo -e "\tall given files" 17 | echo 18 | echo -e "\tRequired command: $required_command" 19 | echo 20 | exit 0 21 | } 22 | 23 | 24 | [[ $1 == "-h" ]] && usage 25 | 26 | # Test for required program 27 | for comm in $required_command; do 28 | command -v $comm >/dev/null 2>&1 || { 29 | echo "I require $comm but it's not installed. Aborting." >&2; 30 | exit 1 31 | } 32 | done 33 | 34 | # Find all python files in code directories 35 | python_files="" 36 | for dir in $code_directories; do 37 | python_files="$python_files $(find $dir -name '*.py')" 38 | done 39 | [[ $# != 0 ]] && python_files=$@ 40 | 41 | 42 | # Here the important part: yapf format the files. 43 | for file in $python_files; do 44 | echo "Making beautiful $file..." 45 | [[ ! -f $file ]] && echo "$file does not exist; $0 -h for more info" && exit 46 | 47 | yapf --style='{ 48 | based_on_style: pep8, 49 | indent_width: 4, 50 | column_limit: 80 51 | }' -i $file 52 | done 53 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " applehelp to make an Apple Help Book" 34 | @echo " devhelp to make HTML files and a Devhelp project" 35 | @echo " epub to make an epub" 36 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 37 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 38 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 39 | @echo " text to make text files" 40 | @echo " man to make manual pages" 41 | @echo " texinfo to make Texinfo files" 42 | @echo " info to make Texinfo files and run them through makeinfo" 43 | @echo " gettext to make PO message catalogs" 44 | @echo " changes to make an overview of all changed/added/deprecated items" 45 | @echo " xml to make Docutils-native XML files" 46 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 47 | @echo " linkcheck to check all external links for integrity" 48 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 49 | @echo " coverage to run coverage check of the documentation (if enabled)" 50 | @echo " rst to generate the .rst file for documentation" 51 | 52 | clean: 53 | rm -rf $(BUILDDIR)/* 54 | 55 | html: 56 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 57 | @echo 58 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 59 | 60 | dirhtml: 61 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 62 | @echo 63 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 64 | 65 | singlehtml: 66 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 67 | @echo 68 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 69 | 70 | pickle: 71 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 72 | @echo 73 | @echo "Build finished; now you can process the pickle files." 74 | 75 | json: 76 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 77 | @echo 78 | @echo "Build finished; now you can process the JSON files." 79 | 80 | htmlhelp: 81 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 82 | @echo 83 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 84 | ".hhp project file in $(BUILDDIR)/htmlhelp." 85 | 86 | qthelp: 87 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 88 | @echo 89 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 90 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 91 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/active_subspaces.qhcp" 92 | @echo "To view the help file:" 93 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/active_subspaces.qhc" 94 | 95 | applehelp: 96 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 97 | @echo 98 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 99 | @echo "N.B. You won't be able to view it unless you put it in" \ 100 | "~/Library/Documentation/Help or install it in your application" \ 101 | "bundle." 102 | 103 | devhelp: 104 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 105 | @echo 106 | @echo "Build finished." 107 | @echo "To view the help file:" 108 | @echo "# mkdir -p $$HOME/.local/share/devhelp/active_subspaces" 109 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/active_subspaces" 110 | @echo "# devhelp" 111 | 112 | epub: 113 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 114 | @echo 115 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 116 | 117 | latex: 118 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 119 | @echo 120 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 121 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 122 | "(use \`make latexpdf' here to do that automatically)." 123 | 124 | latexpdf: 125 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 126 | @echo "Running LaTeX files through pdflatex..." 127 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 128 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 129 | 130 | latexpdfja: 131 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 132 | @echo "Running LaTeX files through platex and dvipdfmx..." 133 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 134 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 135 | 136 | text: 137 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 138 | @echo 139 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 140 | 141 | man: 142 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 143 | @echo 144 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 145 | 146 | texinfo: 147 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 148 | @echo 149 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 150 | @echo "Run \`make' in that directory to run these through makeinfo" \ 151 | "(use \`make info' here to do that automatically)." 152 | 153 | info: 154 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 155 | @echo "Running Texinfo files through makeinfo..." 156 | make -C $(BUILDDIR)/texinfo info 157 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 158 | 159 | gettext: 160 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 161 | @echo 162 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 163 | 164 | changes: 165 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 166 | @echo 167 | @echo "The overview file is in $(BUILDDIR)/changes." 168 | 169 | linkcheck: 170 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 171 | @echo 172 | @echo "Link check complete; look for any errors in the above output " \ 173 | "or in $(BUILDDIR)/linkcheck/output.txt." 174 | 175 | doctest: 176 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 177 | @echo "Testing of doctests in the sources finished, look at the " \ 178 | "results in $(BUILDDIR)/doctest/output.txt." 179 | 180 | coverage: 181 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 182 | @echo "Testing of coverage in the sources finished, look at the " \ 183 | "results in $(BUILDDIR)/coverage/python.txt." 184 | 185 | xml: 186 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 187 | @echo 188 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 189 | 190 | pseudoxml: 191 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 192 | @echo 193 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 194 | 195 | rst: 196 | @./make_rst.sh 197 | @echo 198 | @echo "Created new .RST files." 199 | @echo "Run \`sphinx-autogen\` in order to populate the summary directory." 200 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source 10 | set I18NSPHINXOPTS=%SPHINXOPTS% source 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | echo. coverage to run coverage check of the documentation if enabled 41 | goto end 42 | ) 43 | 44 | if "%1" == "clean" ( 45 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 46 | del /q /s %BUILDDIR%\* 47 | goto end 48 | ) 49 | 50 | 51 | REM Check if sphinx-build is available and fallback to Python version if any 52 | %SPHINXBUILD% 2> nul 53 | if errorlevel 9009 goto sphinx_python 54 | goto sphinx_ok 55 | 56 | :sphinx_python 57 | 58 | set SPHINXBUILD=python -m sphinx.__init__ 59 | %SPHINXBUILD% 2> nul 60 | if errorlevel 9009 ( 61 | echo. 62 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 63 | echo.installed, then set the SPHINXBUILD environment variable to point 64 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 65 | echo.may add the Sphinx directory to PATH. 66 | echo. 67 | echo.If you don't have Sphinx installed, grab it from 68 | echo.http://sphinx-doc.org/ 69 | exit /b 1 70 | ) 71 | 72 | :sphinx_ok 73 | 74 | 75 | if "%1" == "html" ( 76 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 77 | if errorlevel 1 exit /b 1 78 | echo. 79 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 80 | goto end 81 | ) 82 | 83 | if "%1" == "dirhtml" ( 84 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 85 | if errorlevel 1 exit /b 1 86 | echo. 87 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 88 | goto end 89 | ) 90 | 91 | if "%1" == "singlehtml" ( 92 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 93 | if errorlevel 1 exit /b 1 94 | echo. 95 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 96 | goto end 97 | ) 98 | 99 | if "%1" == "pickle" ( 100 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 101 | if errorlevel 1 exit /b 1 102 | echo. 103 | echo.Build finished; now you can process the pickle files. 104 | goto end 105 | ) 106 | 107 | if "%1" == "json" ( 108 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 109 | if errorlevel 1 exit /b 1 110 | echo. 111 | echo.Build finished; now you can process the JSON files. 112 | goto end 113 | ) 114 | 115 | if "%1" == "htmlhelp" ( 116 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run HTML Help Workshop with the ^ 120 | .hhp project file in %BUILDDIR%/htmlhelp. 121 | goto end 122 | ) 123 | 124 | if "%1" == "qthelp" ( 125 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 129 | .qhcp project file in %BUILDDIR%/qthelp, like this: 130 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\active_subspaces.qhcp 131 | echo.To view the help file: 132 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\active_subspaces.ghc 133 | goto end 134 | ) 135 | 136 | if "%1" == "devhelp" ( 137 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 138 | if errorlevel 1 exit /b 1 139 | echo. 140 | echo.Build finished. 141 | goto end 142 | ) 143 | 144 | if "%1" == "epub" ( 145 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 146 | if errorlevel 1 exit /b 1 147 | echo. 148 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 149 | goto end 150 | ) 151 | 152 | if "%1" == "latex" ( 153 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 154 | if errorlevel 1 exit /b 1 155 | echo. 156 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 157 | goto end 158 | ) 159 | 160 | if "%1" == "latexpdf" ( 161 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 162 | cd %BUILDDIR%/latex 163 | make all-pdf 164 | cd %~dp0 165 | echo. 166 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdfja" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf-ja 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "text" ( 181 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 182 | if errorlevel 1 exit /b 1 183 | echo. 184 | echo.Build finished. The text files are in %BUILDDIR%/text. 185 | goto end 186 | ) 187 | 188 | if "%1" == "man" ( 189 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 190 | if errorlevel 1 exit /b 1 191 | echo. 192 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 193 | goto end 194 | ) 195 | 196 | if "%1" == "texinfo" ( 197 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 198 | if errorlevel 1 exit /b 1 199 | echo. 200 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 201 | goto end 202 | ) 203 | 204 | if "%1" == "gettext" ( 205 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 206 | if errorlevel 1 exit /b 1 207 | echo. 208 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 209 | goto end 210 | ) 211 | 212 | if "%1" == "changes" ( 213 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 214 | if errorlevel 1 exit /b 1 215 | echo. 216 | echo.The overview file is in %BUILDDIR%/changes. 217 | goto end 218 | ) 219 | 220 | if "%1" == "linkcheck" ( 221 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Link check complete; look for any errors in the above output ^ 225 | or in %BUILDDIR%/linkcheck/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "doctest" ( 230 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Testing of doctests in the sources finished, look at the ^ 234 | results in %BUILDDIR%/doctest/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "coverage" ( 239 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of coverage in the sources finished, look at the ^ 243 | results in %BUILDDIR%/coverage/python.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "xml" ( 248 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 252 | goto end 253 | ) 254 | 255 | if "%1" == "pseudoxml" ( 256 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 257 | if errorlevel 1 exit /b 1 258 | echo. 259 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 260 | goto end 261 | ) 262 | 263 | :end 264 | -------------------------------------------------------------------------------- /docs/make_rst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################################ 3 | ## Bash file for the automatic creation of .RST file ## 4 | ## ## 5 | ## This script does not work on modules that not contains class definition ## 6 | ################################################################################ 7 | 8 | module='bladex' 9 | 10 | files=`ls ../$module/[a-z]*.py` 11 | 12 | for f in $files; do 13 | 14 | filename=$(basename $f .py) 15 | 16 | classname=`grep "class.*(.*):$" $f | awk '{print $2}' | cut -d"(" -f 1` 17 | [[ -z $classname ]] && echo "WARNING: class not found in file $f" 18 | 19 | methodnames=`grep -e 'def .*(.*):$' $f | awk '{print $2}' | cut -d "(" -f 1` 20 | [[ -z $classname ]] && echo "WARNING: methods not found in file $f" 21 | 22 | methodnames=`sed -r 's/\b(__init__|__new__)\b//g' <<< $methodnames` 23 | 24 | output="source/$filename.rst" 25 | 26 | echo -e "$classname" > $output 27 | echo -e "=====================" >> $output 28 | echo -e "" >> $output 29 | echo -e ".. currentmodule:: $module.$filename" >> $output 30 | echo -e "" >> $output 31 | echo -e ".. automodule:: $module.$filename" >> $output 32 | echo -e "" >> $output 33 | echo -e ".. autosummary::" >> $output 34 | echo -e " :toctree: _summaries" >> $output 35 | echo -e " :nosignatures:" >> $output 36 | echo -e "" >> $output 37 | echo -e " $classname" >> $output 38 | for methodname in $methodnames; do 39 | echo -e " $classname.$methodname" >> $output 40 | done 41 | echo -e "" >> $output 42 | echo -e ".. autoclass:: $classname" >> $output 43 | echo -e " :members:" >> $output 44 | echo -e " :private-members:" >> $output 45 | echo -e " :undoc-members:" >> $output 46 | echo -e " :show-inheritance:" >> $output 47 | echo -e " :noindex:" >> $output 48 | done 49 | -------------------------------------------------------------------------------- /docs/source/LICENSE.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../LICENSE.rst 2 | -------------------------------------------------------------------------------- /docs/source/_static/logo_bladex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/docs/source/_static/logo_bladex.png -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._abs_to_norm.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._abs_to_norm 2 | =============================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._abs_to_norm -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._check_errors.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._check_errors 2 | ================================ 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._check_errors -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._check_params.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._check_params 2 | ================================ 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._check_params -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._check_string.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._check_string 2 | ================================ 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._check_string -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._compute_pitch_angle.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._compute_pitch_angle 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._compute_pitch_angle -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._generate_lower_face.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._generate_lower_face 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._generate_lower_face -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._generate_tip.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._generate_tip 2 | ================================ 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._generate_tip -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._generate_upper_face.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._generate_upper_face 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._generate_upper_face -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._import_occ_libs.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._import_occ_libs 2 | =================================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._import_occ_libs -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._induced_rake_from_skew.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._induced_rake_from_skew 2 | ========================================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._induced_rake_from_skew -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._norm_to_abs.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._norm_to_abs 2 | =============================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._norm_to_abs -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._planar_to_cylindrical.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._planar_to_cylindrical 2 | ========================================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._planar_to_cylindrical -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade._write_blade_errors.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade._write_blade_errors 2 | ====================================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade._write_blade_errors -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.apply_transformations.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.apply_transformations 2 | ======================================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.apply_transformations -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.export_ppg.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.export_ppg 2 | ============================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.export_ppg -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.generate_iges.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.generate_iges 2 | ================================ 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.generate_iges -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.generate_stl.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.generate_stl 2 | =============================== 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.generate_stl -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.plot.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.plot 2 | ======================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.plot -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.blade.Blade.rotate.rst: -------------------------------------------------------------------------------- 1 | bladex.blade.Blade.rotate 2 | ========================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automethod:: Blade.rotate -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation._check_control_points.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation._check_control_points 2 | =============================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation._check_control_points -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation._check_deformed.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation._check_deformed 2 | ========================================= 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation._check_deformed -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation._check_param.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation._check_param 2 | ====================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation._check_param -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation._check_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation._check_spline 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation._check_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation._optimum_control_points.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation._optimum_control_points 2 | ================================================= 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation._optimum_control_points -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.compute_all.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.compute_all 2 | ===================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.compute_all -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.compute_control_points.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.compute_control_points 2 | ================================================ 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.compute_control_points -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.compute_deformed_parameters.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.compute_deformed_parameters 2 | ===================================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.compute_deformed_parameters -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.export_param_file.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.export_param_file 2 | =========================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.export_param_file -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.generate_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.generate_spline 2 | ========================================= 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.generate_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.plot.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.plot 2 | ============================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.plot -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.deform.Deformation.update_control_points.rst: -------------------------------------------------------------------------------- 1 | bladex.deform.Deformation.update_control_points 2 | =============================================== 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automethod:: Deformation.update_control_points -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.beckert_wendland_c2_basis.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.beckert_wendland_c2_basis 2 | =================================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.beckert_wendland_c2_basis -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.gaussian_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.gaussian_spline 2 | ========================================= 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.gaussian_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.inv_multi_quadratic_biharmonic_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.inv_multi_quadratic_biharmonic_spline 2 | =============================================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.inv_multi_quadratic_biharmonic_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.multi_quadratic_biharmonic_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.multi_quadratic_biharmonic_spline 2 | =========================================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.multi_quadratic_biharmonic_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.thin_plate_spline.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.thin_plate_spline 2 | =========================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.thin_plate_spline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.RBF.weights_matrix.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.RBF.weights_matrix 2 | ======================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automethod:: RBF.weights_matrix -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.reconstruct_f.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.reconstruct_f 2 | =================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. autofunction:: reconstruct_f -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.ndinterpolator.scipy_bspline.rst: -------------------------------------------------------------------------------- 1 | bladex.ndinterpolator.scipy_bspline 2 | =================================== 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. autofunction:: scipy_bspline -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.params.ParamFile.__str__.rst: -------------------------------------------------------------------------------- 1 | bladex.params.ParamFile.__str__ 2 | =============================== 3 | 4 | .. currentmodule:: bladex.params 5 | 6 | .. automethod:: ParamFile.__str__ -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.params.ParamFile._check_params.rst: -------------------------------------------------------------------------------- 1 | bladex.params.ParamFile._check_params 2 | ===================================== 3 | 4 | .. currentmodule:: bladex.params 5 | 6 | .. automethod:: ParamFile._check_params -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.params.ParamFile.read_parameters.rst: -------------------------------------------------------------------------------- 1 | bladex.params.ParamFile.read_parameters 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.params 5 | 6 | .. automethod:: ParamFile.read_parameters -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.params.ParamFile.write_parameters.rst: -------------------------------------------------------------------------------- 1 | bladex.params.ParamFile.write_parameters 2 | ======================================== 3 | 4 | .. currentmodule:: bladex.params 5 | 6 | .. automethod:: ParamFile.write_parameters -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase._update_edges.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase._update_edges 2 | ============================================ 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase._update_edges -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.chord_length.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.chord_length 2 | =========================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. autoattribute:: ProfileBase.chord_length -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.compute_camber_line.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.compute_camber_line 2 | ================================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.compute_camber_line -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.compute_chord_line.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.compute_chord_line 2 | ================================================= 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.compute_chord_line -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.deform_camber_line.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.deform_camber_line 2 | ================================================= 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.deform_camber_line -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.interpolate_coordinates.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.interpolate_coordinates 2 | ====================================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.interpolate_coordinates -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.max_camber.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.max_camber 2 | ========================================= 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.max_camber -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.max_thickness.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.max_thickness 2 | ============================================ 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.max_thickness -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.plot.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.plot 2 | =================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.plot -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.reference_point.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.reference_point 2 | ============================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. autoattribute:: ProfileBase.reference_point -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.reflect.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.reflect 2 | ====================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.reflect -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.rotate.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.rotate 2 | ===================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.rotate -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.scale.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.scale 2 | ==================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.scale -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profilebase.ProfileBase.translate.rst: -------------------------------------------------------------------------------- 1 | bladex.profilebase.ProfileBase.translate 2 | ======================================== 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automethod:: ProfileBase.translate -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profiles.CustomProfile._check_coordinates.rst: -------------------------------------------------------------------------------- 1 | bladex.profiles.CustomProfile._check_coordinates 2 | ================================================ 3 | 4 | .. currentmodule:: bladex.profiles 5 | 6 | .. automethod:: CustomProfile._check_coordinates -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profiles.NacaProfile._check_args.rst: -------------------------------------------------------------------------------- 1 | bladex.profiles.NacaProfile._check_args 2 | ======================================= 3 | 4 | .. currentmodule:: bladex.profiles 5 | 6 | .. automethod:: NacaProfile._check_args -------------------------------------------------------------------------------- /docs/source/_summaries/bladex.profiles.NacaProfile._generate_coordinates.rst: -------------------------------------------------------------------------------- 1 | bladex.profiles.NacaProfile._generate_coordinates 2 | ================================================= 3 | 4 | .. currentmodule:: bladex.profiles 5 | 6 | .. automethod:: NacaProfile._generate_coordinates -------------------------------------------------------------------------------- /docs/source/_tutorials/pictures/transformations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/docs/source/_tutorials/pictures/transformations.png -------------------------------------------------------------------------------- /docs/source/blade.rst: -------------------------------------------------------------------------------- 1 | Blade 2 | ================= 3 | 4 | .. currentmodule:: bladex.blade 5 | 6 | .. automodule:: bladex.blade 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | Blade._abs_to_norm 13 | Blade._check_errors 14 | Blade._check_params 15 | Blade._check_string 16 | Blade._compute_pitch_angle 17 | Blade._generate_lower_face 18 | Blade._generate_tip 19 | Blade._generate_upper_face 20 | Blade._import_occ_libs 21 | Blade._induced_rake_from_skew 22 | Blade._norm_to_abs 23 | Blade._planar_to_cylindrical 24 | Blade._write_blade_errors 25 | Blade.apply_transformations 26 | Blade.generate_iges 27 | Blade.generate_stl 28 | Blade.export_ppg 29 | Blade.plot 30 | Blade.rotate 31 | 32 | 33 | .. autoclass:: Blade 34 | :members: 35 | :private-members: 36 | :undoc-members: 37 | :show-inheritance: 38 | :noindex: 39 | 40 | -------------------------------------------------------------------------------- /docs/source/code.rst: -------------------------------------------------------------------------------- 1 | Code Documentation 2 | ================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | blade 8 | deform 9 | ndinterpolator 10 | profilebase 11 | params 12 | profiles 13 | 14 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # ezyrb documentation build configuration file, created by 4 | # sphinx-quickstart on Mon Jun 22 16:09:40 2015. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | import sys 16 | import os 17 | import shlex 18 | import sphinx 19 | from sphinx.errors import VersionRequirementError 20 | import sphinx_rtd_theme 21 | 22 | # If extensions (or modules to document with autodoc) are in another directory, 23 | # add these directories to sys.path here. If the directory is relative to the 24 | # documentation root, use os.path.abspath to make it absolute, like shown here. 25 | sys.path.insert(0, os.path.abspath('../..')) 26 | import bladex.meta as meta 27 | 28 | # -- General configuration ------------------------------------------------ 29 | 30 | # If your documentation needs a minimal Sphinx version, state it here. 31 | needs_sphinx = '1.4' 32 | if needs_sphinx > sphinx.__display_version__: 33 | message = 'This project needs at least Sphinx v{0!s}'.format(needs_sphinx) 34 | raise VersionRequirementError(message) 35 | 36 | # Add any Sphinx extension module names here, as strings. They can be 37 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 38 | # ones. 39 | extensions = [ 40 | 'sphinx.ext.autodoc', 41 | 'sphinx.ext.autosummary', 42 | 'sphinx.ext.coverage', 43 | 'sphinx.ext.graphviz', 44 | 'sphinx.ext.doctest', 45 | 'sphinx.ext.intersphinx', 46 | 'sphinx.ext.todo', 47 | 'sphinx.ext.coverage', 48 | 'sphinx.ext.viewcode', 49 | 'sphinx.ext.imgmath', 50 | 'sphinx.ext.ifconfig', 51 | ] 52 | 53 | intersphinx_mapping = {'python': ('http://docs.python.org/2', None), 54 | 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 55 | 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), 56 | 'matplotlib': ('http://matplotlib.sourceforge.net/', None)} 57 | 58 | # Add any paths that contain templates here, relative to this directory. 59 | templates_path = ['_templates'] 60 | 61 | # The suffix(es) of source filenames. 62 | # You can specify multiple suffix as a list of string: 63 | # source_suffix = ['.rst', '.md'] 64 | source_suffix = '.rst' 65 | 66 | # The encoding of source files. 67 | #source_encoding = 'utf-8-sig' 68 | 69 | # The master toctree document. 70 | master_doc = 'index' 71 | 72 | # General information about the project. 73 | project = u'BladeX' 74 | copyright = meta.__copyright__ 75 | author = meta.__author__ 76 | 77 | # autoclass 78 | autoclass_content = 'both' 79 | 80 | # The version info for the project you're documenting, acts as replacement for 81 | # |version| and |release|, also used in various other places throughout the 82 | # built documents. 83 | # 84 | # The short X.Y version. 85 | version = meta.__version__ 86 | # The full version, including alpha/beta/rc tags. 87 | release = version 88 | 89 | # The language for content autogenerated by Sphinx. Refer to documentation 90 | # for a list of supported languages. 91 | # 92 | # This is also used if you do content translation via gettext catalogs. 93 | # Usually you set "language" from the command line for these cases. 94 | language = None 95 | 96 | # There are two options for replacing |today|: either, you set today to some 97 | # non-false value, then it is used: 98 | #today = '' 99 | # Else, today_fmt is used as the format for a strftime call. 100 | #today_fmt = '%B %d, %Y' 101 | 102 | # List of patterns, relative to source directory, that match files and 103 | # directories to ignore when looking for source files. 104 | exclude_patterns = [] 105 | 106 | # The reST default role (used for this markup: `text`) to use for all 107 | # documents. 108 | #default_role = None 109 | 110 | # If true, '()' will be appended to :func: etc. cross-reference text. 111 | add_function_parentheses = True 112 | 113 | # If true, the current module name will be prepended to all description 114 | # unit titles (such as .. function::). 115 | add_module_names = False 116 | 117 | # If true, sectionauthor and moduleauthor directives will be shown in the 118 | # output. They are ignored by default. 119 | #show_authors = False 120 | 121 | # The name of the Pygments (syntax highlighting) style to use. 122 | pygments_style = 'sphinx' 123 | 124 | # A list of ignored prefixes for module index sorting. 125 | #modindex_common_prefix = [] 126 | 127 | # If true, keep warnings as "system message" paragraphs in the built documents. 128 | keep_warnings = False 129 | 130 | # If true, `todo` and `todoList` produce output, else they produce nothing. 131 | todo_include_todos = True 132 | 133 | 134 | # -- Options for viewcode extension --------------------------------------- 135 | 136 | # Follow alias objects that are imported from another module such as functions, 137 | # classes and attributes. As side effects, this option ... ??? 138 | # If false, ... ???. 139 | # The default is True. 140 | viewcode_import = True 141 | 142 | 143 | # -- Options for HTML output ---------------------------------------------- 144 | 145 | # The theme to use for HTML and HTML Help pages. See the documentation for 146 | # a list of builtin themes. 147 | #html_theme = 'bizstyle' 148 | html_theme = "sphinx_rtd_theme" 149 | 150 | # Theme options are theme-specific and customize the look and feel of a theme 151 | # further. For a list of options available for each theme, see the 152 | # documentation. 153 | #html_theme_options = {} 154 | 155 | # Add any paths that contain custom themes here, relative to this directory. 156 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 157 | 158 | # The name for this set of Sphinx documents. If None, it defaults to 159 | # " v documentation". 160 | #html_title = None 161 | 162 | # A shorter title for the navigation bar. Default is the same as html_title. 163 | #html_short_title = None 164 | 165 | # The name of an image file (relative to this directory) to place at the top 166 | # of the sidebar. 167 | #html_logo = None 168 | 169 | # The name of an image file (within the static path) to use as favicon of the 170 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 171 | # pixels large. 172 | #html_favicon = None 173 | 174 | # Add any paths that contain custom static files (such as style sheets) here, 175 | # relative to this directory. They are copied after the builtin static files, 176 | # so a file named "default.css" will overwrite the builtin "default.css". 177 | html_static_path = ['_static'] 178 | 179 | # Add any extra paths that contain custom files (such as robots.txt or 180 | # .htaccess) here, relative to this directory. These files are copied 181 | # directly to the root of the documentation. 182 | html_extra_path = ['_tutorials'] 183 | 184 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 185 | # using the given strftime format. 186 | html_last_updated_fmt = '%b %d, %Y' 187 | 188 | # If true, SmartyPants will be used to convert quotes and dashes to 189 | # typographically correct entities. 190 | #html_use_smartypants = True 191 | 192 | # Custom sidebar templates, maps document names to template names. 193 | #html_sidebars = {} 194 | 195 | # Additional templates that should be rendered to pages, maps page names to 196 | # template names. 197 | #html_additional_pages = {} 198 | 199 | # If false, no module index is generated. 200 | #html_domain_indices = True 201 | 202 | # If false, no index is generated. 203 | html_use_index = True 204 | 205 | # If true, the index is split into individual pages for each letter. 206 | #html_split_index = False 207 | 208 | # If true, links to the reST sources are added to the pages. 209 | html_show_sourcelink = True 210 | 211 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 212 | #html_show_sphinx = True 213 | 214 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 215 | html_show_copyright = True 216 | 217 | # If true, an OpenSearch description file will be output, and all pages will 218 | # contain a tag referring to it. The value of this option must be the 219 | # base URL from which the finished HTML is served. 220 | #html_use_opensearch = '' 221 | 222 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 223 | #html_file_suffix = None 224 | 225 | # Language to be used for generating the HTML full-text search index. 226 | # Sphinx supports the following languages: 227 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 228 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' 229 | #html_search_language = 'en' 230 | 231 | # A dictionary with options for the search language support, empty by default. 232 | # Now only 'ja' uses this config value 233 | #html_search_options = {'type': 'default'} 234 | 235 | # The name of a javascript file (relative to the configuration directory) that 236 | # implements a search results scorer. If empty, the default will be used. 237 | #html_search_scorer = 'scorer.js' 238 | 239 | # Output file base name for HTML help builder. 240 | htmlhelp_basename = 'bladexdoc' 241 | 242 | # -- Options for LaTeX output --------------------------------------------- 243 | 244 | latex_elements = { 245 | # The paper size ('letterpaper' or 'a4paper'). 246 | #'papersize': 'letterpaper', 247 | 248 | # The font size ('10pt', '11pt' or '12pt'). 249 | #'pointsize': '10pt', 250 | 251 | # Additional stuff for the LaTeX preamble. 252 | #'preamble': '', 253 | 254 | # Latex figure (float) alignment 255 | #'figure_align': 'htbp', 256 | } 257 | 258 | # Grouping the document tree into LaTeX files. List of tuples 259 | # (source start file, target name, title, 260 | # author, documentclass [howto, manual, or own class]). 261 | latex_documents = [ 262 | (master_doc, 'bladex.tex', u'bladex Documentation', 263 | u'BladeX contributors', 'manual'), 264 | ] 265 | 266 | # The name of an image file (relative to this directory) to place at the top of 267 | # the title page. 268 | #latex_logo = None 269 | 270 | # For "manual" documents, if this is true, then toplevel headings are parts, 271 | # not chapters. 272 | #latex_use_parts = False 273 | 274 | # If true, show page references after internal links. 275 | #latex_show_pagerefs = False 276 | 277 | # If true, show URL addresses after external links. 278 | #latex_show_urls = False 279 | 280 | # Documents to append as an appendix to all manuals. 281 | #latex_appendices = [] 282 | 283 | # If false, no module index is generated. 284 | #latex_domain_indices = True 285 | 286 | 287 | # -- Options for manual page output --------------------------------------- 288 | 289 | # One entry per manual page. List of tuples 290 | # (source start file, name, description, authors, manual section). 291 | man_pages = [ 292 | (master_doc, 'bladex', u'bladex Documentation', 293 | [author], 1) 294 | ] 295 | 296 | # If true, show URL addresses after external links. 297 | #man_show_urls = False 298 | 299 | 300 | # -- Options for Texinfo output ------------------------------------------- 301 | 302 | # Grouping the document tree into Texinfo files. List of tuples 303 | # (source start file, target name, title, author, 304 | # dir menu entry, description, category) 305 | texinfo_documents = [ 306 | (master_doc, 'bladex', u'bladex Documentation', 307 | author, 'bladex', 'One line description of project.', 308 | 'Miscellaneous'), 309 | ] 310 | 311 | # Documents to append as an appendix to all manuals. 312 | #texinfo_appendices = [] 313 | 314 | # If false, no module index is generated. 315 | #texinfo_domain_indices = True 316 | 317 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 318 | #texinfo_show_urls = 'footnote' 319 | 320 | # If true, do not generate a @detailmenu in the "Top" node's menu. 321 | #texinfo_no_detailmenu = False 322 | -------------------------------------------------------------------------------- /docs/source/contact.rst: -------------------------------------------------------------------------------- 1 | Contact 2 | ======= 3 | 4 | Feel free to contact the authors for any informations. 5 | 6 | - marcotez@gmail.com 7 | - gadalla.mah@gmail.com -------------------------------------------------------------------------------- /docs/source/contributing.rst: -------------------------------------------------------------------------------- 1 | How to contribute 2 | =================== 3 | 4 | We'd love to accept your patches and contributions to this project. There are 5 | just a few small guidelines you need to follow. 6 | 7 | Submitting a patch: 8 | 9 | 1. It's generally best to start by opening a new issue describing the bug or 10 | feature you're intending to fix. Even if you think it's relatively minor, 11 | it's helpful to know what people are working on. Mention in the initial 12 | issue that you are planning to work on that bug or feature so that it can 13 | be assigned to you. 14 | 15 | 2. Follow the normal process of forking the project, and setup a new 16 | branch to work in. It's important that each group of changes be done in 17 | separate branches in order to ensure that a pull request only includes the 18 | commits related to that bug or feature. 19 | 20 | 3. To ensure properly formatted code, please make sure to use 4 21 | spaces to indent the code. You should also run pylint over your code. 22 | It's not strictly necessary that your code be completely "lint-free", 23 | but this will help you find common style issues. 24 | 25 | 4. Any significant changes should almost always be accompanied by tests. The 26 | project already has good test coverage, so look at some of the existing 27 | tests if you're unsure how to go about it. We're using coveralls that 28 | is an invaluable tools for seeing which parts of your code aren't being 29 | exercised by your tests. 30 | 31 | 5. Do your best to have well-formed commit messages for each change. 32 | This provides consistency throughout the project, and ensures that commit 33 | messages are able to be formatted properly by various git tools. 34 | 35 | 6. Finally, push the commits to your fork and submit a pull request. Please, 36 | remember to rebase properly in order to maintain a clean, linear git history. -------------------------------------------------------------------------------- /docs/source/deform.rst: -------------------------------------------------------------------------------- 1 | Deformation 2 | ================= 3 | 4 | .. currentmodule:: bladex.deform 5 | 6 | .. automodule:: bladex.deform 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | Deformation._check_control_points 13 | Deformation._check_deformed 14 | Deformation._check_param 15 | Deformation._check_spline 16 | Deformation._optimum_control_points 17 | Deformation.compute_all 18 | Deformation.compute_control_points 19 | Deformation.compute_deformed_parameters 20 | Deformation.export_param_file 21 | Deformation.generate_spline 22 | Deformation.plot 23 | Deformation.update_control_points 24 | 25 | 26 | .. autoclass:: Deformation 27 | :members: 28 | :private-members: 29 | :undoc-members: 30 | :show-inheritance: 31 | :noindex: 32 | 33 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to BladeX's documentation! 2 | =================================================== 3 | 4 | .. image:: _static/logo_bladex.png 5 | :height: 150px 6 | :width: 150 px 7 | :align: right 8 | 9 | Description 10 | ^^^^^^^^^^^^ 11 | 12 | BladeX is a Python package for geometrical parametrization and bottom-up construction of propeller blades. It allows to generate and deform a blade based on the radial distribution of its parameters such as pitch, rake, skew, and the sectional foils' parameters such as chord and camber. The package is ideally suited for parametric simulations on large number of blade deformations. It provides an automated procedure for the CAD generation, hence reducing the time and effort required for modelling. The main scope of BladeX is to deal with propeller blades, however it can be flexible to be applied on further applications with analogous geometrical structures such as aircraft wings, turbomachinery, or wind turbine blades. 13 | 14 | 15 | Dependencies and installation 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | BladeX requires numpy, scipy, matplotlib, sphinx (for the documentation), and nose (for the local test). They can be easily installed using pip. 18 | 19 | BladeX is compatible with Python 2.7 and Python 3.6. Moreover, some of the modules require OCC to be installed for the .iges or .stl CAD generation. Please see below for instructions on how to satisfy the OCC requirements. You can also refer to `pythonocc.org `_ or `github.com/tpaviot/pythonocc-core `_ for further instructions. 20 | 21 | Python2.7 OCC installation: 22 | :: 23 | 24 | conda install -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core==0.18.1 smesh=6.7.5 python=2.7 25 | 26 | Python3.6 OCC installation: 27 | :: 28 | 29 | conda install -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core==0.18.1 smesh=6.7.5 python=3.6 30 | 31 | 32 | The `official distribution `_ is on GitHub, and you can clone the repository using 33 | :: 34 | 35 | git clone https://github.com/mathLab/BladeX 36 | 37 | To install the package just type: 38 | :: 39 | 40 | python setup.py install 41 | 42 | To uninstall the package you have to rerun the installation and record the installed files in order to remove them: 43 | 44 | :: 45 | 46 | python setup.py install --record installed_files.txt 47 | cat installed_files.txt | xargs rm -rf 48 | 49 | 50 | Tutorials 51 | ^^^^^^^^^^^^^^^^ 52 | 53 | We made some tutorial examples. Please refer to the official GitHub repository for the last updates. Here the list of the exported tutorials: 54 | 55 | - `Tutorial 1 `_ - Here we show how to prepare a blade 2D sectional profile through generating legacy and custom foils. 56 | - `Tutorial 2 `_ - Here we show how to proceed with preparing a blade 2D sectional profile by performing several transformation operations on the generated foils. 57 | - `Tutorial 3 `_ - Here we show how to prepare a blade 3D sectional profiles by applying all the transformations due to the radial distribution of the blade parameters. 58 | - `Tutorial 4 `_ - Here we show how to deform a blade and its parametric curves by using a parameter file. 59 | 60 | 61 | Developer's Guide 62 | ^^^^^^^^^^^^^^^^^^^^^^^ 63 | 64 | .. toctree:: 65 | :maxdepth: 1 66 | 67 | code 68 | contact 69 | contributing 70 | LICENSE 71 | 72 | 73 | 74 | Indices and tables 75 | ^^^^^^^^^^^^^^^^^^^^^^^^ 76 | 77 | * :ref:`genindex` 78 | * :ref:`modindex` 79 | * :ref:`search` 80 | -------------------------------------------------------------------------------- /docs/source/ndinterpolator.rst: -------------------------------------------------------------------------------- 1 | Ndinterpolator 2 | ================= 3 | 4 | .. currentmodule:: bladex.ndinterpolator 5 | 6 | .. automodule:: bladex.ndinterpolator 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | RBF.beckert_wendland_c2_basis 13 | RBF.gaussian_spline 14 | RBF.inv_multi_quadratic_biharmonic_spline 15 | RBF.multi_quadratic_biharmonic_spline 16 | RBF.thin_plate_spline 17 | RBF.weights_matrix 18 | reconstruct_f 19 | scipy_bspline 20 | 21 | 22 | .. automodule:: bladex.ndinterpolator 23 | :members: 24 | :undoc-members: 25 | :noindex: -------------------------------------------------------------------------------- /docs/source/params.rst: -------------------------------------------------------------------------------- 1 | ParamFile 2 | ================= 3 | 4 | .. currentmodule:: bladex.params 5 | 6 | .. automodule:: bladex.params 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | ParamFile._check_params 13 | ParamFile.__str__ 14 | ParamFile.read_parameters 15 | ParamFile.write_parameters 16 | 17 | 18 | .. autoclass:: ParamFile 19 | :members: 20 | :private-members: 21 | :undoc-members: 22 | :show-inheritance: 23 | :noindex: 24 | 25 | -------------------------------------------------------------------------------- /docs/source/profilebase.rst: -------------------------------------------------------------------------------- 1 | ProfileBase 2 | ================= 3 | 4 | .. currentmodule:: bladex.profilebase 5 | 6 | .. automodule:: bladex.profilebase 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | ProfileBase._update_edges 13 | ProfileBase.chord_length 14 | ProfileBase.compute_camber_line 15 | ProfileBase.compute_chord_line 16 | ProfileBase.deform_camber_line 17 | ProfileBase.interpolate_coordinates 18 | ProfileBase.max_camber 19 | ProfileBase.max_thickness 20 | ProfileBase.plot 21 | ProfileBase.reference_point 22 | ProfileBase.reflect 23 | ProfileBase.rotate 24 | ProfileBase.scale 25 | ProfileBase.translate 26 | 27 | 28 | .. autoclass:: ProfileBase 29 | :members: 30 | :private-members: 31 | :undoc-members: 32 | :show-inheritance: 33 | :noindex: 34 | 35 | -------------------------------------------------------------------------------- /docs/source/profiles.rst: -------------------------------------------------------------------------------- 1 | Profiles 2 | ================= 3 | 4 | .. currentmodule:: bladex.profiles 5 | 6 | .. automodule:: bladex.profiles 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | CustomProfile._check_coordinates 13 | NacaProfile._check_args 14 | NacaProfile._generate_coordinates 15 | 16 | 17 | .. autoclass:: CustomProfile 18 | :members: 19 | :private-members: 20 | :undoc-members: 21 | :show-inheritance: 22 | :noindex: 23 | 24 | .. autoclass:: NacaProfile 25 | :members: 26 | :private-members: 27 | :undoc-members: 28 | :show-inheritance: 29 | :noindex: 30 | 31 | -------------------------------------------------------------------------------- /joss-paper/paper.bib: -------------------------------------------------------------------------------- 1 | %% Saved with string encoding Unicode (UTF-8) 2 | 3 | 4 | @book{carlton2012marine, 5 | title={Marine propellers and propulsion}, 6 | author={Carlton, John}, 7 | year={2012}, 8 | publisher={Butterworth-Heinemann} 9 | } 10 | 11 | 12 | @misc{tezzele2018ecmi, 13 | author = {Tezzele, M. and Demo, N. and Mola, A. and Rozza, G.}, 14 | journal = {Submitted, Special Volume ECMI}, 15 | howpublished = {https://arxiv.org/abs/1810.12364}, 16 | title = {{An integrated data-driven computational pipeline with model order reduction for industrial and applied mathematics}}, 17 | year = {2018}} 18 | -------------------------------------------------------------------------------- /joss-paper/paper.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'BladeX: Python Blade Morphing' 3 | tags: 4 | - Python 5 | - Blade construction 6 | - Blade morphing 7 | - CAD files 8 | authors: 9 | - name: Mahmoud Gadalla 10 | orcid: 0000-0001-9507-9468 11 | affiliation: 1 12 | - name: Marco Tezzele 13 | orcid: 0000-0001-9747-6328 14 | affiliation: 1 15 | - name: Andrea Mola 16 | orcid: 0000-0002-4483-0212 17 | affiliation: 1 18 | - name: Gianluigi Rozza 19 | orcid: 0000-0002-0810-8812 20 | affiliation: 1 21 | affiliations: 22 | - name: International School of Advanced Studies, SISSA, Trieste, Italy 23 | index: 1 24 | date: 15 January 2019 25 | bibliography: paper.bib 26 | --- 27 | 28 | # Summary 29 | 30 | Marine propeller blade shape is constantly studied by engineers to obtain designs that allow for enhanced hydrodynamic performance while reducing vibrations and noise emissions. In such framework, shape parametrization and morphing algorithms are crucial elements of the numerical simulation and prototyping environment required for the evaluation of new blade geometries. From a practical standpoint, a propeller blade is uniquely described by the following parameters: the shape of a certain number of sectional profiles, complemented by the pitch, skew, rake, and chord length values corresponding to each section along the radial direction. Taking such parameters into account we are able to construct a blade and, parametrizing the aforementioned quantities by spline reconstruction, we are able to morph every single section. This results in a morphing tool that expands in a non-intrusive way the naval engineering consolidated design techniques. In particular, we followed @carlton2012marine for marine propeller blades construction, conventions, and terminology. 31 | 32 | In the BladeX Python package, we implemented the bottom-up construction of blades given the radial distribution of pitch, skew, rake, chord, and camber of the sectional profiles. We also provide several tutorials showing how to construct or import sectional profiles in 2D and then how to generate the desired 3D representation of the blade. It is also possible to export the final design in CAD files such as iges and stl. Even if the focus is on marine propeller blades, the software is general enough to produce, for instance, aircraft wings or wind turbine blades. It is particularly suited for simulation-driven design shape optimization. 33 | 34 | The package has already been used within the research project PRELICA, “Advanced methodologies for hydro-acoustic design of naval propulsion,” with both industrial and academic partners, and some results can be found in @tezzele2018ecmi. This highlights that the target user of this package is either a numerical analyst working in academia or a skilled engineer working in the naval construction field. 35 | 36 | As an example, we show below a bottom-up construction of a benchmark blade called PPTC, and the resulting iges and stl file formats. 37 | 38 | ![Bottom-up construction of the PPTC benchmark blade, and the resulting iges and stl file.](../readme/PPTC.png) 39 | 40 | Here we have the undeformed reference blade and a couple of deformed configurations obtained by moving some control points defining the skew and chord length radial distributions. 41 | 42 | ![Undeformed blade, on the left, and two deformed configurations.](../readme/blade_deformations.png) 43 | 44 | # Acknowledgements 45 | This work was partially supported by the project PRELICA, “Advanced methodologies for hydro-acoustic design of naval propulsion”, supported by Regione FVG, POR-FESR 2014-2020, Piano Operativo Regionale Fondo Europeo per lo Sviluppo Regionale, and by European Union Funding for Research and Innovation — Horizon 2020 Program — in the framework of European Research Council Executive Agency: H2020 ERC CoG 2015 AROMA-CFD project 681447 “Advanced Reduced Order Methods with Applications in Computational Fluid Dynamics” P.I. Gianluigi Rozza. 46 | 47 | # References 48 | -------------------------------------------------------------------------------- /readme/PPTC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/readme/PPTC.png -------------------------------------------------------------------------------- /readme/blade_deformations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/readme/blade_deformations.png -------------------------------------------------------------------------------- /readme/mola2019marine.bib: -------------------------------------------------------------------------------- 1 | 2 | @inproceedings{mola2019marine, 3 | Author = {Mola, Andrea and Tezzele, Marco and Gadalla, Mahmoud and Valdenazzi, Federica and Grassi, Davide and Padovan, Roberta and Rozza, Gianluigi}, 4 | Booktitle = {Proceedings of MARINE 2019: VIII International Conference on Computational Methods in Marine Engineering}, 5 | Date-Added = {2019-03-28 10:47:28 +0100}, 6 | Date-Modified = {2019-05-30 14:35:31 +0200}, 7 | Pages = {201-212}, 8 | Title = {Efficient reduction in shape parameter space dimension for ship propeller blade design}, 9 | Year = {2019}} 10 | -------------------------------------------------------------------------------- /readme/tezzele2018ecmi.bib: -------------------------------------------------------------------------------- 1 | 2 | @article{tezzele2018ecmi, 3 | Author = {Tezzele, M. and Demo, N. and Mola, A. and Rozza, G.}, 4 | Date-Added = {2018-12-11 10:21:39 +0100}, 5 | Date-Modified = {2018-12-14 14:19:30 +0100}, 6 | Journal = {Submitted, Special Volume ECMI}, 7 | Title = {{An integrated data-driven computational pipeline with model order reduction for industrial and applied mathematics}}, 8 | Year = {2018}} 9 | -------------------------------------------------------------------------------- /readme/transformations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/readme/transformations.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | meta = {} 4 | with open("bladex/meta.py") as fp: 5 | exec(fp.read(), meta) 6 | 7 | # Package meta-data. 8 | NAME = meta['__title__'] 9 | DESCRIPTION = 'Python Blade Morphing' 10 | URL = 'https://github.com/mathLab/BladeX' 11 | MAIL = meta['__mail__'] 12 | AUTHOR = meta['__author__'] 13 | VERSION = meta['__version__'] 14 | KEYWORDS = 'blade-generation propeller iges procal' 15 | 16 | REQUIRED = [ 17 | 'numpy', 'scipy', 'matplotlib', 'Sphinx', 'sphinx_rtd_theme', 'smithers' 18 | ] 19 | 20 | EXTRAS = { 21 | 'docs': ['Sphinx==1.4', 'sphinx_rtd_theme'], 22 | 'test': ['pytest', 'pytest-cov'], 23 | } 24 | 25 | LDESCRIPTION = ( 26 | "BladeX is a Python package for geometrical parametrization and bottom-up " 27 | "construction of propeller blades. It allows to generate and deform a " 28 | "blade based on the radial distribution of its parameters such as pitch, " 29 | "rake, skew, and the sectional foils' parameters such as chord and " 30 | "camber. The package is ideally suited for parametric simulations on " 31 | "large number of blade deformations. It provides an automated procedure " 32 | "for the CAD generation, hence reducing the time and effort required for " 33 | "modelling. The main scope of BladeX is to deal with propeller blades, " 34 | "however it can be flexible to be applied on further applications with " 35 | "analogous geometrical structures such as aircraft wings, turbomachinery, " 36 | "or wind turbine blades." 37 | ) 38 | 39 | setup( 40 | name=NAME, 41 | version=VERSION, 42 | description=DESCRIPTION, 43 | long_description=LDESCRIPTION, 44 | classifiers=[ 45 | 'Development Status :: 5 - Production/Stable', 46 | 'License :: OSI Approved :: MIT License', 47 | 'Programming Language :: Python :: 3.6', 48 | 'Intended Audience :: Science/Research', 49 | 'Topic :: Scientific/Engineering :: Mathematics' 50 | ], 51 | keywords=KEYWORDS, 52 | url=URL, 53 | author=AUTHOR, 54 | author_email=MAIL, 55 | license='MIT', 56 | packages=find_packages(), 57 | install_requires=REQUIRED, 58 | extras_require=EXTRAS, 59 | include_package_data=True, 60 | zip_safe=False 61 | ) 62 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | import matplotlib 2 | 3 | matplotlib.use('Agg') -------------------------------------------------------------------------------- /tests/test_datasets/blade_down_after_transformation_no_reflect.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/blade_down_after_transformation_no_reflect.npy -------------------------------------------------------------------------------- /tests/test_datasets/blade_down_after_transformation_reflect.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/blade_down_after_transformation_reflect.npy -------------------------------------------------------------------------------- /tests/test_datasets/blade_up_after_transformation_no_reflect.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/blade_up_after_transformation_no_reflect.npy -------------------------------------------------------------------------------- /tests/test_datasets/blade_up_after_transformation_reflect.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/blade_up_after_transformation_reflect.npy -------------------------------------------------------------------------------- /tests/test_datasets/camber_spline.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/camber_spline.npy -------------------------------------------------------------------------------- /tests/test_datasets/deformed_camber.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/deformed_camber.npy -------------------------------------------------------------------------------- /tests/test_datasets/deformed_chord.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/deformed_chord.npy -------------------------------------------------------------------------------- /tests/test_datasets/deformed_pitch.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/deformed_pitch.npy -------------------------------------------------------------------------------- /tests/test_datasets/deformed_rake.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/deformed_rake.npy -------------------------------------------------------------------------------- /tests/test_datasets/deformed_skew.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/deformed_skew.npy -------------------------------------------------------------------------------- /tests/test_datasets/interp_xdown_unit_circle.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/interp_xdown_unit_circle.npy -------------------------------------------------------------------------------- /tests/test_datasets/interp_xup_unit_circle.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/interp_xup_unit_circle.npy -------------------------------------------------------------------------------- /tests/test_datasets/interp_ydown_unit_circle.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/interp_ydown_unit_circle.npy -------------------------------------------------------------------------------- /tests/test_datasets/interp_yup_unit_circle.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/interp_yup_unit_circle.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_0012_xdown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_0012_xdown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_0012_xup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_0012_xup.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_0012_ydown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_0012_ydown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_0012_yup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_0012_yup.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_xdown_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_xdown_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_xdown_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_xdown_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_xup_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_xup_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_xup_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_xup_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_ydown_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_ydown_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_ydown_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_ydown_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_yup_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_yup_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca4_2412_yup_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca4_2412_yup_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_00012_xdown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_00012_xdown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_00012_xup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_00012_xup.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_00012_ydown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_00012_ydown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_00012_yup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_00012_yup.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_xdown_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_xdown_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_xdown_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_xdown_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_xup_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_xup_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_xup_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_xup_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_ydown_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_ydown_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_ydown_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_ydown_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_yup_cosine.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_yup_cosine.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23012_yup_linear.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23012_yup_linear.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23112_xdown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23112_xdown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23112_xup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23112_xup.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23112_ydown.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23112_ydown.npy -------------------------------------------------------------------------------- /tests/test_datasets/naca5_23112_yup.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/naca5_23112_yup.npy -------------------------------------------------------------------------------- /tests/test_datasets/parameters.prm: -------------------------------------------------------------------------------- 1 | 2 | [Original parameters] 3 | # This section describes the radial distributions of the parameters: 4 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 5 | # at given radial sections. 6 | 7 | Radial sections = 0.3 8 | 0.4 9 | 0.5 10 | 0.6 11 | 0.7 12 | 0.8 13 | 0.9 14 | 1.0 15 | 16 | Radial distribution of chord = 0.18 17 | 0.2 18 | 0.3 19 | 0.37 20 | 0.41 21 | 0.42 22 | 0.41 23 | 0.1 24 | 25 | Radial distribution of pitch = 1.4 26 | 1.5 27 | 1.58 28 | 1.6 29 | 1.64 30 | 1.61 31 | 1.5 32 | 1.3 33 | 34 | Radial distribution of rake = 0.0 35 | 0.005 36 | 0.013 37 | 0.02 38 | 0.03 39 | 0.029 40 | 0.022 41 | 0.01 42 | 43 | Radial distribution of skew = 3.6 44 | -4.4 45 | -7.4 46 | -7.4 47 | -5.0 48 | -1.3 49 | 4.1 50 | 11.4 51 | 52 | Radial distribution of camber = 0.015 53 | 0.024 54 | 0.029 55 | 0.03 56 | 0.03 57 | 0.028 58 | 0.025 59 | 0.02 60 | 61 | 62 | [Chord B-Spline] 63 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 64 | 65 | # degree of the B-Spline curve 66 | spline degree: 3 67 | 68 | # number of points to be evaluated with the B-Spline interpolation 69 | spline npoints: 500 70 | 71 | # number of the control points 72 | number of control points: 5 73 | 74 | # Y-deformations of the control points. 75 | control points Y-deformations = 1.0 76 | 2.0 77 | 3.0 78 | 4.0 79 | 5.0 80 | 81 | 82 | [Pitch B-Spline] 83 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 84 | 85 | # degree of the B-Spline curve 86 | spline degree: 5 87 | 88 | # number of points to be evaluated with the B-Spline interpolation 89 | spline npoints: 400 90 | 91 | # number of the control points 92 | number of control points: 6 93 | 94 | # Y-deformations of the control points. 95 | control points Y-deformations = 1.0 96 | 2.0 97 | 3.0 98 | 4.0 99 | 5.0 100 | 6.0 101 | 102 | 103 | [Rake B-Spline] 104 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 105 | 106 | # degree of the B-Spline curve 107 | spline degree: 4 108 | 109 | # number of points to be evaluated with the B-Spline interpolation 110 | spline npoints: 300 111 | 112 | # number of the control points 113 | number of control points: 4 114 | 115 | # Y-deformations of the control points. 116 | control points Y-deformations = 1.0 117 | 2.0 118 | 3.0 119 | 4.0 120 | 121 | 122 | [Skew B-Spline] 123 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 124 | 125 | # degree of the B-Spline curve 126 | spline degree: 3 127 | 128 | # number of points to be evaluated with the B-Spline interpolation 129 | spline npoints: 200 130 | 131 | # number of the control points 132 | number of control points: 7 133 | 134 | # Y-deformations of the control points. 135 | control points Y-deformations = 7.0 136 | 6.0 137 | 5.0 138 | 4.0 139 | 3.0 140 | 2.0 141 | 1.0 142 | 143 | 144 | [Camber B-Spline] 145 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 146 | 147 | # degree of the B-Spline curve 148 | spline degree: 2 149 | 150 | # number of points to be evaluated with the B-Spline interpolation 151 | spline npoints: 100 152 | 153 | # number of the control points 154 | number of control points: 5 155 | 156 | # Y-deformations of the control points. 157 | control points Y-deformations = 5.0 158 | 4.0 159 | 3.0 160 | 2.0 161 | 1.0 162 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt.prm: -------------------------------------------------------------------------------- 1 | # Corruption: Radii column has extra element 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 1.5 17 | 18 | Radial distribution of chord = 0.18 19 | 0.2 20 | 0.3 21 | 0.37 22 | 0.41 23 | 0.42 24 | 0.41 25 | 0.1 26 | 27 | Radial distribution of pitch = 1.4 28 | 1.5 29 | 1.58 30 | 1.6 31 | 1.64 32 | 1.61 33 | 1.5 34 | 1.3 35 | 36 | Radial distribution of rake = 0.0 37 | 0.005 38 | 0.013 39 | 0.02 40 | 0.03 41 | 0.029 42 | 0.022 43 | 0.01 44 | 45 | Radial distribution of skew = 3.6 46 | -4.4 47 | -7.4 48 | -7.4 49 | -5.0 50 | -1.3 51 | 4.1 52 | 11.4 53 | 54 | Radial distribution of camber = 0.015 55 | 0.024 56 | 0.029 57 | 0.03 58 | 0.03 59 | 0.028 60 | 0.025 61 | 0.02 62 | 63 | 64 | [Chord B-Spline] 65 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 66 | 67 | # degree of the B-Spline curve 68 | spline degree: 3 69 | 70 | # number of points to be evaluated with the B-Spline interpolation 71 | spline npoints: 500 72 | 73 | # number of the control points 74 | number of control points: 5 75 | 76 | # Y-deformations of the control points. 77 | control points Y-deformations = 1.0 78 | 2.0 79 | 3.0 80 | 4.0 81 | 5.0 82 | 83 | 84 | [Pitch B-Spline] 85 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 86 | 87 | # degree of the B-Spline curve 88 | spline degree: 5 89 | 90 | # number of points to be evaluated with the B-Spline interpolation 91 | spline npoints: 400 92 | 93 | # number of the control points 94 | number of control points: 6 95 | 96 | # Y-deformations of the control points. 97 | control points Y-deformations = 1.0 98 | 2.0 99 | 3.0 100 | 4.0 101 | 5.0 102 | 6.0 103 | 104 | 105 | [Rake B-Spline] 106 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 107 | 108 | # degree of the B-Spline curve 109 | spline degree: 4 110 | 111 | # number of points to be evaluated with the B-Spline interpolation 112 | spline npoints: 300 113 | 114 | # number of the control points 115 | number of control points: 4 116 | 117 | # Y-deformations of the control points. 118 | control points Y-deformations = 1.0 119 | 2.0 120 | 3.0 121 | 4.0 122 | 123 | 124 | [Skew B-Spline] 125 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 126 | 127 | # degree of the B-Spline curve 128 | spline degree: 3 129 | 130 | # number of points to be evaluated with the B-Spline interpolation 131 | spline npoints: 200 132 | 133 | # number of the control points 134 | number of control points: 7 135 | 136 | # Y-deformations of the control points. 137 | control points Y-deformations = 7.0 138 | 6.0 139 | 5.0 140 | 4.0 141 | 3.0 142 | 2.0 143 | 1.0 144 | 145 | 146 | [Camber B-Spline] 147 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 148 | 149 | # degree of the B-Spline curve 150 | spline degree: 2 151 | 152 | # number of points to be evaluated with the B-Spline interpolation 153 | spline npoints: 100 154 | 155 | # number of the control points 156 | number of control points: 5 157 | 158 | # Y-deformations of the control points. 159 | control points Y-deformations = 5.0 160 | 4.0 161 | 3.0 162 | 2.0 163 | 1.0 164 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt_2.prm: -------------------------------------------------------------------------------- 1 | # Corruption: Chord deformation array is empty 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 17 | Radial distribution of chord = 0.18 18 | 0.2 19 | 0.3 20 | 0.37 21 | 0.41 22 | 0.42 23 | 0.41 24 | 0.1 25 | 26 | Radial distribution of pitch = 1.4 27 | 1.5 28 | 1.58 29 | 1.6 30 | 1.64 31 | 1.61 32 | 1.5 33 | 1.3 34 | 35 | Radial distribution of rake = 0.0 36 | 0.005 37 | 0.013 38 | 0.02 39 | 0.03 40 | 0.029 41 | 0.022 42 | 0.01 43 | 44 | Radial distribution of skew = 3.6 45 | -4.4 46 | -7.4 47 | -7.4 48 | -5.0 49 | -1.3 50 | 4.1 51 | 11.4 52 | 53 | Radial distribution of camber = 0.015 54 | 0.024 55 | 0.029 56 | 0.03 57 | 0.03 58 | 0.028 59 | 0.025 60 | 0.02 61 | 62 | 63 | [Chord B-Spline] 64 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 65 | 66 | # degree of the B-Spline curve 67 | spline degree: 3 68 | 69 | # number of points to be evaluated with the B-Spline interpolation 70 | spline npoints: 500 71 | 72 | # number of the control points 73 | number of control points: 5 74 | 75 | # Y-deformations of the control points. 76 | control points Y-deformations = 77 | 78 | [Pitch B-Spline] 79 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 80 | 81 | # degree of the B-Spline curve 82 | spline degree: 5 83 | 84 | # number of points to be evaluated with the B-Spline interpolation 85 | spline npoints: 400 86 | 87 | # number of the control points 88 | number of control points: 6 89 | 90 | # Y-deformations of the control points. 91 | control points Y-deformations = 1.0 92 | 2.0 93 | 3.0 94 | 4.0 95 | 5.0 96 | 6.0 97 | 98 | 99 | [Rake B-Spline] 100 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 101 | 102 | # degree of the B-Spline curve 103 | spline degree: 4 104 | 105 | # number of points to be evaluated with the B-Spline interpolation 106 | spline npoints: 300 107 | 108 | # number of the control points 109 | number of control points: 4 110 | 111 | # Y-deformations of the control points. 112 | control points Y-deformations = 1.0 113 | 2.0 114 | 3.0 115 | 4.0 116 | 117 | 118 | [Skew B-Spline] 119 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 120 | 121 | # degree of the B-Spline curve 122 | spline degree: 3 123 | 124 | # number of points to be evaluated with the B-Spline interpolation 125 | spline npoints: 200 126 | 127 | # number of the control points 128 | number of control points: 7 129 | 130 | # Y-deformations of the control points. 131 | control points Y-deformations = 7.0 132 | 6.0 133 | 5.0 134 | 4.0 135 | 3.0 136 | 2.0 137 | 1.0 138 | 139 | 140 | [Camber B-Spline] 141 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 142 | 143 | # degree of the B-Spline curve 144 | spline degree: 2 145 | 146 | # number of points to be evaluated with the B-Spline interpolation 147 | spline npoints: 100 148 | 149 | # number of the control points 150 | number of control points: 5 151 | 152 | # Y-deformations of the control points. 153 | control points Y-deformations = 5.0 154 | 4.0 155 | 3.0 156 | 2.0 157 | 1.0 158 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt_3.prm: -------------------------------------------------------------------------------- 1 | # Corruption: Chord deformation array is not 1D 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 17 | Radial distribution of chord = 0.18 18 | 0.2 19 | 0.3 20 | 0.37 21 | 0.41 22 | 0.42 23 | 0.41 24 | 0.1 25 | 26 | Radial distribution of pitch = 1.4 27 | 1.5 28 | 1.58 29 | 1.6 30 | 1.64 31 | 1.61 32 | 1.5 33 | 1.3 34 | 35 | Radial distribution of rake = 0.0 36 | 0.005 37 | 0.013 38 | 0.02 39 | 0.03 40 | 0.029 41 | 0.022 42 | 0.01 43 | 44 | Radial distribution of skew = 3.6 45 | -4.4 46 | -7.4 47 | -7.4 48 | -5.0 49 | -1.3 50 | 4.1 51 | 11.4 52 | 53 | Radial distribution of camber = 0.015 54 | 0.024 55 | 0.029 56 | 0.03 57 | 0.03 58 | 0.028 59 | 0.025 60 | 0.02 61 | 62 | 63 | [Chord B-Spline] 64 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 65 | 66 | # degree of the B-Spline curve 67 | spline degree: 3 68 | 69 | # number of points to be evaluated with the B-Spline interpolation 70 | spline npoints: 500 71 | 72 | # number of the control points 73 | number of control points: 5 74 | 75 | # Y-deformations of the control points. 76 | control points Y-deformations = 1.0 1.5 77 | 2.0 78 | 3.0 79 | 4.0 80 | 5.0 81 | 82 | 83 | [Pitch B-Spline] 84 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 85 | 86 | # degree of the B-Spline curve 87 | spline degree: 5 88 | 89 | # number of points to be evaluated with the B-Spline interpolation 90 | spline npoints: 400 91 | 92 | # number of the control points 93 | number of control points: 6 94 | 95 | # Y-deformations of the control points. 96 | control points Y-deformations = 1.0 97 | 2.0 98 | 3.0 99 | 4.0 100 | 5.0 101 | 6.0 102 | 103 | 104 | [Rake B-Spline] 105 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 106 | 107 | # degree of the B-Spline curve 108 | spline degree: 4 109 | 110 | # number of points to be evaluated with the B-Spline interpolation 111 | spline npoints: 300 112 | 113 | # number of the control points 114 | number of control points: 4 115 | 116 | # Y-deformations of the control points. 117 | control points Y-deformations = 1.0 118 | 2.0 119 | 3.0 120 | 4.0 121 | 122 | 123 | [Skew B-Spline] 124 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 125 | 126 | # degree of the B-Spline curve 127 | spline degree: 3 128 | 129 | # number of points to be evaluated with the B-Spline interpolation 130 | spline npoints: 200 131 | 132 | # number of the control points 133 | number of control points: 7 134 | 135 | # Y-deformations of the control points. 136 | control points Y-deformations = 7.0 137 | 6.0 138 | 5.0 139 | 4.0 140 | 3.0 141 | 2.0 142 | 1.0 143 | 144 | 145 | [Camber B-Spline] 146 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 147 | 148 | # degree of the B-Spline curve 149 | spline degree: 2 150 | 151 | # number of points to be evaluated with the B-Spline interpolation 152 | spline npoints: 100 153 | 154 | # number of the control points 155 | number of control points: 5 156 | 157 | # Y-deformations of the control points. 158 | control points Y-deformations = 5.0 159 | 4.0 160 | 3.0 161 | 2.0 162 | 1.0 163 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt_4.prm: -------------------------------------------------------------------------------- 1 | # corruption: Chord nbasis not equal deformations 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 17 | Radial distribution of chord = 0.18 18 | 0.2 19 | 0.3 20 | 0.37 21 | 0.41 22 | 0.42 23 | 0.41 24 | 0.1 25 | 26 | Radial distribution of pitch = 1.4 27 | 1.5 28 | 1.58 29 | 1.6 30 | 1.64 31 | 1.61 32 | 1.5 33 | 1.3 34 | 35 | Radial distribution of rake = 0.0 36 | 0.005 37 | 0.013 38 | 0.02 39 | 0.03 40 | 0.029 41 | 0.022 42 | 0.01 43 | 44 | Radial distribution of skew = 3.6 45 | -4.4 46 | -7.4 47 | -7.4 48 | -5.0 49 | -1.3 50 | 4.1 51 | 11.4 52 | 53 | Radial distribution of camber = 0.015 54 | 0.024 55 | 0.029 56 | 0.03 57 | 0.03 58 | 0.028 59 | 0.025 60 | 0.02 61 | 62 | 63 | [Chord B-Spline] 64 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 65 | 66 | # degree of the B-Spline curve 67 | spline degree: 3 68 | 69 | # number of points to be evaluated with the B-Spline interpolation 70 | spline npoints: 500 71 | 72 | # number of the control points 73 | number of control points: 9 74 | 75 | # Y-deformations of the control points. 76 | control points Y-deformations = 1.0 77 | 2.0 78 | 3.0 79 | 4.0 80 | 5.0 81 | 82 | 83 | [Pitch B-Spline] 84 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 85 | 86 | # degree of the B-Spline curve 87 | spline degree: 5 88 | 89 | # number of points to be evaluated with the B-Spline interpolation 90 | spline npoints: 400 91 | 92 | # number of the control points 93 | number of control points: 6 94 | 95 | # Y-deformations of the control points. 96 | control points Y-deformations = 1.0 97 | 2.0 98 | 3.0 99 | 4.0 100 | 5.0 101 | 6.0 102 | 103 | 104 | [Rake B-Spline] 105 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 106 | 107 | # degree of the B-Spline curve 108 | spline degree: 4 109 | 110 | # number of points to be evaluated with the B-Spline interpolation 111 | spline npoints: 300 112 | 113 | # number of the control points 114 | number of control points: 4 115 | 116 | # Y-deformations of the control points. 117 | control points Y-deformations = 1.0 118 | 2.0 119 | 3.0 120 | 4.0 121 | 122 | 123 | [Skew B-Spline] 124 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 125 | 126 | # degree of the B-Spline curve 127 | spline degree: 3 128 | 129 | # number of points to be evaluated with the B-Spline interpolation 130 | spline npoints: 200 131 | 132 | # number of the control points 133 | number of control points: 7 134 | 135 | # Y-deformations of the control points. 136 | control points Y-deformations = 7.0 137 | 6.0 138 | 5.0 139 | 4.0 140 | 3.0 141 | 2.0 142 | 1.0 143 | 144 | 145 | [Camber B-Spline] 146 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 147 | 148 | # degree of the B-Spline curve 149 | spline degree: 2 150 | 151 | # number of points to be evaluated with the B-Spline interpolation 152 | spline npoints: 100 153 | 154 | # number of the control points 155 | number of control points: 5 156 | 157 | # Y-deformations of the control points. 158 | control points Y-deformations = 5.0 159 | 4.0 160 | 3.0 161 | 2.0 162 | 1.0 163 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt_5.prm: -------------------------------------------------------------------------------- 1 | # Corruption: a radial section has double values on same line 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 0.6 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 17 | Radial distribution of chord = 0.18 18 | 0.2 19 | 0.3 20 | 0.37 21 | 0.41 22 | 0.42 23 | 0.41 24 | 0.1 25 | 26 | Radial distribution of pitch = 1.4 27 | 1.5 28 | 1.58 29 | 1.6 30 | 1.64 31 | 1.61 32 | 1.5 33 | 1.3 34 | 35 | Radial distribution of rake = 0.0 36 | 0.005 37 | 0.013 38 | 0.02 39 | 0.03 40 | 0.029 41 | 0.022 42 | 0.01 43 | 44 | Radial distribution of skew = 3.6 45 | -4.4 46 | -7.4 47 | -7.4 48 | -5.0 49 | -1.3 50 | 4.1 51 | 11.4 52 | 53 | Radial distribution of camber = 0.015 54 | 0.024 55 | 0.029 56 | 0.03 57 | 0.03 58 | 0.028 59 | 0.025 60 | 0.02 61 | 62 | 63 | [Chord B-Spline] 64 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 65 | 66 | # degree of the B-Spline curve 67 | spline degree: 3 68 | 69 | # number of points to be evaluated with the B-Spline interpolation 70 | spline npoints: 500 71 | 72 | # number of the control points 73 | number of control points: 5 74 | 75 | # Y-deformations of the control points. 76 | control points Y-deformations = 1.0 77 | 2.0 78 | 3.0 79 | 4.0 80 | 5.0 81 | 82 | 83 | [Pitch B-Spline] 84 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 85 | 86 | # degree of the B-Spline curve 87 | spline degree: 5 88 | 89 | # number of points to be evaluated with the B-Spline interpolation 90 | spline npoints: 400 91 | 92 | # number of the control points 93 | number of control points: 6 94 | 95 | # Y-deformations of the control points. 96 | control points Y-deformations = 1.0 97 | 2.0 98 | 3.0 99 | 4.0 100 | 5.0 101 | 6.0 102 | 103 | 104 | [Rake B-Spline] 105 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 106 | 107 | # degree of the B-Spline curve 108 | spline degree: 4 109 | 110 | # number of points to be evaluated with the B-Spline interpolation 111 | spline npoints: 300 112 | 113 | # number of the control points 114 | number of control points: 4 115 | 116 | # Y-deformations of the control points. 117 | control points Y-deformations = 1.0 118 | 2.0 119 | 3.0 120 | 4.0 121 | 122 | 123 | [Skew B-Spline] 124 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 125 | 126 | # degree of the B-Spline curve 127 | spline degree: 3 128 | 129 | # number of points to be evaluated with the B-Spline interpolation 130 | spline npoints: 200 131 | 132 | # number of the control points 133 | number of control points: 7 134 | 135 | # Y-deformations of the control points. 136 | control points Y-deformations = 7.0 137 | 6.0 138 | 5.0 139 | 4.0 140 | 3.0 141 | 2.0 142 | 1.0 143 | 144 | 145 | [Camber B-Spline] 146 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 147 | 148 | # degree of the B-Spline curve 149 | spline degree: 2 150 | 151 | # number of points to be evaluated with the B-Spline interpolation 152 | spline npoints: 100 153 | 154 | # number of the control points 155 | number of control points: 5 156 | 157 | # Y-deformations of the control points. 158 | control points Y-deformations = 5.0 159 | 4.0 160 | 3.0 161 | 2.0 162 | 1.0 163 | -------------------------------------------------------------------------------- /tests/test_datasets/parameters_corrupt_6.prm: -------------------------------------------------------------------------------- 1 | # Corruption: Radial distribution of chord is not 1D 2 | 3 | [Original parameters] 4 | # This section describes the radial distributions of the parameters: 5 | # "chord lengths", "pitch", "rake", "skew angles", and "camber" 6 | # at given radial sections. 7 | 8 | Radial sections = 0.3 9 | 0.4 10 | 0.5 11 | 0.6 12 | 0.7 13 | 0.8 14 | 0.9 15 | 1.0 16 | 17 | Radial distribution of chord = 0.18 0.1 18 | 0.2 19 | 0.3 20 | 0.37 21 | 0.41 22 | 0.42 23 | 0.41 24 | 0.1 25 | 26 | Radial distribution of pitch = 1.4 27 | 1.5 28 | 1.58 29 | 1.6 30 | 1.64 31 | 1.61 32 | 1.5 33 | 1.3 34 | 35 | Radial distribution of rake = 0.0 36 | 0.005 37 | 0.013 38 | 0.02 39 | 0.03 40 | 0.029 41 | 0.022 42 | 0.01 43 | 44 | Radial distribution of skew = 3.6 45 | -4.4 46 | -7.4 47 | -7.4 48 | -5.0 49 | -1.3 50 | 4.1 51 | 11.4 52 | 53 | Radial distribution of camber = 0.015 54 | 0.024 55 | 0.029 56 | 0.03 57 | 0.03 58 | 0.028 59 | 0.025 60 | 0.02 61 | 62 | 63 | [Chord B-Spline] 64 | # This section describes the B-Spline construction of the RADII -- CHORD curve. 65 | 66 | # degree of the B-Spline curve 67 | spline degree: 3 68 | 69 | # number of points to be evaluated with the B-Spline interpolation 70 | spline npoints: 500 71 | 72 | # number of the control points 73 | number of control points: 5 74 | 75 | # Y-deformations of the control points. 76 | control points Y-deformations = 1.0 77 | 2.0 78 | 3.0 79 | 4.0 80 | 5.0 81 | 82 | 83 | [Pitch B-Spline] 84 | # This section describes the B-Spline construction of the RADII -- PITCH curve. 85 | 86 | # degree of the B-Spline curve 87 | spline degree: 5 88 | 89 | # number of points to be evaluated with the B-Spline interpolation 90 | spline npoints: 400 91 | 92 | # number of the control points 93 | number of control points: 6 94 | 95 | # Y-deformations of the control points. 96 | control points Y-deformations = 1.0 97 | 2.0 98 | 3.0 99 | 4.0 100 | 5.0 101 | 6.0 102 | 103 | 104 | [Rake B-Spline] 105 | # This section describes the B-Spline construction of the RADII -- RAKE curve. 106 | 107 | # degree of the B-Spline curve 108 | spline degree: 4 109 | 110 | # number of points to be evaluated with the B-Spline interpolation 111 | spline npoints: 300 112 | 113 | # number of the control points 114 | number of control points: 4 115 | 116 | # Y-deformations of the control points. 117 | control points Y-deformations = 1.0 118 | 2.0 119 | 3.0 120 | 4.0 121 | 122 | 123 | [Skew B-Spline] 124 | # This section describes the B-Spline construction of the RADII -- SKEW curve. 125 | 126 | # degree of the B-Spline curve 127 | spline degree: 3 128 | 129 | # number of points to be evaluated with the B-Spline interpolation 130 | spline npoints: 200 131 | 132 | # number of the control points 133 | number of control points: 7 134 | 135 | # Y-deformations of the control points. 136 | control points Y-deformations = 7.0 137 | 6.0 138 | 5.0 139 | 4.0 140 | 3.0 141 | 2.0 142 | 1.0 143 | 144 | 145 | [Camber B-Spline] 146 | # This section describes the B-Spline construction of the RADII -- CAMBER curve. 147 | 148 | # degree of the B-Spline curve 149 | spline degree: 2 150 | 151 | # number of points to be evaluated with the B-Spline interpolation 152 | spline npoints: 100 153 | 154 | # number of the control points 155 | number of control points: 5 156 | 157 | # Y-deformations of the control points. 158 | control points Y-deformations = 5.0 159 | 4.0 160 | 3.0 161 | 2.0 162 | 1.0 163 | -------------------------------------------------------------------------------- /tests/test_datasets/pitch_control_points.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/pitch_control_points.npy -------------------------------------------------------------------------------- /tests/test_datasets/pitch_control_points_no_rbf.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/pitch_control_points_no_rbf.npy -------------------------------------------------------------------------------- /tests/test_datasets/pitch_updated_control_points.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/pitch_updated_control_points.npy -------------------------------------------------------------------------------- /tests/test_datasets/planar_to_cylindrical_blade_down.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/planar_to_cylindrical_blade_down.npy -------------------------------------------------------------------------------- /tests/test_datasets/planar_to_cylindrical_blade_up.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tests/test_datasets/planar_to_cylindrical_blade_up.npy -------------------------------------------------------------------------------- /tests/test_datasets/tip.stl: -------------------------------------------------------------------------------- 1 | solid 2 | facet normal 0.000000e+00 0.000000e+00 0.000000e+00 3 | outer loop 4 | vertex -3.175888e+00 -1.345305e+01 -1.242740e+02 5 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 6 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 7 | endloop 8 | endfacet 9 | facet normal 1.179049e-03 1.084650e-01 9.940996e-01 10 | outer loop 11 | vertex -3.139677e+00 -1.353592e+01 -1.242650e+02 12 | vertex -3.175888e+00 -1.345305e+01 -1.242740e+02 13 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 14 | endloop 15 | endfacet 16 | facet normal 4.053324e-03 1.105537e-01 9.938619e-01 17 | outer loop 18 | vertex -3.194991e+00 -1.418762e+01 -1.241922e+02 19 | vertex -3.139677e+00 -1.353592e+01 -1.242650e+02 20 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 21 | endloop 22 | endfacet 23 | facet normal 3.489896e-03 1.105068e-01 9.938692e-01 24 | outer loop 25 | vertex -3.638082e+00 -1.452557e+01 -1.241531e+02 26 | vertex -3.194991e+00 -1.418762e+01 -1.241922e+02 27 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 28 | endloop 29 | endfacet 30 | facet normal -1.086888e-02 1.256762e-01 9.920118e-01 31 | outer loop 32 | vertex -4.050380e+00 -1.569629e+01 -1.240105e+02 33 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 34 | vertex -3.194991e+00 -1.418762e+01 -1.241922e+02 35 | endloop 36 | endfacet 37 | facet normal -6.246525e-03 1.230991e-01 9.923747e-01 38 | outer loop 39 | vertex -4.050380e+00 -1.569629e+01 -1.240105e+02 40 | vertex -3.194991e+00 -1.418762e+01 -1.241922e+02 41 | vertex -3.638082e+00 -1.452557e+01 -1.241531e+02 42 | endloop 43 | endfacet 44 | facet normal 3.009248e-01 1.019581e-02 9.535934e-01 45 | outer loop 46 | vertex -4.050380e+00 -1.569629e+01 -1.240105e+02 47 | vertex -3.638082e+00 -1.452557e+01 -1.241531e+02 48 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 49 | endloop 50 | endfacet 51 | facet normal 4.025062e-01 -2.857826e-02 9.149710e-01 52 | outer loop 53 | vertex -4.481266e+00 -1.686180e+01 -1.238573e+02 54 | vertex -4.050380e+00 -1.569629e+01 -1.240105e+02 55 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 56 | endloop 57 | endfacet 58 | facet normal 1.940579e-03 1.295742e-01 9.915678e-01 59 | outer loop 60 | vertex -4.481266e+00 -1.686180e+01 -1.238573e+02 61 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 62 | vertex -4.050380e+00 -1.569629e+01 -1.240105e+02 63 | endloop 64 | endfacet 65 | facet normal 4.850209e-01 -6.249950e-02 8.722663e-01 66 | outer loop 67 | vertex -4.925029e+00 -1.802236e+01 -1.236937e+02 68 | vertex -4.481266e+00 -1.686180e+01 -1.238573e+02 69 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 70 | endloop 71 | endfacet 72 | facet normal -2.503845e-03 1.405217e-01 9.900744e-01 73 | outer loop 74 | vertex -4.925029e+00 -1.802236e+01 -1.236937e+02 75 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 76 | vertex -4.481266e+00 -1.686180e+01 -1.238573e+02 77 | endloop 78 | endfacet 79 | facet normal 1.771943e-01 6.456089e-02 9.820560e-01 80 | outer loop 81 | vertex -5.379046e+00 -1.917831e+01 -1.235197e+02 82 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 83 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 84 | endloop 85 | endfacet 86 | facet normal 5.488479e-01 -9.048320e-02 8.310107e-01 87 | outer loop 88 | vertex -5.379046e+00 -1.917831e+01 -1.235197e+02 89 | vertex -4.925029e+00 -1.802236e+01 -1.236937e+02 90 | vertex -3.264657e+00 -1.336603e+01 -1.242833e+02 91 | endloop 92 | endfacet 93 | facet normal -2.593015e-02 1.587469e-01 9.869787e-01 94 | outer loop 95 | vertex -5.379046e+00 -1.917831e+01 -1.235197e+02 96 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 97 | vertex -4.925029e+00 -1.802236e+01 -1.236937e+02 98 | endloop 99 | endfacet 100 | facet normal -7.044789e-02 1.852200e-01 9.801687e-01 101 | outer loop 102 | vertex -5.841773e+00 -2.032972e+01 -1.233354e+02 103 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 104 | vertex -5.379046e+00 -1.917831e+01 -1.235197e+02 105 | endloop 106 | endfacet 107 | facet normal 7.168991e-02 1.295092e-01 9.889833e-01 108 | outer loop 109 | vertex -5.841773e+00 -2.032972e+01 -1.233354e+02 110 | vertex -5.379046e+00 -1.917831e+01 -1.235197e+02 111 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 112 | endloop 113 | endfacet 114 | facet normal -1.605756e-01 2.310563e-01 9.595981e-01 115 | outer loop 116 | vertex -6.312271e+00 -2.147665e+01 -1.231408e+02 117 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 118 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 119 | endloop 120 | endfacet 121 | facet normal -1.391941e-01 2.208659e-01 9.653203e-01 122 | outer loop 123 | vertex -6.312271e+00 -2.147665e+01 -1.231408e+02 124 | vertex -3.777128e+00 -1.658113e+01 -1.238954e+02 125 | vertex -5.841773e+00 -2.032972e+01 -1.233354e+02 126 | endloop 127 | endfacet 128 | facet normal 3.753568e-02 1.521541e-01 9.876438e-01 129 | outer loop 130 | vertex -6.312271e+00 -2.147665e+01 -1.231408e+02 131 | vertex -5.841773e+00 -2.032972e+01 -1.233354e+02 132 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 133 | endloop 134 | endfacet 135 | facet normal -1.084818e-01 2.191531e-01 9.696410e-01 136 | outer loop 137 | vertex -6.790083e+00 -2.261901e+01 -1.229361e+02 138 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 139 | vertex -6.312271e+00 -2.147665e+01 -1.231408e+02 140 | endloop 141 | endfacet 142 | facet normal 1.321264e-02 1.710364e-01 9.851761e-01 143 | outer loop 144 | vertex -6.790083e+00 -2.261901e+01 -1.229361e+02 145 | vertex -6.312271e+00 -2.147665e+01 -1.231408e+02 146 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 147 | endloop 148 | endfacet 149 | facet normal -5.888509e-02 2.093629e-01 9.760634e-01 150 | outer loop 151 | vertex -7.274725e+00 -2.375677e+01 -1.227213e+02 152 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 153 | vertex -6.790083e+00 -2.261901e+01 -1.229361e+02 154 | endloop 155 | endfacet 156 | facet normal 1.619131e-04 1.854551e-01 9.826527e-01 157 | outer loop 158 | vertex -7.274725e+00 -2.375677e+01 -1.227213e+02 159 | vertex -6.790083e+00 -2.261901e+01 -1.229361e+02 160 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 161 | endloop 162 | endfacet 163 | facet normal -9.487168e-04 1.949900e-01 9.808048e-01 164 | outer loop 165 | vertex -7.766236e+00 -2.488970e+01 -1.224965e+02 166 | vertex -7.274725e+00 -2.375677e+01 -1.227213e+02 167 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 168 | endloop 169 | endfacet 170 | facet normal -2.503582e-02 2.049723e-01 9.784475e-01 171 | outer loop 172 | vertex -7.766236e+00 -2.488970e+01 -1.224965e+02 173 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 174 | vertex -7.274725e+00 -2.375677e+01 -1.227213e+02 175 | endloop 176 | endfacet 177 | facet normal 9.846769e-03 1.994445e-01 9.798596e-01 178 | outer loop 179 | vertex -8.264647e+00 -2.601755e+01 -1.222620e+02 180 | vertex -7.766236e+00 -2.488970e+01 -1.224965e+02 181 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 182 | endloop 183 | endfacet 184 | facet normal -5.153258e-03 2.058069e-01 9.785791e-01 185 | outer loop 186 | vertex -8.264647e+00 -2.601755e+01 -1.222620e+02 187 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 188 | vertex -7.766236e+00 -2.488970e+01 -1.224965e+02 189 | endloop 190 | endfacet 191 | facet normal 3.175387e-02 1.988044e-01 9.795246e-01 192 | outer loop 193 | vertex -8.766672e+00 -2.713222e+01 -1.220195e+02 194 | vertex -8.264647e+00 -2.601755e+01 -1.222620e+02 195 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 196 | endloop 197 | endfacet 198 | facet normal 1.917815e-03 2.117622e-01 9.773193e-01 199 | outer loop 200 | vertex -8.766672e+00 -2.713222e+01 -1.220195e+02 201 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 202 | vertex -8.264647e+00 -2.601755e+01 -1.222620e+02 203 | endloop 204 | endfacet 205 | facet normal 6.312959e-02 1.933589e-01 9.790950e-01 206 | outer loop 207 | vertex -9.275936e+00 -2.824069e+01 -1.217677e+02 208 | vertex -8.766672e+00 -2.713222e+01 -1.220195e+02 209 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 210 | endloop 211 | endfacet 212 | facet normal -3.141957e-03 2.228418e-01 9.748496e-01 213 | outer loop 214 | vertex -9.275936e+00 -2.824069e+01 -1.217677e+02 215 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 216 | vertex -8.766672e+00 -2.713222e+01 -1.220195e+02 217 | endloop 218 | endfacet 219 | facet normal 1.015323e-01 1.837044e-01 9.777238e-01 220 | outer loop 221 | vertex -9.794055e+00 -2.934370e+01 -1.215067e+02 222 | vertex -9.275936e+00 -2.824069e+01 -1.217677e+02 223 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 224 | endloop 225 | endfacet 226 | facet normal -2.055280e-02 2.393909e-01 9.707057e-01 227 | outer loop 228 | vertex -9.794055e+00 -2.934370e+01 -1.215067e+02 229 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 230 | vertex -9.275936e+00 -2.824069e+01 -1.217677e+02 231 | endloop 232 | endfacet 233 | facet normal 2.397058e-01 1.369552e-01 9.611370e-01 234 | outer loop 235 | vertex -1.032284e+01 -3.044067e+01 -1.212365e+02 236 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 237 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 238 | endloop 239 | endfacet 240 | facet normal 1.431705e-01 1.710253e-01 9.748090e-01 241 | outer loop 242 | vertex -1.032284e+01 -3.044067e+01 -1.212365e+02 243 | vertex -9.794055e+00 -2.934370e+01 -1.215067e+02 244 | vertex -8.208372e+00 -2.386165e+01 -1.227014e+02 245 | endloop 246 | endfacet 247 | facet normal -5.177667e-02 2.622405e-01 9.636125e-01 248 | outer loop 249 | vertex -1.032284e+01 -3.044067e+01 -1.212365e+02 250 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 251 | vertex -9.794055e+00 -2.934370e+01 -1.215067e+02 252 | endloop 253 | endfacet 254 | facet normal -3.071206e-01 4.063534e-01 8.605544e-01 255 | outer loop 256 | vertex -1.086675e+01 -3.153021e+01 -1.209578e+02 257 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 258 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 259 | endloop 260 | endfacet 261 | facet normal 5.142256e-01 -3.751173e-02 8.568342e-01 262 | outer loop 263 | vertex -1.086675e+01 -3.153021e+01 -1.209578e+02 264 | vertex -1.032284e+01 -3.044067e+01 -1.212365e+02 265 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 266 | endloop 267 | endfacet 268 | facet normal -1.017118e-01 2.939102e-01 9.504060e-01 269 | outer loop 270 | vertex -1.086675e+01 -3.153021e+01 -1.209578e+02 271 | vertex -7.694170e+00 -2.666545e+01 -1.221227e+02 272 | vertex -1.032284e+01 -3.044067e+01 -1.212365e+02 273 | endloop 274 | endfacet 275 | facet normal 7.355307e-01 -2.169901e-01 6.418021e-01 276 | outer loop 277 | vertex -1.143503e+01 -3.260938e+01 -1.206714e+02 278 | vertex -1.086675e+01 -3.153021e+01 -1.209578e+02 279 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 280 | endloop 281 | endfacet 282 | facet normal -7.355307e-01 2.169901e-01 -6.418021e-01 283 | outer loop 284 | vertex -1.143503e+01 -3.260938e+01 -1.206714e+02 285 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 286 | vertex -1.086675e+01 -3.153021e+01 -1.209578e+02 287 | endloop 288 | endfacet 289 | facet normal 8.790610e-01 -4.070018e-01 2.481961e-01 290 | outer loop 291 | vertex -1.201531e+01 -3.368272e+01 -1.203763e+02 292 | vertex -1.143503e+01 -3.260938e+01 -1.206714e+02 293 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 294 | endloop 295 | endfacet 296 | facet normal -8.790610e-01 4.070018e-01 -2.481961e-01 297 | outer loop 298 | vertex -1.201531e+01 -3.368272e+01 -1.203763e+02 299 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 300 | vertex -1.143503e+01 -3.260938e+01 -1.206714e+02 301 | endloop 302 | endfacet 303 | facet normal 0.000000e+00 0.000000e+00 0.000000e+00 304 | outer loop 305 | vertex -1.260609e+01 -3.476831e+01 -1.200673e+02 306 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 307 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 308 | endloop 309 | endfacet 310 | facet normal 8.854526e-01 -4.551514e-01 9.386639e-02 311 | outer loop 312 | vertex -1.260609e+01 -3.476831e+01 -1.200673e+02 313 | vertex -1.201531e+01 -3.368272e+01 -1.203763e+02 314 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 315 | endloop 316 | endfacet 317 | facet normal -8.854526e-01 4.551514e-01 -9.386639e-02 318 | outer loop 319 | vertex -1.260609e+01 -3.476831e+01 -1.200673e+02 320 | vertex -1.318501e+01 -3.583009e+01 -1.197548e+02 321 | vertex -1.201531e+01 -3.368272e+01 -1.203763e+02 322 | endloop 323 | endfacet 324 | endsolid 325 | -------------------------------------------------------------------------------- /tests/test_ndinterpolator.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | import bladex.ndinterpolator as nd 3 | import numpy as np 4 | 5 | 6 | def sample_data(): 7 | x = np.arange(10) 8 | y = x * x 9 | xx = np.linspace(0, 9, 1000) 10 | yy = np.zeros(1000) 11 | 12 | return x, y, xx, yy 13 | 14 | 15 | class TestRBF(TestCase): 16 | def test_gaussian_basis_member(self): 17 | rbf = nd.RBF(basis='gaussian_spline', radius=1.) 18 | assert rbf.basis == rbf.gaussian_spline 19 | 20 | def test_biharmonic_basis_member(self): 21 | rbf = nd.RBF(basis='multi_quadratic_biharmonic_spline', radius=1.) 22 | assert rbf.basis == rbf.multi_quadratic_biharmonic_spline 23 | 24 | def test_inv_biharmonic_basis_member(self): 25 | rbf = nd.RBF(basis='inv_multi_quadratic_biharmonic_spline', radius=1.) 26 | assert rbf.basis == rbf.inv_multi_quadratic_biharmonic_spline 27 | 28 | def test_thin_plate_basis_member(self): 29 | rbf = nd.RBF(basis='thin_plate_spline', radius=1.) 30 | assert rbf.basis == rbf.thin_plate_spline 31 | 32 | def test_wendland_basis_member(self): 33 | rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.) 34 | assert rbf.basis == rbf.beckert_wendland_c2_basis 35 | 36 | def test_radius_member(self): 37 | rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.) 38 | assert rbf.radius == 1.0 39 | 40 | def test_wrong_basis(self): 41 | with self.assertRaises(NameError): 42 | rbf = nd.RBF(basis='wendland', radius=1.) 43 | 44 | def test_gaussian_evaluation(self): 45 | rbf = nd.RBF(basis='gaussian_spline', radius=1.) 46 | result = rbf.basis(X=1., r=1.) 47 | np.testing.assert_almost_equal(result, 0.36787944117144233) 48 | 49 | def test_biharmonic_evaluation(self): 50 | rbf = nd.RBF(basis='multi_quadratic_biharmonic_spline', radius=1.) 51 | result = rbf.basis(X=1., r=1.) 52 | np.testing.assert_almost_equal(result, 1.4142135623730951) 53 | 54 | def test_inv_biharmonic_evaluation(self): 55 | rbf = nd.RBF(basis='inv_multi_quadratic_biharmonic_spline', radius=1.) 56 | result = rbf.basis(X=1., r=1.) 57 | np.testing.assert_almost_equal(result, 0.7071067811865475) 58 | 59 | def test_thin_plate_evaluation(self): 60 | rbf = nd.RBF(basis='thin_plate_spline', radius=1.) 61 | result = rbf.basis(X=1., r=0.5) 62 | np.testing.assert_almost_equal(result, 2.772588722239781) 63 | 64 | def test_wendland_evaluation(self): 65 | rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.) 66 | result = rbf.basis(X=1., r=2.) 67 | np.testing.assert_almost_equal(result, 0.1875) 68 | 69 | def test_wendland_outside_cutoff(self): 70 | rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.) 71 | result = rbf.basis(X=2., r=1.) 72 | np.testing.assert_almost_equal(result, 0.0) 73 | 74 | def test_weight_matrix(self): 75 | x = np.arange(10) 76 | rbf = nd.RBF(basis='beckert_wendland_c2_basis', radius=1.) 77 | weights_matrix = rbf.weights_matrix(X1=x, X2=x) 78 | expected = np.diag(np.ones(10)) 79 | np.testing.assert_array_almost_equal(weights_matrix, expected) 80 | 81 | def test_reconstruct_f_gaussian(self): 82 | x, y, xx, yy = sample_data() 83 | nd.reconstruct_f( 84 | original_input=x, 85 | original_output=y, 86 | rbf_input=xx, 87 | rbf_output=yy, 88 | basis='gaussian_spline', 89 | radius=10.) 90 | # assert that the argmin(xx) nearest to point x=4.5 is the same index 91 | # for argmin(yy) nearest to point y=20.25, where y=x*x 92 | idx = (np.abs(xx - 4.5)).argmin() 93 | idx2 = (np.abs(yy - 20.25)).argmin() 94 | np.testing.assert_array_almost_equal(idx, idx2) 95 | 96 | def test_reconstruct_f_biharmonic(self): 97 | x, y, xx, yy = sample_data() 98 | nd.reconstruct_f( 99 | original_input=x, 100 | original_output=y, 101 | rbf_input=xx, 102 | rbf_output=yy, 103 | basis='multi_quadratic_biharmonic_spline', 104 | radius=10.) 105 | # assert that the argmin(xx) nearest to point x=4.5 is the same index 106 | # for argmin(yy) nearest to point y=20.25, where y=x*x 107 | idx = (np.abs(xx - 4.5)).argmin() 108 | idx2 = (np.abs(yy - 20.25)).argmin() 109 | np.testing.assert_array_almost_equal(idx, idx2) 110 | 111 | def test_reconstruct_f_inv_biharmonic(self): 112 | x, y, xx, yy = sample_data() 113 | nd.reconstruct_f( 114 | original_input=x, 115 | original_output=y, 116 | rbf_input=xx, 117 | rbf_output=yy, 118 | basis='inv_multi_quadratic_biharmonic_spline', 119 | radius=10.) 120 | # assert that the argmin(xx) nearest to point x=4.5 is the same index 121 | # for argmin(yy) nearest to point y=20.25, where y=x*x 122 | idx = (np.abs(xx - 4.5)).argmin() 123 | idx2 = (np.abs(yy - 20.25)).argmin() 124 | np.testing.assert_array_almost_equal(idx, idx2) 125 | 126 | def test_reconstruct_f_plate(self): 127 | x, y, xx, yy = sample_data() 128 | nd.reconstruct_f( 129 | original_input=x, 130 | original_output=y, 131 | rbf_input=xx, 132 | rbf_output=yy, 133 | basis='thin_plate_spline', 134 | radius=20.) 135 | # assert that the argmin(xx) nearest to point x=4.5 is the same index 136 | # for argmin(yy) nearest to point y=20.25, where y=x*x 137 | idx = (np.abs(xx - 4.5)).argmin() 138 | idx2 = (np.abs(yy - 20.25)).argmin() 139 | np.testing.assert_array_almost_equal(idx, idx2) 140 | 141 | def test_reconstruct_f_wendland(self): 142 | x, y, xx, yy = sample_data() 143 | nd.reconstruct_f( 144 | original_input=x, 145 | original_output=y, 146 | rbf_input=xx, 147 | rbf_output=yy, 148 | basis='beckert_wendland_c2_basis', 149 | radius=20.) 150 | # assert that the argmin(xx) nearest to point x=4.5 is the same index 151 | # for argmin(yy) nearest to point y=20.25, where y=x*x 152 | idx = (np.abs(xx - 4.5)).argmin() 153 | idx2 = (np.abs(yy - 20.25)).argmin() 154 | np.testing.assert_array_almost_equal(idx, idx2) 155 | 156 | def test_reconstruct_f_scalar(self): 157 | x = np.arange(10) 158 | y = x * x 159 | x_rbf = np.linspace(0, 9, 5) 160 | y_rbf = np.zeros(5) 161 | nd.reconstruct_f( 162 | original_input=x, 163 | original_output=y, 164 | rbf_input=x_rbf, 165 | rbf_output=y_rbf, 166 | basis='beckert_wendland_c2_basis', 167 | radius=2.) 168 | y_rbf_expected = np.asarray( 169 | [0., 4.85579754, 19.1322168, 44.53940674, 81.]) 170 | np.testing.assert_almost_equal(y_rbf, y_rbf_expected) 171 | 172 | def test_reconstruct_f_vectorial(self): 173 | x = np.arange(10).reshape(5, 2) 174 | y = np.square(x) 175 | x_rbf = np.arange(8).reshape(4, 2) 176 | y_rbf = np.zeros(x_rbf.shape) 177 | nd.reconstruct_f( 178 | original_input=x, 179 | original_output=y, 180 | rbf_input=x_rbf, 181 | rbf_output=y_rbf, 182 | radius=1.0, 183 | basis='beckert_wendland_c2_basis') 184 | y_rbf_expected = np.asarray([[0., 1.], [4., 9.], [16., 25.], [36., 185 | 49.]]) 186 | np.testing.assert_almost_equal(y_rbf, y_rbf_expected) 187 | -------------------------------------------------------------------------------- /tests/test_package.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | import unittest 3 | import pkgutil 4 | from os import walk 5 | from os import path 6 | import numpy as np 7 | 8 | class TestPackage(TestCase): 9 | def test_import_blade_2(self): 10 | from bladex import CustomProfile 11 | vec = np.array([1.2, 2.4]) 12 | profile = CustomProfile(xup=vec, yup=vec, xdown=vec, ydown=vec) 13 | 14 | def test_import_blade_3(self): 15 | from bladex import NacaProfile 16 | profile = NacaProfile('0012') 17 | 18 | def test_import_blade_4(self): 19 | from bladex import NacaProfile, Blade 20 | profile = NacaProfile('0012') 21 | sections = [profile, profile] 22 | radii = np.array([1.0, 2.0]) 23 | chord = np.array([0.5, 1.0]) 24 | pitch = np.array([0.2, 0.3]) 25 | rake = np.array([0.2, 0.3]) 26 | skew = np.array([5.0, 10.0]) 27 | blade = Blade(sections, radii, chord, pitch, rake, skew) 28 | 29 | def test_import_blade_5(self): 30 | from bladex import RBF 31 | inter = RBF('gaussian_spline', 1.2) 32 | -------------------------------------------------------------------------------- /tests/test_profileinterface.py: -------------------------------------------------------------------------------- 1 | import os 2 | from unittest import TestCase 3 | from bladex import ProfileInterface 4 | import numpy as np 5 | import matplotlib.pyplot as plt 6 | 7 | class TestProfileInterface(TestCase): 8 | def test_instantiation(self): 9 | with self.assertRaises(TypeError): 10 | ProfileInterface() -------------------------------------------------------------------------------- /tests/test_propeller.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | import os 3 | import numpy as np 4 | from bladex import NacaProfile, Shaft, Propeller, Blade 5 | from smithers.io.obj import ObjHandler 6 | from smithers.io.stlhandler import STLHandler 7 | 8 | 9 | def create_sample_blade_NACApptc(): 10 | sections = np.asarray([NacaProfile('5407') for i in range(13)]) 11 | radii=np.array([0.034375, 0.0375, 0.04375, 0.05, 0.0625, 0.075, 0.0875, 12 | 0.1, 0.10625, 0.1125, 0.11875, 0.121875, 0.125]) 13 | chord_lengths = np.array([0.039, 0.045, 0.05625, 0.06542, 0.08125, 14 | 0.09417, 0.10417, 0.10708, 0.10654, 0.10417, 15 | 0.09417, 0.07867, 0.025]) 16 | pitch = np.array([0.35, 0.35, 0.36375, 0.37625, 0.3945, 0.405, 0.40875, 17 | 0.4035, 0.3955, 0.38275, 0.3645, 0.35275, 0.33875]) 18 | rake=np.array([0.0 ,0.0, 0.0005, 0.00125, 0.00335, 0.005875, 0.0075, 19 | 0.007375, 0.006625, 0.00545, 0.004033, 0.0033, 0.0025]) 20 | skew_angles=np.array([6.6262795, 3.6262795, -1.188323, -4.4654502, 21 | -7.440779, -7.3840979, -5.0367916, -1.3257914, 22 | 1.0856404, 4.1448947, 7.697235, 9.5368917, 23 | 11.397609]) 24 | return Blade( 25 | sections=sections, 26 | radii=radii, 27 | chord_lengths=chord_lengths, 28 | pitch=pitch, 29 | rake=rake, 30 | skew_angles=skew_angles) 31 | 32 | 33 | class TestPropeller(TestCase): 34 | """ 35 | Test case for the Propeller class. 36 | """ 37 | 38 | def test_sections_inheritance_NACApptc(self): 39 | prop= create_sample_blade_NACApptc() 40 | self.assertIsInstance(prop.sections[0], NacaProfile) 41 | 42 | def test_radii_NACApptc(self): 43 | prop = create_sample_blade_NACApptc() 44 | np.testing.assert_equal(prop.radii, np.array([0.034375, 0.0375, 0.04375, 45 | 0.05, 0.0625, 0.075, 46 | 0.0875, 0.1, 0.10625, 47 | 0.1125, 0.11875, 0.121875, 48 | 0.125])) 49 | 50 | def test_chord_NACApptc(self): 51 | prop = create_sample_blade_NACApptc() 52 | np.testing.assert_equal(prop.chord_lengths,np.array([0.039, 0.045, 53 | 0.05625, 0.06542, 54 | 0.08125, 0.09417, 55 | 0.10417, 0.10708, 56 | 0.10654, 0.10417, 57 | 0.09417, 0.07867, 58 | 0.025])) 59 | 60 | def test_pitch_NACApptc(self): 61 | prop = create_sample_blade_NACApptc() 62 | np.testing.assert_equal(prop.pitch, np.array([0.35, 0.35, 0.36375, 63 | 0.37625, 0.3945, 0.405, 64 | 0.40875, 0.4035, 0.3955, 65 | 0.38275, 0.3645, 0.35275, 66 | 0.33875])) 67 | 68 | def test_rake_NACApptc(self): 69 | prop = create_sample_blade_NACApptc() 70 | np.testing.assert_equal(prop.rake, np.array([0.0 ,0.0, 0.0005, 0.00125, 71 | 0.00335, 0.005875, 0.0075, 72 | 0.007375, 0.006625, 0.00545, 73 | 0.004033, 0.0033, 0.0025])) 74 | 75 | def test_skew_NACApptc(self): 76 | prop = create_sample_blade_NACApptc() 77 | np.testing.assert_equal(prop.skew_angles, np.array([6.6262795, 78 | 3.6262795, 79 | -1.188323, 80 | -4.4654502, 81 | -7.440779, 82 | -7.3840979, 83 | -5.0367916, 84 | -1.3257914, 85 | 1.0856404, 86 | 4.1448947, 87 | 7.697235, 88 | 9.5368917, 89 | 11.397609])) 90 | 91 | def test_sections_array_different_length(self): 92 | prop = create_sample_blade_NACApptc() 93 | prop.sections = np.arange(9) 94 | with self.assertRaises(ValueError): 95 | prop._check_params() 96 | 97 | def test_radii_array_different_length(self): 98 | prop = create_sample_blade_NACApptc() 99 | prop.radii = np.arange(9) 100 | with self.assertRaises(ValueError): 101 | prop._check_params() 102 | 103 | def test_chord_array_different_length(self): 104 | prop = create_sample_blade_NACApptc() 105 | prop.chord_lengths = np.arange(9) 106 | with self.assertRaises(ValueError): 107 | prop._check_params() 108 | 109 | def test_pitch_array_different_length(self): 110 | prop = create_sample_blade_NACApptc() 111 | prop.pitch = np.arange(9) 112 | with self.assertRaises(ValueError): 113 | prop._check_params() 114 | 115 | def test_rake_array_different_length(self): 116 | prop = create_sample_blade_NACApptc() 117 | prop.rake = np.arange(9) 118 | with self.assertRaises(ValueError): 119 | prop._check_params() 120 | 121 | def test_skew_array_different_length(self): 122 | prop = create_sample_blade_NACApptc() 123 | prop.skew_angles = np.arange(9) 124 | with self.assertRaises(ValueError): 125 | prop._check_params() 126 | 127 | def test_generate_iges_not_string(self): 128 | sh = Shaft("tests/test_datasets/shaft.iges") 129 | prop = create_sample_blade_NACApptc() 130 | prop = Propeller(sh, prop, 1) 131 | propeller_and_shaft = 1 132 | with self.assertRaises(Exception): 133 | prop.generate_iges(propeller_and_shaft) 134 | 135 | def test_generate_stl_not_string(self): 136 | sh = Shaft("tests/test_datasets/shaft.iges") 137 | prop = create_sample_blade_NACApptc() 138 | prop = Propeller(sh, prop, 1) 139 | propeller_and_shaft = 1 140 | with self.assertRaises(Exception): 141 | prop.generate_stl(propeller_and_shaft) 142 | 143 | def test_generate_iges(self): 144 | sh = Shaft("tests/test_datasets/shaft.iges") 145 | prop = create_sample_blade_NACApptc() 146 | prop = Propeller(sh, prop, 4) 147 | prop.generate_iges("tests/test_datasets/propeller_and_shaft.iges") 148 | self.assertTrue(os.path.isfile('tests/test_datasets/propeller_and_shaft.iges')) 149 | self.addCleanup(os.remove, 'tests/test_datasets/propeller_and_shaft.iges') 150 | 151 | def test_generate_stl(self): 152 | sh = Shaft("tests/test_datasets/shaft.iges") 153 | prop = create_sample_blade_NACApptc() 154 | prop = Propeller(sh, prop, 4) 155 | prop.generate_stl("tests/test_datasets/propeller_and_shaft.stl") 156 | self.assertTrue(os.path.isfile('tests/test_datasets/propeller_and_shaft.stl')) 157 | self.addCleanup(os.remove, 'tests/test_datasets/propeller_and_shaft.stl') 158 | 159 | ''' 160 | # TODO revert asap 161 | def test_generate_obj_by_coords(self): 162 | sh = Shaft("tests/test_datasets/shaft.iges") 163 | prop = create_sample_blade_NACApptc() 164 | prop = Propeller(sh, prop, 4) 165 | prop.generate_obj("tests/test_datasets/propeller_and_shaft.obj", region_selector='by_coords') 166 | 167 | data = ObjHandler.read('tests/test_datasets/propeller_and_shaft.obj') 168 | assert set(data.regions) == set(['blades', 'shaftHead', 'shaftTail']) 169 | 170 | # we want 0 to be the first index 171 | data.polygons = np.asarray(data.polygons) - 1 172 | 173 | tip_poly = data.polygons[:data.regions_change_indexes[1][0]] 174 | stem_poly = data.polygons[data.regions_change_indexes[1][0]:data.regions_change_indexes[2][0]] 175 | blades_stl = STLHandler.read('/tmp/temp_blades.stl') 176 | shaft_stl = STLHandler.read('/tmp/temp_shaft.stl') 177 | 178 | # same vertices 179 | all_vertices = np.concatenate( 180 | [shaft_stl["points"], blades_stl["points"]], axis=0 181 | ) 182 | unique_vertices = np.unique(all_vertices, axis=0) 183 | np.testing.assert_almost_equal(data.vertices, unique_vertices, decimal=3) 184 | 185 | blades_min_x = np.min(blades_stl['points'][:,0]) 186 | assert np.all(data.vertices[np.asarray(tip_poly).flatten()][:,0] >= blades_min_x) 187 | assert not any(np.all(data.vertices[np.asarray(stem_poly).flatten()][:,0].reshape(-1,data.polygons.shape[1]) >= blades_min_x, axis=1)) 188 | 189 | 190 | def test_generate_obj_blades_and_stem(self): 191 | sh = Shaft("tests/test_datasets/shaft.iges") 192 | prop = create_sample_blade_NACApptc() 193 | prop = Propeller(sh, prop, 4) 194 | prop.generate_obj("tests/test_datasets/propeller_and_shaft.obj", region_selector='blades_and_stem') 195 | 196 | data = ObjHandler.read('tests/test_datasets/propeller_and_shaft.obj') 197 | assert data.regions == ['blades', 'shaft'] 198 | 199 | tip_polygons = np.asarray(data.polygons[:data.regions_change_indexes[1][0]]) - 1 200 | stem_polygons = np.asarray(data.polygons[data.regions_change_indexes[1][0]:]) - 1 201 | 202 | blades_stl = STLHandler.read('/tmp/temp_blades.stl') 203 | shaft_stl = STLHandler.read('/tmp/temp_shaft.stl') 204 | 205 | # same vertices 206 | all_vertices = np.concatenate( 207 | [shaft_stl["points"], blades_stl["points"]], axis=0 208 | ) 209 | 210 | unique_vertices, indexing = np.unique( 211 | all_vertices, return_index=True, axis=0 212 | ) 213 | np.testing.assert_almost_equal(data.vertices, unique_vertices, decimal=3) 214 | 215 | assert np.all(indexing[stem_polygons.flatten()] < shaft_stl['points'].shape[0]) 216 | assert np.all(indexing[tip_polygons.flatten()] >= shaft_stl['points'].shape[0]) 217 | ''' 218 | 219 | def test_isdisplay(self): 220 | assert hasattr(Propeller, "display") == True 221 | -------------------------------------------------------------------------------- /tests/test_shaft.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | import os 3 | from bladex import Shaft 4 | from OCC.Core.TopoDS import TopoDS_Solid 5 | 6 | class TestShaft(TestCase): 7 | """ 8 | Test case for the Shaft class. 9 | """ 10 | 11 | def test_generate_solid_01(self): 12 | sh = Shaft("tests/test_datasets/shaft.iges") 13 | shaft_solid = sh.generate_solid() 14 | self.assertIsInstance(shaft_solid, TopoDS_Solid) 15 | 16 | def test_generate_solid_02(self): 17 | sh = Shaft("tests/test_datasets/shaft.stl") 18 | shaft_solid = sh.generate_solid() 19 | self.assertIsInstance(shaft_solid, TopoDS_Solid) 20 | 21 | def test_exception(self): 22 | sh = Shaft("tests/test_datasets/parameters.prm") 23 | with self.assertRaises(Exception): 24 | sh.generate_solid() 25 | 26 | def test_init(self): 27 | sh = Shaft("tests/test_datasets/shaft.iges") 28 | assert sh.filename == "tests/test_datasets/shaft.iges" 29 | 30 | def test_isdisplay(self): 31 | assert hasattr(Shaft, "display") == True 32 | -------------------------------------------------------------------------------- /tutorials/README.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | In this folder you can find a collection of useful tutorials in order to understand the principles and the potential of **BladeX**. 4 | 5 | #### [Tutorial 1](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-1-generate_foils.ipynb) 6 | Here we show how to prepare a blade 2D sectional profile through generating legacy and custom foils. 7 | 8 | #### [Tutorial 2](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-2-transform_foils.ipynb) 9 | Here we show how to proceed with preparing a blade 2D sectional profile by performing several transformation operations on the generated foils. 10 | 11 | #### [Tutorial 3](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-3-generate_blade.ipynb) 12 | Here we show how to prepare a blade 3D sectional profiles by applying all the transformations due to the radial distribution of the blade parameters. 13 | 14 | #### [Tutorial 4](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-4-deform_blade.ipynb) 15 | Here we show how to deform a blade and its parametric curves by using a parameter file. 16 | 17 | #### [Tutorial 5](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-5-foils-customprofile.ipynb) 18 | Here we show how to initialize a blade starting from its parameters, either using the british convention or the american 19 | one for the thickness generation. 20 | 21 | #### [Tutorial 6](https://github.com/mathLab/BladeX/blob/master/tutorials/tutorial-6-blades-customprofile.ipynb) 22 | Here we show how to deform a blade by deforming only its local (thickness, camber) parameters, and/or its global (rake, 23 | skew, etc) parameters. 24 | 25 | #### More to come... 26 | We plan to add more tutorials but the time is often against us. If you want to contribute with a notebook on a feature not covered yet we will be very happy and give you support on editing! 27 | -------------------------------------------------------------------------------- /tutorials/data/boeing_707.csv: -------------------------------------------------------------------------------- 1 | X_UP 2 | 0 3 | 0.05 4 | 0.1 5 | 0.2 6 | 0.4 7 | 0.8 8 | 1.2 9 | 2 10 | 3 11 | 4 12 | 5 13 | 6 14 | 8 15 | 10 16 | 12 17 | 14 18 | 16 19 | 18 20 | 20 21 | 22 22 | 24 23 | 26 24 | 28 25 | 30 26 | 32 27 | 34 28 | 36 29 | 38 30 | 40 31 | 42 32 | 44 33 | 46 34 | 48 35 | 50 36 | 52 37 | 54 38 | 56 39 | 58 40 | 60 41 | 62 42 | 64 43 | 66 44 | 68 45 | 70 46 | 72 47 | 74 48 | 76 49 | 78 50 | 80 51 | 82 52 | 84 53 | 86 54 | 88 55 | 90 56 | 92 57 | 94 58 | 96 59 | 97 60 | 98 61 | 99 62 | 100 63 | 64 | Y_UP 65 | 0 66 | 0.17762 67 | 0.26712 68 | 0.39826 69 | 0.59651 70 | 0.93775 71 | 1.26235 72 | 1.65502 73 | 2.01909 74 | 2.43663 75 | 2.83931 76 | 3.16763 77 | 3.68998 78 | 4.1447 79 | 4.51368 80 | 4.81068 81 | 5.05979 82 | 5.27383 83 | 5.45539 84 | 5.60793 85 | 5.73984 86 | 5.86036 87 | 5.97119 88 | 6.06677 89 | 6.14255 90 | 6.19894 91 | 6.23757 92 | 6.26003 93 | 6.26795 94 | 6.26219 95 | 6.24084 96 | 6.2013 97 | 6.14093 98 | 6.0571 99 | 5.94744 100 | 5.81322 101 | 5.65812 102 | 5.4859 103 | 5.30032 104 | 5.10426 105 | 4.89701 106 | 4.67699 107 | 4.44259 108 | 4.19222 109 | 3.92571 110 | 3.64864 111 | 3.36812 112 | 3.09114 113 | 2.8248 114 | 2.5735 115 | 2.33138 116 | 2.09021 117 | 1.84162 118 | 1.57729 119 | 1.291 120 | 0.9853 121 | 0.66502 122 | 0.5009 123 | 0.33495 124 | 0.16777 125 | 0 126 | 127 | X_DOWN: 128 | 0 129 | 0.05 130 | 0.1 131 | 0.2 132 | 0.4 133 | 0.8 134 | 1.2 135 | 2 136 | 3 137 | 4 138 | 5 139 | 6 140 | 8 141 | 10 142 | 12 143 | 14 144 | 16 145 | 18 146 | 20 147 | 22 148 | 24 149 | 26 150 | 28 151 | 30 152 | 32 153 | 34 154 | 36 155 | 38 156 | 40 157 | 42 158 | 44 159 | 46 160 | 48 161 | 50 162 | 52 163 | 54 164 | 56 165 | 58 166 | 60 167 | 62 168 | 64 169 | 66 170 | 68 171 | 70 172 | 72 173 | 74 174 | 76 175 | 78 176 | 80 177 | 82 178 | 84 179 | 86 180 | 88 181 | 90 182 | 92 183 | 94 184 | 96 185 | 97 186 | 98 187 | 99 188 | 100 189 | 190 | Y_DOWN 191 | 0 192 | -0.27391 193 | -0.37318 194 | -0.51549 195 | -0.7082 196 | -0.90008 197 | -0.95219 198 | -1.01876 199 | -1.09695 200 | -1.14902 201 | -1.1938 202 | -1.24717 203 | -1.36395 204 | -1.46775 205 | -1.56764 206 | -1.67361 207 | -1.79398 208 | -1.92399 209 | -2.04561 210 | -2.14592 211 | -2.23472 212 | -2.32692 213 | -2.42397 214 | -2.51365 215 | -2.58576 216 | -2.64065 217 | -2.68131 218 | -2.71073 219 | -2.73189 220 | -2.74668 221 | -2.7525 222 | -2.74563 223 | -2.72236 224 | -2.67894 225 | -2.61207 226 | -2.52416 227 | -2.4216 228 | -2.31082 229 | -2.19837 230 | -2.08931 231 | -1.98331 232 | -1.87862 233 | -1.77353 234 | -1.66627 235 | -1.55566 236 | -1.44264 237 | -1.32873 238 | -1.21541 239 | -1.10418 240 | -0.99608 241 | -0.8902 242 | -0.78516 243 | -0.67959 244 | -0.57209 245 | -0.46164 246 | -0.34854 247 | -0.23346 248 | -0.17538 249 | -0.11706 250 | -0.05857 251 | 0 252 | -------------------------------------------------------------------------------- /tutorials/data/transformations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/BladeX/0a4379e95bf2990ae400328535cf471eb37ace24/tutorials/data/transformations.png --------------------------------------------------------------------------------