From 07a5fe22c08a8d90d1741be74a3b0aff4cef85c3 Mon Sep 17 00:00:00 2001 From: champagneproblems <76700275+champagneproblems@users.noreply.github.com> Date: Mon, 26 Apr 2021 17:13:21 +0200 Subject: [PATCH 1/2] Fix problem with aseq skipping last angle --- xfoil/xfoil.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xfoil/xfoil.py b/xfoil/xfoil.py index 4334ef6..41e8d6a 100644 --- a/xfoil/xfoil.py +++ b/xfoil/xfoil.py @@ -1,4 +1,6 @@ -# -*- coding: utf-8 -*- +b, navigate to the main page of the repository. +Under your repository name, click Issues. +Click New issue.# -*- coding: utf-8 -*- # Copyright (c) 2019 D. de Vries # # This file is part of XFoil. @@ -257,12 +259,12 @@ def aseq(self, a_start, a_end, a_step): """ n = abs(int((a_end - a_start) / a_step)) - a = np.zeros(n, dtype=c_float) - cl = np.zeros(n, dtype=c_float) - cd = np.zeros(n, dtype=c_float) - cm = np.zeros(n, dtype=c_float) - cp = np.zeros(n, dtype=c_float) - conv = np.zeros(n, dtype=c_bool) + a = np.zeros(n+1, dtype=c_float) + cl = np.zeros(n+1, dtype=c_float) + cd = np.zeros(n+1, dtype=c_float) + cm = np.zeros(n+1, dtype=c_float) + cp = np.zeros(n+1, dtype=c_float) + conv = np.zeros(n+1, dtype=c_bool) self._lib.aseq(byref(c_float(a_start)), byref(c_float(a_end)), byref(c_int(n)), a.ctypes.data_as(fptr), cl.ctypes.data_as(fptr), From cd414a19d4edbc2a930b143f2c97e48049acceea Mon Sep 17 00:00:00 2001 From: champagneproblems <76700275+champagneproblems@users.noreply.github.com> Date: Mon, 26 Apr 2021 17:16:24 +0200 Subject: [PATCH 2/2] Fix problem with aseq skipping last angle --- src/api.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.f90 b/src/api.f90 index a53f4fc..c85143d 100644 --- a/src/api.f90 +++ b/src/api.f90 @@ -388,8 +388,8 @@ subroutine aseq(a_start, a_end, n_step, & use i_xfoil real(c_float), intent(in) :: a_start, a_end integer(c_int), intent(in) :: n_step - real(c_float), dimension(n_step), intent(inout) :: a_arr, cl_arr, cd_arr, cm_arr, cp_arr - logical(c_bool), dimension(n_step), intent(inout) :: conv_arr + real(c_float), dimension(n_step+1), intent(inout) :: a_arr, cl_arr, cd_arr, cm_arr, cp_arr + logical(c_bool), dimension(n_step+1), intent(inout) :: conv_arr integer :: i, j, iseqex, itmaxs real :: a0, da, nan @@ -404,7 +404,7 @@ subroutine aseq(a_start, a_end, n_step, & !----- initialize unconverged-point counter iseqex = 0 - do i=1, n_step + do i=1, n_step+1 ALFa = a0 + da * float(i - 1) if (abs(ALFa - AWAke)>1.0E-5) LWAke = .false. if (abs(ALFa - AVIsc)>1.0E-5) LVConv = .false.