From 4c4fb486a6e1409a0050babf27dc6ae9e653ca31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Fri, 20 Oct 2023 22:09:41 +0200 Subject: [PATCH 01/17] fix [savedata] save of linear system related hdf5 file saves - fix intend otherwise these linear/rom systems would only be saved if no data.h5 file exist from the start - remove all files before it is written as overwriting them causes an Assertation error --- sharpy/postproc/savedata.py | 58 ++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/sharpy/postproc/savedata.py b/sharpy/postproc/savedata.py index 87ccd2df5..6c7e7e6e3 100644 --- a/sharpy/postproc/savedata.py +++ b/sharpy/postproc/savedata.py @@ -155,9 +155,7 @@ def initialise(self, data, custom_settings=None, caller=None, restart=False): self.filename_linear = self.folder + self.data.settings['SHARPy']['case'] + '.linss.h5' # remove old file if it exists - for file_path in [self.filename, self.filename_linear]: - if os.path.isfile(file_path): - os.remove(file_path) + self.remove_file_if_exist(self.filename) # check that there is a linear system - else return setting to false if self.settings['save_linear'] or self.settings['save_linear_uvlm']: @@ -204,6 +202,10 @@ def initialise(self, data, custom_settings=None, caller=None, restart=False): self.ClassesToSave += (sharpy.solvers.linearassembler.Linear, sharpy.linear.src.libss.ss_block) self.caller = caller + def remove_file_if_exist(self, filepath): + if os.path.isfile(filepath): + os.remove(filepath) + def run(self, **kwargs): online = settings_utils.set_value_or_default(kwargs, 'online', False) @@ -247,33 +249,37 @@ def run(self, **kwargs): hdfile.close() - if self.settings['save_linear_uvlm']: - linhdffile = h5py.File(self.filename.replace('.data.h5', '.uvlmss.h5'), 'a') - h5utils.add_as_grp(self.data.linear.linear_system.uvlm.ss, linhdffile, grpname='ss', + if self.settings['save_linear_uvlm']: + linhdffile = h5py.File(self.filename.replace('.data.h5', '.uvlmss.h5'), 'a') + self.remove_file_if_exist(linhdffile) + h5utils.add_as_grp(self.data.linear.linear_system.uvlm.ss, linhdffile, grpname='ss', + ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], + compress_float=self.settings['compress_float']) + h5utils.add_as_grp(self.data.linear.linear_system.linearisation_vectors, linhdffile, + grpname='linearisation_vectors', + ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], + compress_float=self.settings['compress_float']) + linhdffile.close() + + if self.settings['save_linear']: + self.remove_file_if_exist(self.filename_linear) + with h5py.File(self.filename_linear, 'a') as linfile: + h5utils.add_as_grp(self.data.linear.linear_system.linearisation_vectors, linfile, + grpname='linearisation_vectors', ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], compress_float=self.settings['compress_float']) - h5utils.add_as_grp(self.data.linear.linear_system.linearisation_vectors, linhdffile, - grpname='linearisation_vectors', + h5utils.add_as_grp(self.data.linear.ss, linfile, grpname='ss', ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], compress_float=self.settings['compress_float']) - linhdffile.close() - - if self.settings['save_linear']: - with h5py.File(self.filename_linear, 'a') as linfile: - h5utils.add_as_grp(self.data.linear.linear_system.linearisation_vectors, linfile, - grpname='linearisation_vectors', - ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], - compress_float=self.settings['compress_float']) - h5utils.add_as_grp(self.data.linear.ss, linfile, grpname='ss', - ClassesToSave=self.ClassesToSave, SkipAttr=self.settings['skip_attr'], - compress_float=self.settings['compress_float']) - - if self.settings['save_rom']: - try: - for k, rom in self.data.linear.linear_system.uvlm.rom.items(): - rom.save(self.filename.replace('.data.h5', '_{:s}.rom.h5'.format(k.lower()))) - except AttributeError: - cout.cout_wrap('Could not locate a reduced order model to save') + + if self.settings['save_rom']: + try: + for k, rom in self.data.linear.linear_system.uvlm.rom.items(): + romhdffile = self.filename.replace('.data.h5', '_{:s}.rom.h5'.format(k.lower())) + self.remove_file_if_exist(romhdffile) + rom.save(romhdffile) + except AttributeError: + cout.cout_wrap('Could not locate a reduced order model to save') elif self.settings['format'] == 'mat': from scipy.io import savemat From 3bdabedeccf2fe6064bc04ff7f307fbee9c0456e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Tue, 7 Nov 2023 13:49:37 +0000 Subject: [PATCH 02/17] fix [gust] type and handling of gust component definitions --- sharpy/generators/gustvelocityfield.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sharpy/generators/gustvelocityfield.py b/sharpy/generators/gustvelocityfield.py index e13157a53..812f3c51e 100644 --- a/sharpy/generators/gustvelocityfield.py +++ b/sharpy/generators/gustvelocityfield.py @@ -89,8 +89,8 @@ class one_minus_cos(BaseGust): settings_default['gust_intensity'] = 0.0 settings_description['gust_intensity'] = 'Intensity of the gust :math:`u_{de}`.' - settings_types['gust_component'] = 'int' - settings_default['gust_component'] = 2 + settings_types['gust_component'] = 'list(int)' + settings_default['gust_component'] = [2] settings_description['gust_component'] = 'Component of the gust velocity in the G-frame (x,y,z)->(0,1,2).' setting_table = settings.SettingsTable() @@ -258,7 +258,7 @@ def initialise_interpolation_functions(self): def gust_shape(self, x, y, z, time=0): vel = np.zeros((3,)) - for counter, idim in enumerate(self.settings['gust_component']): + for counter, idim in enumerate(list(self.settings['gust_component'])): vel[idim] = self.list_interpolated_velocity_field_functions[counter](time) return vel @@ -283,7 +283,7 @@ def gust_shape(self, x, y, z, time=0): vel = np.zeros((3,)) d = np.dot(np.array([x, y, z]), self.u_inf_direction) if d <= 0.0: - for counter, idim in enumerate(self.settings['gust_component']): + for counter, idim in enumerate(list(self.settings['gust_component'])): vel[idim] = self.list_interpolated_velocity_field_functions[counter](d) return vel From bf3e2959facf22bd4b34ee7853d62243ba4190b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Tue, 7 Nov 2023 17:15:51 +0000 Subject: [PATCH 03/17] Revert "fix [gust] type and handling of gust component definitions" This reverts commit 3bdabedeccf2fe6064bc04ff7f307fbee9c0456e. --- sharpy/generators/gustvelocityfield.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sharpy/generators/gustvelocityfield.py b/sharpy/generators/gustvelocityfield.py index 812f3c51e..e13157a53 100644 --- a/sharpy/generators/gustvelocityfield.py +++ b/sharpy/generators/gustvelocityfield.py @@ -89,8 +89,8 @@ class one_minus_cos(BaseGust): settings_default['gust_intensity'] = 0.0 settings_description['gust_intensity'] = 'Intensity of the gust :math:`u_{de}`.' - settings_types['gust_component'] = 'list(int)' - settings_default['gust_component'] = [2] + settings_types['gust_component'] = 'int' + settings_default['gust_component'] = 2 settings_description['gust_component'] = 'Component of the gust velocity in the G-frame (x,y,z)->(0,1,2).' setting_table = settings.SettingsTable() @@ -258,7 +258,7 @@ def initialise_interpolation_functions(self): def gust_shape(self, x, y, z, time=0): vel = np.zeros((3,)) - for counter, idim in enumerate(list(self.settings['gust_component'])): + for counter, idim in enumerate(self.settings['gust_component']): vel[idim] = self.list_interpolated_velocity_field_functions[counter](time) return vel @@ -283,7 +283,7 @@ def gust_shape(self, x, y, z, time=0): vel = np.zeros((3,)) d = np.dot(np.array([x, y, z]), self.u_inf_direction) if d <= 0.0: - for counter, idim in enumerate(list(self.settings['gust_component'])): + for counter, idim in enumerate(self.settings['gust_component']): vel[idim] = self.list_interpolated_velocity_field_functions[counter](d) return vel From 60be226f74e32b4e1fa5c972ff16fb15b925058f Mon Sep 17 00:00:00 2001 From: Ben Preston Date: Wed, 6 Dec 2023 12:46:55 +0000 Subject: [PATCH 04/17] Updated XBeam version --- lib/xbeam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xbeam b/lib/xbeam index 50e4cad40..0ee9712ab 160000 --- a/lib/xbeam +++ b/lib/xbeam @@ -1 +1 @@ -Subproject commit 50e4cad4064ddac65d1444351c51f4d1a0bc4aba +Subproject commit 0ee9712ab3e3312642df284cd0648791ad72ef43 From 0f736b9656a7b124b544ac072dd0dd10835e8a27 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:22:38 +0000 Subject: [PATCH 05/17] Remove empty continuation line in Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e6ca1d9df..3d205725d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,6 @@ RUN mamba config --set always_yes yes --set changeps1 no RUN mamba update -q conda RUN mamba config --set auto_activate_base false RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ - find /mamba/ -follow -type f -name '*.a' -delete && \ find /mamba/ -follow -type f -name '*.pyc' -delete && \ find /mamba/ -follow -type f -name '*.js.map' -delete From 39b2b30ffc30a266f6eb496cd20bd8959a3d6fc1 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:40:10 +0000 Subject: [PATCH 06/17] Split run statement for debugging --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d205725d..39b06244e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,10 +32,14 @@ RUN mamba init bash RUN mamba config --set always_yes yes --set changeps1 no RUN mamba update -q conda RUN mamba config --set auto_activate_base false -RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ - find /mamba/ -follow -type f -name '*.a' -delete && \ - find /mamba/ -follow -type f -name '*.pyc' -delete && \ - find /mamba/ -follow -type f -name '*.js.map' -delete +#RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ +# find /mamba/ -follow -type f -name '*.a' -delete && \ +# find /mamba/ -follow -type f -name '*.pyc' -delete && \ +# find /mamba/ -follow -type f -name '*.js.map' -delete +RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy +RUN find /mamba/ -follow -type f -name '*.a' -delete +RUN find /mamba/ -follow -type f -name '*.pyc' -delete +RUN find /mamba/ -follow -type f -name '*.js.map' -delete #COPY /utils/docker/* /root/ RUN ln -s /sharpy_dir/utils/docker/* /root/ From 9bac3b557eb230909277f8d1cf50436676a91b83 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:44:50 +0000 Subject: [PATCH 07/17] Update Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 39b06244e..4c562c32e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,8 @@ RUN mamba config --set auto_activate_base false # find /mamba/ -follow -type f -name '*.a' -delete && \ # find /mamba/ -follow -type f -name '*.pyc' -delete && \ # find /mamba/ -follow -type f -name '*.js.map' -delete -RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy +RUN mamba env create -f /sharpy_dir/utils/environment.yml +RUN mamba clean -afy RUN find /mamba/ -follow -type f -name '*.a' -delete RUN find /mamba/ -follow -type f -name '*.pyc' -delete RUN find /mamba/ -follow -type f -name '*.js.map' -delete From db36db53660f24cd4e3c6cd2eb78d8d5faea462b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Wed, 6 Dec 2023 16:51:33 +0000 Subject: [PATCH 08/17] fix [modalutils] number of modes to be exported as vtk In the previous version, less modes are extracted for free flying aircraft because number of rigid body DoFs are wrongly substracted from the total number of modes although the first modes (which are the rigid body modes) are already skipped. Thus if 30 modes are to be exported only 10 mode shapes are created. --- sharpy/structure/utils/modalutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharpy/structure/utils/modalutils.py b/sharpy/structure/utils/modalutils.py index f16353c26..b7698cb86 100644 --- a/sharpy/structure/utils/modalutils.py +++ b/sharpy/structure/utils/modalutils.py @@ -283,7 +283,7 @@ def write_modes_vtk(data, eigenvectors, NumLambda, filename_root, else: num_rigid_body = 0 - for mode in range(num_rigid_body, NumLambda - num_rigid_body): + for mode in range(num_rigid_body, NumLambda): # scale eigenvector eigvec = eigenvectors[:num_dof, mode] fact = scale_mode(data, eigvec, rot_max_deg, perc_max) From 215f87be1c95450c4627d923447b4a7b004eaee4 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:54:00 +0000 Subject: [PATCH 09/17] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4c562c32e..27e5ee597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN mamba config --set auto_activate_base false # find /mamba/ -follow -type f -name '*.pyc' -delete && \ # find /mamba/ -follow -type f -name '*.js.map' -delete RUN mamba env create -f /sharpy_dir/utils/environment.yml -RUN mamba clean -afy +#RUN mamba clean -afy RUN find /mamba/ -follow -type f -name '*.a' -delete RUN find /mamba/ -follow -type f -name '*.pyc' -delete RUN find /mamba/ -follow -type f -name '*.js.map' -delete From 2b0b33e2f9c15943c0d90a1a3fd6d5427d53bcc4 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:00:55 +0000 Subject: [PATCH 10/17] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 27e5ee597..200f8de55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN mamba config --set auto_activate_base false # find /mamba/ -follow -type f -name '*.pyc' -delete && \ # find /mamba/ -follow -type f -name '*.js.map' -delete RUN mamba env create -f /sharpy_dir/utils/environment.yml -#RUN mamba clean -afy +RUN mamba clean RUN find /mamba/ -follow -type f -name '*.a' -delete RUN find /mamba/ -follow -type f -name '*.pyc' -delete RUN find /mamba/ -follow -type f -name '*.js.map' -delete From 682f4559a9a76e07f72067d0eab674441e179129 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:10:59 +0000 Subject: [PATCH 11/17] Update Dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 200f8de55..ee7179354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,14 +30,15 @@ ADD / /sharpy_dir/ # Cleanup mamba installation RUN mamba init bash RUN mamba config --set always_yes yes --set changeps1 no -RUN mamba update -q conda +#RUN mamba update -q conda +RUN mamda update --all RUN mamba config --set auto_activate_base false #RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ # find /mamba/ -follow -type f -name '*.a' -delete && \ # find /mamba/ -follow -type f -name '*.pyc' -delete && \ # find /mamba/ -follow -type f -name '*.js.map' -delete RUN mamba env create -f /sharpy_dir/utils/environment.yml -RUN mamba clean +RUN mamba clean -afy RUN find /mamba/ -follow -type f -name '*.a' -delete RUN find /mamba/ -follow -type f -name '*.pyc' -delete RUN find /mamba/ -follow -type f -name '*.js.map' -delete From 5cc72d7bd0d8c8b9f8ebf40eb17c39a1c11da532 Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:12:58 +0000 Subject: [PATCH 12/17] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ee7179354..059fb762c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ ADD / /sharpy_dir/ RUN mamba init bash RUN mamba config --set always_yes yes --set changeps1 no #RUN mamba update -q conda -RUN mamda update --all +RUN mamba update --all RUN mamba config --set auto_activate_base false #RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ # find /mamba/ -follow -type f -name '*.a' -delete && \ From 5a92f77b1198f0681515ec874f544f565f2856ea Mon Sep 17 00:00:00 2001 From: Ben Preston <144227999+ben-l-p@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:18:06 +0000 Subject: [PATCH 13/17] Update Dockerfile to remove clean command --- Dockerfile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 059fb762c..ec6701f39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,15 +30,10 @@ ADD / /sharpy_dir/ # Cleanup mamba installation RUN mamba init bash RUN mamba config --set always_yes yes --set changeps1 no -#RUN mamba update -q conda -RUN mamba update --all +RUN mamba update -q conda RUN mamba config --set auto_activate_base false -#RUN mamba env create -f /sharpy_dir/utils/environment.yml && mamba clean -afy && \ -# find /mamba/ -follow -type f -name '*.a' -delete && \ -# find /mamba/ -follow -type f -name '*.pyc' -delete && \ -# find /mamba/ -follow -type f -name '*.js.map' -delete RUN mamba env create -f /sharpy_dir/utils/environment.yml -RUN mamba clean -afy +#RUN mamba clean -afy RUN find /mamba/ -follow -type f -name '*.a' -delete RUN find /mamba/ -follow -type f -name '*.pyc' -delete RUN find /mamba/ -follow -type f -name '*.js.map' -delete From ecf6d60258e3d984a806cd07b86dc7ca6fbb94ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Fri, 20 Oct 2023 16:44:37 +0200 Subject: [PATCH 14/17] fix [udp tutorial] jupyter notebook meta data - caused error in opening the jupyter notebook and for the tutorial not to be displayed in the readthedocs documentation --- .../example_notebooks/UDP_control/tutorial_udp_control.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/source/content/example_notebooks/UDP_control/tutorial_udp_control.ipynb b/docs/source/content/example_notebooks/UDP_control/tutorial_udp_control.ipynb index b0205753d..28948292f 100644 --- a/docs/source/content/example_notebooks/UDP_control/tutorial_udp_control.ipynb +++ b/docs/source/content/example_notebooks/UDP_control/tutorial_udp_control.ipynb @@ -2368,9 +2368,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Run SHARPy Simulation" - "execution_count": 22, - ] + "### Run SHARPy Simulation"] }, { "cell_type": "code", From 261204aa011b57dca1a0de94b79ae3e82ac63c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Mon, 18 Dec 2023 13:03:32 +0000 Subject: [PATCH 15/17] remove [postproc] left over prints from debugging --- sharpy/postproc/aeroforcescalculator.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/sharpy/postproc/aeroforcescalculator.py b/sharpy/postproc/aeroforcescalculator.py index 219b0f783..c13ac60b3 100644 --- a/sharpy/postproc/aeroforcescalculator.py +++ b/sharpy/postproc/aeroforcescalculator.py @@ -132,11 +132,8 @@ def calculate_forces(self, ts): self.data.aero.timestep_info[ts].body_unsteady_forces[i_surf, 0:3] ) = self.calculate_forces_for_isurf_in_g_frame(force[i_surf], unsteady_force=unsteady_force[i_surf]) - print(self.settings["nonlifting_body"]) if self.settings["nonlifting_body"]: - print(self.data.nonlifting_body.n_surf) for i_surf in range(self.data.nonlifting_body.n_surf): - print(i_surf) ( self.data.nonlifting_body.timestep_info[ts].inertial_steady_forces[i_surf, 0:3], self.data.nonlifting_body.timestep_info[ts].body_steady_forces[i_surf, 0:3], From 501f73e816d49007cbf33505ada99598ead95419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefanie=20D=C3=BCssler?= Date: Mon, 18 Dec 2023 13:43:08 +0000 Subject: [PATCH 16/17] remove [postproc] unused columns from exported force and moment matrices - before it creates an output file with extra columns without any values --- sharpy/postproc/aeroforcescalculator.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sharpy/postproc/aeroforcescalculator.py b/sharpy/postproc/aeroforcescalculator.py index c13ac60b3..cb6833ff3 100644 --- a/sharpy/postproc/aeroforcescalculator.py +++ b/sharpy/postproc/aeroforcescalculator.py @@ -233,8 +233,8 @@ def screen_output(self, ts): def file_output(self, filename): # assemble forces/moments matrix # (1 timestep) + (3+3 inertial steady+unsteady) + (3+3 body steady+unsteady) - force_matrix = np.zeros((self.ts_max, 1 + 3 + 3 + 3 + 3 + 3 + 3)) - moment_matrix = np.zeros((self.ts_max, 1 + 3 + 3 + 3 + 3 + 3 + 3)) + force_matrix = np.zeros((self.ts_max, 1 + 3 + 3 + 3 + 3 )) + moment_matrix = np.zeros((self.ts_max, 1 + 3 + 3 + 3 + 3)) for ts in range(self.ts_max): aero_tstep = self.data.aero.timestep_info[ts] i = 0 @@ -268,12 +268,10 @@ def file_output(self, filename): header += 'fx_unsteady_G, fy_unsteady_G, fz_unsteady_G, ' header += 'fx_steady_a, fy_steady_a, fz_steady_a, ' header += 'fx_unsteady_a, fy_unsteady_a, fz_unsteady_a' - header += 'mx_total_G, my_total_G, mz_total_G' - header += 'mx_total_a, my_total_a, mz_total_a' np.savetxt(self.folder + 'forces_' + filename, force_matrix, - fmt='%i' + ', %10e'*18, + fmt='%i' + ', %10e' * (np.shape(force_matrix)[1] - 1), delimiter=',', header=header, comments='#') @@ -287,7 +285,7 @@ def file_output(self, filename): np.savetxt(self.folder + 'moments_' + filename, moment_matrix, - fmt='%i' + ', %10e'*18, + fmt='%i' + ', %10e' * (np.shape(moment_matrix)[1] - 1), delimiter=',', header=header, comments='#') From d03a99bafd2de7f457bb1f885cb34716c5d75054 Mon Sep 17 00:00:00 2001 From: kccwing <60852830+kccwing@users.noreply.github.com> Date: Sat, 20 Jan 2024 01:18:39 +0800 Subject: [PATCH 17/17] Update noaero.py for consistency in function input NoAero errors out because of missing optional input - fixed --- sharpy/solvers/noaero.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharpy/solvers/noaero.py b/sharpy/solvers/noaero.py index 5a18a68d9..562bbe3a4 100644 --- a/sharpy/solvers/noaero.py +++ b/sharpy/solvers/noaero.py @@ -78,7 +78,7 @@ def update_grid(self, beam): -1, beam_ts=-1) - def update_custom_grid(self, structure_tstep, aero_tstep): + def update_custom_grid(self, structure_tstep, aero_tstep, nl_body_tstep = None): # called by DynamicCoupled if self.settings['update_grid']: self.data.aero.generate_zeta_timestep_info(structure_tstep,