Skip to content

Commit

Permalink
Merge pull request #126 from ImperialCollegeLondon/dev_multibody
Browse files Browse the repository at this point in the history
Update and include features in multibody
  • Loading branch information
ArturoMS13 authored Apr 5, 2021
2 parents 4cab27a + 663f44e commit cf3e1c7
Show file tree
Hide file tree
Showing 19 changed files with 1,214 additions and 979 deletions.
3 changes: 1 addition & 2 deletions cases/templates/template_wt.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ def generate_from_excel_type02(chord_panels,
LC1.node_in_body = tower.StructuralInformation.num_node - 1
LC1.body = 0
LC1.body_FoR = 1
LC1.rot_axisB = np.array([1., 0., 0.0])
LC1.rot_vel = -rotation_velocity
LC1.rot_vect = np.array([-1., 0., 0.])*rotation_velocity

LC = []
LC.append(LC1)
Expand Down
6 changes: 1 addition & 5 deletions sharpy/postproc/beamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ def write_beam(self, it):
forces_constraints_nodes = np.zeros((num_nodes, 3))
moments_constraints_nodes = np.zeros((num_nodes, 3))

if self.data.structure.timestep_info[it].in_global_AFoR:
tstep = self.data.structure.timestep_info[it]
else:
tstep = self.data.structure.timestep_info[it].copy()
tstep.whole_structure_to_global_AFoR(self.data.structure)
tstep = self.data.structure.timestep_info[it]

# aero2inertial rotation
aero2inertial = tstep.cga()
Expand Down
6 changes: 1 addition & 5 deletions sharpy/postproc/liftdistribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ def run(self, online=False):

def lift_distribution(self):
# add entry to dictionary for postproc
if self.data.structure.timestep_info[self.data.ts].in_global_AFoR:
tstep = self.data.structure.timestep_info[self.data.ts]
else:
tstep = self.data.structure.timestep_info[self.data.ts].copy()
tstep.whole_structure_to_global_AFoR(self.data.structure)
tstep = self.data.structure.timestep_info[self.data.ts]
tstep.postproc_cell['lift_distribution'] = init_matrix_structure(dimensions=tstep.dimensions,
with_dim_dimension=False)

Expand Down
3 changes: 0 additions & 3 deletions sharpy/postproc/pickledata.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def initialise(self, data, custom_settings=None, caller=None):
def run(self, online=False):
for it in range(len(self.data.structure.timestep_info)):
tstep_p = self.data.structure.timestep_info[it]
if tstep_p is not None:
if not tstep_p.in_global_AFoR:
tstep_p.whole_structure_to_global_AFoR(self.data.structure)
with open(self.filename, 'wb') as f:
pickle.dump(self.data, f, protocol=pickle.HIGHEST_PROTOCOL)

Expand Down
8 changes: 2 additions & 6 deletions sharpy/postproc/savedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def initialise(self, data, custom_settings=None, caller=None):

settings.to_custom_types(self.settings,
self.settings_types, self.settings_default, options=self.settings_options)

# Add these anyway - therefore if you add your own skip_attr you don't have to retype all of these
self.settings['skip_attr'].extend(['fortran',
'airfoils',
Expand Down Expand Up @@ -296,11 +296,7 @@ def save_timestep(data, settings, ts, hdfile):
SkipAttr=settings['skip_attr'],
compress_float=settings['compress_float'])
if settings['save_struct']:
if data.structure.timestep_info[ts].in_global_AFoR:
tstep = data.structure.timestep_info[ts]
else:
tstep = data.structure.timestep_info[data.ts].copy()
tstep.whole_structure_to_global_AFoR(data.structure)
tstep = data.structure.timestep_info[ts]

h5utils.add_as_grp(tstep,
hdfile['data']['structure']['timestep_info'],
Expand Down
6 changes: 1 addition & 5 deletions sharpy/postproc/writevariablestime.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,7 @@ def write(self, it):
else:
self.settings['FoR_number'] = np.array([0], dtype=int)

if self.data.structure.timestep_info[it].in_global_AFoR:
tstep = self.data.structure.timestep_info[it]
else:
tstep = self.data.structure.timestep_info[it].copy()
tstep.whole_structure_to_global_AFoR(self.data.structure)
tstep = self.data.structure.timestep_info[it]

for ivariable in range(len(self.settings['FoR_variables'])):
if self.settings['FoR_variables'][ivariable] == '':
Expand Down
6 changes: 3 additions & 3 deletions sharpy/solvers/beamloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def run(self):
self.data.structure.dyn_dict = self.dyn_data_dict

# Change the beam description to the local FoR for multibody
if (self.data.structure.num_bodies > 1):
self.data.structure.ini_info.whole_structure_to_local_AFoR(self.data.structure)
self.data.structure.timestep_info[0].whole_structure_to_local_AFoR(self.data.structure)
# if (self.data.structure.num_bodies > 1):
# self.data.structure.ini_info.whole_structure_to_local_AFoR(self.data.structure)
# self.data.structure.timestep_info[0].whole_structure_to_local_AFoR(self.data.structure)

return self.data
Loading

0 comments on commit cf3e1c7

Please sign in to comment.