wawi 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wawi might be problematic. Click here for more details.
- examples/3 Software interfacing/Abaqus model export/bergsoysund-export.py +72 -0
- examples/3 Software interfacing/Abaqus model export/test.py +67 -0
- tests/test_IABSE_step11a.py +217 -0
- tests/test_IABSE_step11c.py +281 -0
- tests/test_IABSE_step2a.py +263 -0
- tests/test_wind.py +71 -0
- wawi/__init__.py +1 -1
- wawi/ext/__init__.py +0 -0
- wawi/ext/abq.py +259 -0
- wawi/ext/abq_legacy.py +462 -0
- wawi/ext/ansys.py +0 -0
- wawi/ext/orcaflex.py +0 -0
- wawi/ext/sofistik.py +0 -0
- wawi/io.py +15 -15
- wawi/model/__init__.py +11 -0
- wawi/model/_aero.py +363 -0
- wawi/model/_dry.py +141 -0
- wawi/model/_hydro.py +882 -0
- wawi/model/_model.py +1324 -0
- wawi/model/_screening.py +124 -0
- wawi/plot.py +9 -6
- {wawi-0.0.7.dist-info → wawi-0.0.9.dist-info}/METADATA +1 -1
- wawi-0.0.9.dist-info/RECORD +39 -0
- wawi-0.0.9.dist-info/top_level.txt +3 -0
- wawi-0.0.7.dist-info/RECORD +0 -21
- wawi-0.0.7.dist-info/top_level.txt +0 -1
- {wawi-0.0.7.dist-info → wawi-0.0.9.dist-info}/LICENSE +0 -0
- {wawi-0.0.7.dist-info → wawi-0.0.9.dist-info}/WHEEL +0 -0
wawi/model/_screening.py
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
import numpy as np
|
2
|
+
import json
|
3
|
+
from ._hydro import Seastate
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
'''
|
7
|
+
SCREENING SUBMODULE
|
8
|
+
'''
|
9
|
+
|
10
|
+
class ScreeningCase:
|
11
|
+
def __init__(self, seastate, parvar, independent=True, name=None):
|
12
|
+
|
13
|
+
self.name = name
|
14
|
+
self.seastate = seastate
|
15
|
+
self.assign_parvar(parvar)
|
16
|
+
self.independent = independent
|
17
|
+
self.combos = self.get_parameter_space()
|
18
|
+
self.ix = -1
|
19
|
+
|
20
|
+
if not self.independent:
|
21
|
+
sz_prev = None
|
22
|
+
for key in self.parvar:
|
23
|
+
sz = len(self.parvar[key])
|
24
|
+
|
25
|
+
if sz_prev is not None and sz!=sz_prev:
|
26
|
+
raise ValueError('If dependent parameter arrays are requested, they must have the same length!')
|
27
|
+
|
28
|
+
sz_prev = sz*1
|
29
|
+
|
30
|
+
|
31
|
+
def assign_parvar(self, parvar):
|
32
|
+
self.parvar = dict()
|
33
|
+
|
34
|
+
for key in parvar:
|
35
|
+
if type(parvar[key]) is str:
|
36
|
+
self.parvar[key] = eval(parvar[key])
|
37
|
+
else:
|
38
|
+
self.parvar[key] = np.array(parvar[key])
|
39
|
+
|
40
|
+
# Convert angles
|
41
|
+
conversions = {'theta0': np.pi/180.0, 'thetaU': np.pi/180.0}
|
42
|
+
|
43
|
+
for key in self.parvar:
|
44
|
+
if key in conversions:
|
45
|
+
self.parvar[key] = self.parvar[key]*conversions[key]
|
46
|
+
|
47
|
+
|
48
|
+
def get_parameter_space(self):
|
49
|
+
pars = [self.parvar[k] for k in self.parvar]
|
50
|
+
keys = [k for k in self.parvar if k]
|
51
|
+
|
52
|
+
if self.independent:
|
53
|
+
combos = np.array(np.meshgrid(*pars)).reshape(len(keys),-1).T
|
54
|
+
else:
|
55
|
+
combos = np.vstack(pars).T
|
56
|
+
|
57
|
+
combo_dicts = [dict(zip(keys, combo)) for combo in combos]
|
58
|
+
return combo_dicts
|
59
|
+
|
60
|
+
@property
|
61
|
+
def n(self):
|
62
|
+
if self.independent:
|
63
|
+
return np.prod([len(v) for v in self.parvar.values()])
|
64
|
+
else:
|
65
|
+
return len(list(self.parvar.values())[0])
|
66
|
+
|
67
|
+
# Alternative constructor
|
68
|
+
@classmethod
|
69
|
+
def from_json(cls, json_file, **kwargs):
|
70
|
+
with open(json_file, 'r') as fileobj:
|
71
|
+
data = json.load(fileobj)
|
72
|
+
|
73
|
+
seastate = Seastate.from_json(data['seastate'], **kwargs)
|
74
|
+
|
75
|
+
# Update options if provided (to enable overriding options from screening setup)
|
76
|
+
if 'options' in data:
|
77
|
+
options = data['options']
|
78
|
+
else:
|
79
|
+
options = {}
|
80
|
+
|
81
|
+
if 'pontoon_options' in data:
|
82
|
+
pontoon_options = data['pontoon_options']
|
83
|
+
else:
|
84
|
+
pontoon_options = {}
|
85
|
+
|
86
|
+
seastate.options.update(**options)
|
87
|
+
seastate.pontoon_options.update(**pontoon_options)
|
88
|
+
|
89
|
+
parvar = data['parvar']
|
90
|
+
if 'independent' in data:
|
91
|
+
independent = data['independent']
|
92
|
+
else:
|
93
|
+
independent = True
|
94
|
+
|
95
|
+
return cls(seastate, parvar, independent=independent, name=Path(json_file).stem)
|
96
|
+
|
97
|
+
def get_combo(self):
|
98
|
+
return self.combos[self.ix]
|
99
|
+
|
100
|
+
def get_next_combo(self):
|
101
|
+
self.iterate_ix()
|
102
|
+
combo = self.combos[self.ix]
|
103
|
+
return combo
|
104
|
+
|
105
|
+
def iterate_seastate(self):
|
106
|
+
combo = self.get_next_combo()
|
107
|
+
if combo is not None:
|
108
|
+
for key in combo:
|
109
|
+
setattr(self.seastate, key, combo[key])
|
110
|
+
|
111
|
+
return self.seastate
|
112
|
+
|
113
|
+
def get_next_seastate(self):
|
114
|
+
self.iterate_seastate()
|
115
|
+
return self.seastate
|
116
|
+
|
117
|
+
def iterate_ix(self):
|
118
|
+
if self.ix == (self.n-1):
|
119
|
+
self.ix = 0 #reset
|
120
|
+
else:
|
121
|
+
self.ix += 1
|
122
|
+
|
123
|
+
def reset_ix(self):
|
124
|
+
self.ix = 0
|
wawi/plot.py
CHANGED
@@ -9,9 +9,9 @@ from scipy.interpolate import RectBivariateSpline, interp1d
|
|
9
9
|
|
10
10
|
def plot_ads(ad_dict, v, terms='stiffness', num=None, test_v=dict(), test_ad=dict(), zasso_type=False, ranges=None):
|
11
11
|
# v: v or K
|
12
|
-
if terms
|
12
|
+
if terms == 'stiffness':
|
13
13
|
terms = [['P4', 'P6', 'P3'], ['H6', 'H4', 'H3'], ['A6', 'A4', 'A3']]
|
14
|
-
elif terms
|
14
|
+
elif terms == 'damping':
|
15
15
|
terms = [['P1', 'P5', 'P2'], ['H5', 'H1', 'H2'], ['A5', 'A1', 'A2']]
|
16
16
|
|
17
17
|
# Create exponent defs for K_normalized plotting
|
@@ -60,9 +60,9 @@ def plot_ads(ad_dict, v, terms='stiffness', num=None, test_v=dict(), test_ad=dic
|
|
60
60
|
|
61
61
|
for col_ix in range(len(terms)):
|
62
62
|
if zasso_type:
|
63
|
-
ax[-1, col_ix].set_xlabel('$K$')
|
63
|
+
ax[-1, col_ix].set_xlabel(r'$K$')
|
64
64
|
else:
|
65
|
-
ax[-1, col_ix].set_xlabel('$V/(B\cdot \omega)$')
|
65
|
+
ax[-1, col_ix].set_xlabel(r'$V/(B\cdot \omega)$')
|
66
66
|
|
67
67
|
fig.tight_layout()
|
68
68
|
return fig, ax
|
@@ -98,7 +98,7 @@ def plot_dir_and_crests(theta0, Tp, arrow_length=100, origin=np.array([0,0]),
|
|
98
98
|
wave_length = 2*np.pi/get_kappa(2*np.pi/Tp, U=0.0)
|
99
99
|
|
100
100
|
plt.arrow(origin[0],origin[1], arrow_length*v[0], arrow_length*v[1], **arr_opts)
|
101
|
-
plt.text(origin[0], origin[1], f'$\\theta_0$ = {theta0}$^o$\n $T_p$={Tp} s\n
|
101
|
+
plt.text(origin[0], origin[1], f'$\\theta_0$ = {theta0}$^o$\n $T_p$={Tp} s\n $\\lambda=${wave_length:.0f} m')
|
102
102
|
|
103
103
|
dv = v*wave_length
|
104
104
|
for n in range(n_repeats):
|
@@ -317,7 +317,10 @@ def _set_axes_radius(ax, origin, radius):
|
|
317
317
|
ax.set_ylim3d([y - radius, y + radius])
|
318
318
|
ax.set_zlim3d([z - radius, z + radius])
|
319
319
|
|
320
|
-
def equal_3d(ax=
|
320
|
+
def equal_3d(ax=None):
|
321
|
+
if ax is None:
|
322
|
+
ax = plt.gca()
|
323
|
+
|
321
324
|
x_lims = np.array(ax.get_xlim())
|
322
325
|
y_lims = np.array(ax.get_ylim())
|
323
326
|
z_lims = np.array(ax.get_zlim())
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: wawi
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9
|
4
4
|
Summary: WAve and WInd response prediction
|
5
5
|
Author-email: "Knut A. Kvåle" <knut.a.kvale@ntnu.no>, Ole Øiseth <ole.oiseth@ntnu.no>, Aksel Fenerci <aksel.fenerci@ntnu.no>, Øivind Wiig Petersen <oyvind.w.petersen@ntnu.no>
|
6
6
|
License: MIT License
|
@@ -0,0 +1,39 @@
|
|
1
|
+
examples/3 Software interfacing/Abaqus model export/bergsoysund-export.py,sha256=-1jrDNmevOcB1IV0iLOiW0z-QiNkOv8GkGk-7K8CcK0,2606
|
2
|
+
examples/3 Software interfacing/Abaqus model export/test.py,sha256=kAmol3XZQ2jkO2qujEQrqx38Q24LbzrYZzqE5ng5-E8,2188
|
3
|
+
tests/test_IABSE_step11a.py,sha256=guRsaP9gpERvSp0Ui3hO-WH764BcIe6Qx8vC4QVTAoU,8013
|
4
|
+
tests/test_IABSE_step11c.py,sha256=U_NcL6BAmnQG7MSjkr8KYk9hH8ZPdZgg17pM9ugUBzo,10412
|
5
|
+
tests/test_IABSE_step2a.py,sha256=L5AyTOJZ_sPmcmW_4h-sQfRwvVW71LZkXc1yz33DABM,10203
|
6
|
+
tests/test_wind.py,sha256=r4rx6f8Tn-u4fn4gGPBMrL_JJQ2SVHGQiQ9sQuMQCPo,1707
|
7
|
+
wawi/__init__.py,sha256=nOz20Bt2hcYkKQG7fG0ogBRbLfEZbIgvU1iZjjjHNZ4,158
|
8
|
+
wawi/fe.py,sha256=22QKI1GlfsG7o_TpFXaKJfzmbO2_2zdIMaoJmaIZdmY,4001
|
9
|
+
wawi/general.py,sha256=xHRoDkcchrL6Y7pTUqGsjBHh8YBLvX9dYcNXXCjQap8,13787
|
10
|
+
wawi/identification.py,sha256=bVB6EVRR6J39OO9ckuzNJ6f0FwIo4cLqfYgrsIN89TE,1748
|
11
|
+
wawi/io.py,sha256=NrziwlebaZUEdu8nWKNXKExHNZZKMzJ0gSHciBTJ4As,25323
|
12
|
+
wawi/modal.py,sha256=WjNGFsk0C3tYRy18Q9WNRCatmGJtq1JSv0WrkGV02Eo,20247
|
13
|
+
wawi/plot.py,sha256=jllJcjZxTBqjzBoT4k9jLXVUnie8oqNr8371IJvCd3c,19791
|
14
|
+
wawi/prob.py,sha256=0nCdKdwkNf4M6sHyCZuYlt06gD0NmqRNfl4KesgySWA,215
|
15
|
+
wawi/random.py,sha256=MHPpyTlRJSJFkCmeTAmw4Q5K1BPoFVb0Nxg0jDhkuIM,871
|
16
|
+
wawi/signal.py,sha256=9HJs7VUhXOccuYPo12A0IUVoBIAJ2e_9F3rL-q3JuP4,1179
|
17
|
+
wawi/structural.py,sha256=t25ohH4uBbzUJ7Hqn_kUfYhxcikZkRp8da-9dn7aEbw,8341
|
18
|
+
wawi/time_domain.py,sha256=Oe-jviwDtBgpSmA7ZVmKEqQ5tdvsekXwOakYO1qUsN4,3841
|
19
|
+
wawi/tools.py,sha256=-hFBvf0qK4AMn2MQRhrOitDMMMKm2QuRkVfbPBefEkQ,332
|
20
|
+
wawi/wave.py,sha256=hhKg3KhKMBhOoCI7g8PFOGUbYgVhDyGmnYdBEdJ8mkY,16064
|
21
|
+
wawi/wind.py,sha256=1rUqiEdMaUrhprs87TBdX24l1uDCOINaYkBChMLYWso,38208
|
22
|
+
wawi/wind_code.py,sha256=8OKLPpqc84obNNKBoYb2NunKjcn6a3i_pAWpIFEwg4Q,223
|
23
|
+
wawi/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
|
+
wawi/ext/abq.py,sha256=Wo-Zzb6b3lr_z7cNKTW-NdYJuVeAwZgwzlGhF_5Jym0,8905
|
25
|
+
wawi/ext/abq_legacy.py,sha256=WVhoPjRAru98NxYqpKp9_G8wwfJiLO4X4xFc-CvI0j4,16494
|
26
|
+
wawi/ext/ansys.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
+
wawi/ext/orcaflex.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
+
wawi/ext/sofistik.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
+
wawi/model/__init__.py,sha256=u6B-dugP76LBkOUVMs0KAoQ81PeRHwFL0M8MbNeAaJA,218
|
30
|
+
wawi/model/_aero.py,sha256=tvWMjMoVi9ZVBc3NZ_s-wSofbEk1cc5jf5s-Swv2RxQ,9337
|
31
|
+
wawi/model/_dry.py,sha256=KpmFlSinoY6DrSyc3Y0M8w1-cCC7VCFep-uzcqZsHz4,3940
|
32
|
+
wawi/model/_hydro.py,sha256=1tUj19OgvEjItNtBxXuPHf0zWtKv_ioTrOcgl9Ov3dg,26960
|
33
|
+
wawi/model/_model.py,sha256=qmQRASu3E3iRqxzAeT3wUxonuADbCxreXiERR9KHwb0,52090
|
34
|
+
wawi/model/_screening.py,sha256=NRYkKq928z2lqMSUTpbQLls04td_9R_4dhkjU3Gv1oQ,3716
|
35
|
+
wawi-0.0.9.dist-info/LICENSE,sha256=bH1aWhrNbbPLrYnVFRaoYYzcUr-figHjry-kGB7Tc54,1076
|
36
|
+
wawi-0.0.9.dist-info/METADATA,sha256=zoyYWdj03UGEOq7jt7XqUgd0XdV-KmEzI99lBmNJ6cE,5197
|
37
|
+
wawi-0.0.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
38
|
+
wawi-0.0.9.dist-info/top_level.txt,sha256=Nk5G_ZwgZRCb9ZMWZdr1M3QIskX6kCnlqeMl67N3zg8,20
|
39
|
+
wawi-0.0.9.dist-info/RECORD,,
|
wawi-0.0.7.dist-info/RECORD
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
wawi/__init__.py,sha256=ZGsScT_c7WfnnnPCIKTMq2u95I502YsW9e2AXSVKAaY,158
|
2
|
-
wawi/fe.py,sha256=22QKI1GlfsG7o_TpFXaKJfzmbO2_2zdIMaoJmaIZdmY,4001
|
3
|
-
wawi/general.py,sha256=xHRoDkcchrL6Y7pTUqGsjBHh8YBLvX9dYcNXXCjQap8,13787
|
4
|
-
wawi/identification.py,sha256=bVB6EVRR6J39OO9ckuzNJ6f0FwIo4cLqfYgrsIN89TE,1748
|
5
|
-
wawi/io.py,sha256=5p3q_lQStQR85yo5hZ1Syl25RS2C__zIyV6e_2qRRw4,25308
|
6
|
-
wawi/modal.py,sha256=WjNGFsk0C3tYRy18Q9WNRCatmGJtq1JSv0WrkGV02Eo,20247
|
7
|
-
wawi/plot.py,sha256=XVaQjkjXv26Kt-G8xtAULa4KbWcCIErTQfB6euPACLg,19750
|
8
|
-
wawi/prob.py,sha256=0nCdKdwkNf4M6sHyCZuYlt06gD0NmqRNfl4KesgySWA,215
|
9
|
-
wawi/random.py,sha256=MHPpyTlRJSJFkCmeTAmw4Q5K1BPoFVb0Nxg0jDhkuIM,871
|
10
|
-
wawi/signal.py,sha256=9HJs7VUhXOccuYPo12A0IUVoBIAJ2e_9F3rL-q3JuP4,1179
|
11
|
-
wawi/structural.py,sha256=t25ohH4uBbzUJ7Hqn_kUfYhxcikZkRp8da-9dn7aEbw,8341
|
12
|
-
wawi/time_domain.py,sha256=Oe-jviwDtBgpSmA7ZVmKEqQ5tdvsekXwOakYO1qUsN4,3841
|
13
|
-
wawi/tools.py,sha256=-hFBvf0qK4AMn2MQRhrOitDMMMKm2QuRkVfbPBefEkQ,332
|
14
|
-
wawi/wave.py,sha256=hhKg3KhKMBhOoCI7g8PFOGUbYgVhDyGmnYdBEdJ8mkY,16064
|
15
|
-
wawi/wind.py,sha256=1rUqiEdMaUrhprs87TBdX24l1uDCOINaYkBChMLYWso,38208
|
16
|
-
wawi/wind_code.py,sha256=8OKLPpqc84obNNKBoYb2NunKjcn6a3i_pAWpIFEwg4Q,223
|
17
|
-
wawi-0.0.7.dist-info/LICENSE,sha256=bH1aWhrNbbPLrYnVFRaoYYzcUr-figHjry-kGB7Tc54,1076
|
18
|
-
wawi-0.0.7.dist-info/METADATA,sha256=8rKv08-csO88ctlULuHEvJ0CPGLeIPmwh-5LiWi71SE,5197
|
19
|
-
wawi-0.0.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
20
|
-
wawi-0.0.7.dist-info/top_level.txt,sha256=sE2NH_xVXnDKTGeIYzeX5IyU_j5vYDLl32v5uLiOMT4,5
|
21
|
-
wawi-0.0.7.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
wawi
|
File without changes
|
File without changes
|