h2lib 13.1.3101__py3-none-win_amd64.whl → 13.1.3103__py3-none-win_amd64.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.
- h2lib/HAWC2Lib.dll +0 -0
- h2lib/_h2lib.py +50 -19
- h2lib/_version.py +3 -3
- h2lib/dll_wrapper.py +19 -1
- h2lib/h2lib_signatures.py +172 -128
- {h2lib-13.1.3101.dist-info → h2lib-13.1.3103.dist-info}/METADATA +2 -2
- h2lib-13.1.3103.dist-info/RECORD +10 -0
- h2lib-13.1.3101.dist-info/RECORD +0 -10
- {h2lib-13.1.3101.dist-info → h2lib-13.1.3103.dist-info}/WHEEL +0 -0
- {h2lib-13.1.3101.dist-info → h2lib-13.1.3103.dist-info}/top_level.txt +0 -0
h2lib/HAWC2Lib.dll
CHANGED
Binary file
|
h2lib/_h2lib.py
CHANGED
@@ -52,6 +52,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
52
52
|
if os.path.isdir(os.path.join(f, 'Library/bin')):
|
53
53
|
os.add_dll_directory(os.path.join(f, 'Library/bin'))
|
54
54
|
DLLWrapper.__init__(self, filename, cwd=cwd, cdecl=True)
|
55
|
+
self.stop_on_error(False)
|
55
56
|
self.suppress_output = suppress_output
|
56
57
|
self._initialized = False
|
57
58
|
self.time = 0
|
@@ -116,19 +117,53 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
116
117
|
def get_time(self):
|
117
118
|
return np.round(H2LibSignatures.get_time(self, time=0.)[0][0], 6)
|
118
119
|
|
119
|
-
def read_input(self, htc_path
|
120
|
-
|
121
|
-
|
122
|
-
|
120
|
+
def read_input(self, htc_path, model_path='.'):
|
121
|
+
if htc_path is not None:
|
122
|
+
self._model_path = model_path
|
123
|
+
self.cwd = self.model_path
|
124
|
+
return H2LibSignatures.read_input(self, htc_path)
|
123
125
|
|
124
126
|
def init(self, htc_path=None, model_path='.'):
|
125
|
-
assert not
|
126
|
-
|
127
|
-
self.read_input(htc_path, model_path)
|
127
|
+
assert not self._initialized, "h2lib already initialized via init, init_AD or init_AL"
|
128
|
+
self.read_input(htc_path, model_path)
|
128
129
|
r = H2LibSignatures.init(self)
|
129
130
|
self._initialized = True
|
130
131
|
return r
|
131
132
|
|
133
|
+
def init_AD(self, htc_path=None, model_path='.', tiploss_method=2, tiploss_shen_c2=21, rotor=0):
|
134
|
+
"""Initialize HAWC2 for Actuator Disc workflow, where wind speeds including induction at the aerodynamic sections
|
135
|
+
are passed from e.g. CFD to HAWC2 via set_aerosections_windspeed.
|
136
|
+
This function will:
|
137
|
+
- Disable wind speed update at blade sections (wind speeds must be set via set_aerosections_windspeed)
|
138
|
+
- Disable HAWC2 induction (induction_method=0).
|
139
|
+
- set GetWindSpeedData%u_mean=nan to avoid unintended use of the free wind module in HAWC2
|
140
|
+
- set the tiploss_method. The default method is 2, which works with the AD workflow, but the tiploss_shen_c2
|
141
|
+
parameter must be tuned to give sensible results, see tiploss_method in the HAWC2 manual
|
142
|
+
"""
|
143
|
+
assert not self._initialized, "h2lib already initialized via init, init_AD or init_AL"
|
144
|
+
self.read_input(htc_path, model_path)
|
145
|
+
r = H2LibSignatures.init_AD(self, rotor + 1, int(tiploss_method), float(tiploss_shen_c2))
|
146
|
+
self._initialized = True
|
147
|
+
return r
|
148
|
+
|
149
|
+
def init_AL(self, epsilon_smearing, htc_path=None, model_path='.', rotor=0):
|
150
|
+
"""Initialize HAWC2 for Actuator Line workflow, where wind speeds including induction at the aerodynamic sections
|
151
|
+
are passed from e.g. CFD to HAWC2 via set_aerosections_windspeed.
|
152
|
+
This function will:
|
153
|
+
- Disable wind speed update at blade sections (wind speeds must be set via set_aerosections_windspeed)
|
154
|
+
- Enable viscous core correction which compensates for the missing induction due to smearing of the forces.
|
155
|
+
The method calculates the missing induction as a smearing factor times the normal near wake induction
|
156
|
+
(induction_method=2) while disregarding the BEM farwake contribution.
|
157
|
+
The smearing factor is based on the smearing size given by epsilon_smearing [m].
|
158
|
+
- set GetWindSpeedData%u_mean=nan to avoid unintended use of the free wind module in HAWC2
|
159
|
+
- set the tiploss_method to 0, to avoid unintended additional tiploss correction
|
160
|
+
"""
|
161
|
+
assert not self._initialized, "h2lib already initialized via init, init_AD or init_AL"
|
162
|
+
self.read_input(htc_path, model_path)
|
163
|
+
r = H2LibSignatures.init_AL(self, rotor=rotor + 1, epsilon_smearing=float(epsilon_smearing))
|
164
|
+
self._initialized = True
|
165
|
+
return r
|
166
|
+
|
132
167
|
def step(self):
|
133
168
|
self.time = np.round(H2LibSignatures.step(self, restype=np.float64)[1], 6)
|
134
169
|
return self.time
|
@@ -375,7 +410,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
375
410
|
|
376
411
|
"""
|
377
412
|
error_code = -1
|
378
|
-
_, error_code = H2LibSignatures.solver_static_run(self, reset_structure, error_code)[0]
|
413
|
+
_, error_code = H2LibSignatures.solver_static_run(self, reset_structure, error_code, check_stop=False)[0]
|
379
414
|
if error_code > 0:
|
380
415
|
raise _ERROR_CODES[error_code]
|
381
416
|
|
@@ -588,7 +623,8 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
588
623
|
bool(angles_in_deg),
|
589
624
|
reset_orientation,
|
590
625
|
np.asfortranarray(mbdy2_ini_rotvec_d1).astype(np.float64),
|
591
|
-
error_code
|
626
|
+
error_code,
|
627
|
+
check_stop=False)[0][-1]
|
592
628
|
if error_code > 0:
|
593
629
|
raise _ERROR_CODES[error_code]
|
594
630
|
|
@@ -775,7 +811,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
775
811
|
ncst,
|
776
812
|
error_code,
|
777
813
|
) = H2LibSignatures.get_number_of_bodies_and_constraints(
|
778
|
-
self, nbdy, ncst, error_code
|
814
|
+
self, nbdy, ncst, error_code, check_stop=False
|
779
815
|
)[
|
780
816
|
0
|
781
817
|
]
|
@@ -803,7 +839,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
803
839
|
nelem = np.zeros((nbdy, ), dtype=np.int64, order="F")
|
804
840
|
error_code = -1
|
805
841
|
_, nelem, error_code = H2LibSignatures.get_number_of_elements(
|
806
|
-
self, nbdy, nelem, error_code
|
842
|
+
self, nbdy, nelem, error_code, check_stop=False
|
807
843
|
)[0]
|
808
844
|
|
809
845
|
if error_code > 0: # pragma: no cover
|
@@ -856,10 +892,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
856
892
|
tes,
|
857
893
|
error_code,
|
858
894
|
) = H2LibSignatures.get_timoshenko_location(
|
859
|
-
self, ibdy + 1, ielem + 1, l, r1, r12, tes, error_code
|
860
|
-
)[
|
861
|
-
0
|
862
|
-
]
|
895
|
+
self, ibdy + 1, ielem + 1, l, r1, r12, tes, error_code, check_stop=False)[0]
|
863
896
|
if error_code > 0:
|
864
897
|
raise _ERROR_CODES[error_code]
|
865
898
|
return l, r1, r12, tes
|
@@ -889,8 +922,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
889
922
|
amat = np.zeros((3, 3), order="F")
|
890
923
|
error_code = -1
|
891
924
|
_, amat, error_code = H2LibSignatures.get_body_rotation_tensor(
|
892
|
-
self, ibdy + 1, amat, error_code
|
893
|
-
)[0]
|
925
|
+
self, ibdy + 1, amat, error_code, check_stop=False)[0]
|
894
926
|
if error_code > 0:
|
895
927
|
raise _ERROR_CODES[error_code]
|
896
928
|
return amat
|
@@ -934,8 +966,7 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
934
966
|
error_code = -1
|
935
967
|
|
936
968
|
_, _, M, C, K, R, error_code = H2LibSignatures.get_system_matrices(
|
937
|
-
self, n_tdofs, n_rdofs, M, C, K, R, error_code
|
938
|
-
)[0]
|
969
|
+
self, n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=False)[0]
|
939
970
|
|
940
971
|
if error_code > 0:
|
941
972
|
raise _ERROR_CODES[error_code]
|
h2lib/_version.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
# This file is autogenerated and should not be modified manually
|
2
|
-
__version__ = '13.1.
|
3
|
-
h2lib_version = '13.1.
|
4
|
-
hawc2_version = '13.1.31+
|
2
|
+
__version__ = '13.1.3103'
|
3
|
+
h2lib_version = '13.1.3103'
|
4
|
+
hawc2_version = '13.1.31+5-g08eea40'
|
h2lib/dll_wrapper.py
CHANGED
@@ -89,7 +89,7 @@ def cwd(f):
|
|
89
89
|
return wrap
|
90
90
|
|
91
91
|
|
92
|
-
def wrap(self, f, *args, **kwargs):
|
92
|
+
def wrap(self, f, *args, check_stop=True, **kwargs):
|
93
93
|
c_args = []
|
94
94
|
args = list(args)
|
95
95
|
for i, arg in enumerate(args):
|
@@ -149,6 +149,12 @@ def wrap(self, f, *args, **kwargs):
|
|
149
149
|
res = f(*c_args)
|
150
150
|
else:
|
151
151
|
res = f(*c_args)
|
152
|
+
try:
|
153
|
+
self.check_stop()
|
154
|
+
except BaseException:
|
155
|
+
if check_stop:
|
156
|
+
raise
|
157
|
+
|
152
158
|
ret_args = []
|
153
159
|
for arg in args:
|
154
160
|
c_arg = c_args.pop(0)
|
@@ -178,6 +184,18 @@ class DLLWrapper(object):
|
|
178
184
|
in_use.append(os.path.abspath(self.filename))
|
179
185
|
atexit.register(self.close)
|
180
186
|
|
187
|
+
def check_stop(self):
|
188
|
+
stop_code = 0
|
189
|
+
cstop_code = c_long_p(c_longlong(stop_code))
|
190
|
+
getattr(self.lib, 'get_stop_code')(cstop_code)
|
191
|
+
if cstop_code.contents.value:
|
192
|
+
stop_msg = (" " * 1024).encode('cp1252')
|
193
|
+
cstop_msg = c_char_p(stop_msg)
|
194
|
+
getattr(self.lib, 'get_stop_message')(cstop_msg)
|
195
|
+
stop_msg = cstop_msg.value.decode('cp1252').strip()
|
196
|
+
getattr(self.lib, 'reset_stop_code_and_message')()
|
197
|
+
raise Exception(stop_msg)
|
198
|
+
|
181
199
|
@staticmethod
|
182
200
|
def find_dll(path, name):
|
183
201
|
p = Path(path)
|
h2lib/h2lib_signatures.py
CHANGED
@@ -4,23 +4,24 @@ from h2lib.dll_wrapper import DLLWrapper
|
|
4
4
|
|
5
5
|
|
6
6
|
class H2LibSignatures():
|
7
|
-
def add_sensor(self, sensor_line, index_start, index_stop):
|
7
|
+
def add_sensor(self, sensor_line, index_start, index_stop, check_stop=True):
|
8
8
|
'''subroutine add_sensor(sensor_line, index_start, index_stop) bind(C, name="add_sensor")
|
9
9
|
integer*8 :: index_start, index_stop
|
10
10
|
character(kind=c_char, len=1), intent(in) :: sensor_line(1024)
|
11
11
|
end subroutine'''
|
12
|
-
return self.get_lib_function('add_sensor')(sensor_line, index_start, index_stop)
|
12
|
+
return self.get_lib_function('add_sensor')(sensor_line, index_start, index_stop, check_stop=check_stop)
|
13
13
|
|
14
|
-
def check_convergence(self, bconv, resq, resg, resd):
|
14
|
+
def check_convergence(self, bconv, resq, resg, resd, check_stop=True):
|
15
15
|
'''subroutine check_convergence(bconv, resq, resg, resd) bind(C, name='check_convergence')
|
16
16
|
logical(kind=c_bool), intent(out) :: bconv
|
17
17
|
real(c_double), intent(out) :: resq
|
18
18
|
real(c_double), intent(out) :: resg
|
19
19
|
real(c_double), intent(out) :: resd
|
20
20
|
end subroutine'''
|
21
|
-
return self.get_lib_function('check_convergence')(bconv, resq, resg, resd)
|
21
|
+
return self.get_lib_function('check_convergence')(bconv, resq, resg, resd, check_stop=check_stop)
|
22
22
|
|
23
|
-
def do_system_eigenanalysis(self, include_damping, n_modes, natural_frequencies,
|
23
|
+
def do_system_eigenanalysis(self, include_damping, n_modes, natural_frequencies,
|
24
|
+
damping_ratios, error_code, check_stop=True):
|
24
25
|
'''subroutine do_system_eigenanalysis(include_damping, n_modes, natural_frequencies, damping_ratios, error_code) &
|
25
26
|
logical(kind=c_bool), intent(in) :: include_damping
|
26
27
|
integer(kind=4), intent(in) :: n_modes
|
@@ -28,190 +29,192 @@ real(kind=c_double), dimension(n_modes), intent(out) :: natural_frequencies
|
|
28
29
|
real(kind=c_double), dimension(n_modes), intent(out) :: damping_ratios
|
29
30
|
integer(kind=8), intent(out) :: error_code
|
30
31
|
end subroutine'''
|
31
|
-
return self.get_lib_function('do_system_eigenanalysis')(include_damping, n_modes,
|
32
|
+
return self.get_lib_function('do_system_eigenanalysis')(include_damping, n_modes,
|
33
|
+
natural_frequencies, damping_ratios, error_code, check_stop=check_stop)
|
32
34
|
|
33
|
-
def echo_version(self, ):
|
35
|
+
def echo_version(self, check_stop=True):
|
34
36
|
'''subroutine echo_version() BIND(C, NAME='echo_version')
|
35
37
|
!DEC$ ATTRIBUTES DLLEXPORT :: echo_version
|
36
38
|
!GCC$ ATTRIBUTES DLLEXPORT :: echo_version
|
37
39
|
type (tbuildinfo) :: b
|
38
40
|
end subroutine'''
|
39
|
-
return self.get_lib_function('echo_version')()
|
41
|
+
return self.get_lib_function('echo_version')(check_stop=check_stop)
|
40
42
|
|
41
|
-
def extern_write_log(self, c_msg, n, dll_name, error, warning):
|
43
|
+
def extern_write_log(self, c_msg, n, dll_name, error, warning, check_stop=True):
|
42
44
|
'''subroutine extern_write_log(c_msg, n, dll_name, error, warning) bind(C, name="extern_write_log")
|
43
45
|
integer, intent(in) :: n
|
44
46
|
character(kind=c_char, len=1), intent(in) :: c_msg(n)
|
45
47
|
character(kind=c_char), intent(in) :: dll_name(50)
|
46
48
|
logical(kind=c_bool), intent(in), optional :: error, warning
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
character(kind=c_char, len=1), intent(in) :: c_msg(n_msg)
|
50
|
+
integer, intent(in) :: n_msg
|
51
|
+
character(kind=c_char), intent(in) :: dll_name(50)
|
52
|
+
character(len=50) :: n
|
53
|
+
logical(kind=c_bool), intent(in), optional :: error, warning
|
52
54
|
end subroutine'''
|
53
|
-
return self.get_lib_function('extern_write_log')(c_msg, n, dll_name, error, warning)
|
55
|
+
return self.get_lib_function('extern_write_log')(c_msg, n, dll_name, error, warning, check_stop=check_stop)
|
54
56
|
|
55
|
-
def fail(self, str_arr):
|
57
|
+
def fail(self, str_arr, check_stop=True):
|
56
58
|
'''subroutine fail(str_arr) bind(C, name='fail')
|
57
59
|
character(kind=c_char, len=1), intent(inout) :: str_arr(255)
|
58
60
|
end subroutine'''
|
59
|
-
return self.get_lib_function('fail')(str_arr)
|
61
|
+
return self.get_lib_function('fail')(str_arr, check_stop=check_stop)
|
60
62
|
|
61
|
-
def finalize(self, ):
|
63
|
+
def finalize(self, check_stop=True):
|
62
64
|
'''SUBROUTINE finalize() bind(C, name="finalize")
|
63
65
|
!DEC$ ATTRIBUTES DLLEXPORT :: finalize
|
64
66
|
integer:: i
|
65
67
|
real*4:: T2
|
66
68
|
END SUBROUTINE'''
|
67
|
-
return self.get_lib_function('finalize')()
|
69
|
+
return self.get_lib_function('finalize')(check_stop=check_stop)
|
68
70
|
|
69
|
-
def getSquare(self, val, restype):
|
71
|
+
def getSquare(self, val, restype, check_stop=True):
|
70
72
|
'''function getSquare(val) result(valSquared) BIND(C, NAME='getSquare')
|
71
73
|
!DEC$ ATTRIBUTES DLLEXPORT :: getSquare
|
72
74
|
real(RK), intent(in) :: val
|
73
75
|
real(RK) :: valSquared
|
74
76
|
end function'''
|
75
|
-
return self.get_lib_function('getSquare')(val, restype=restype)
|
77
|
+
return self.get_lib_function('getSquare')(val, restype=restype, check_stop=check_stop)
|
76
78
|
|
77
|
-
def getState(self, restype):
|
79
|
+
def getState(self, restype, check_stop=True):
|
78
80
|
'''function getState() result(val) BIND(C, NAME='getState')
|
79
81
|
!DEC$ ATTRIBUTES DLLEXPORT :: getState
|
80
82
|
integer :: val
|
81
83
|
end function'''
|
82
|
-
return self.get_lib_function('getState')(restype=restype)
|
84
|
+
return self.get_lib_function('getState')(restype=restype, check_stop=check_stop)
|
83
85
|
|
84
|
-
def get_aerosections_forces(self, rotor, Fxyz):
|
86
|
+
def get_aerosections_forces(self, rotor, Fxyz, check_stop=True):
|
85
87
|
'''subroutine get_aerosections_forces(rotor, Fxyz) bind(C, name='get_aerosections_forces')
|
86
88
|
integer*8, intent(in) :: rotor
|
87
89
|
real(c_double),intent(out)::Fxyz(rotors_gl%rotor(rotor)%nbld, rotors_gl%rotor(rotor)%blade(1)%nsec, 3)
|
88
90
|
end subroutine'''
|
89
|
-
return self.get_lib_function('get_aerosections_forces')(rotor, Fxyz)
|
91
|
+
return self.get_lib_function('get_aerosections_forces')(rotor, Fxyz, check_stop=check_stop)
|
90
92
|
|
91
|
-
def get_aerosections_moments(self, rotor, Mxyz):
|
93
|
+
def get_aerosections_moments(self, rotor, Mxyz, check_stop=True):
|
92
94
|
'''subroutine get_aerosections_moments(rotor, Mxyz) bind(C, name='get_aerosections_moments')
|
93
95
|
integer*8, intent(in) :: rotor
|
94
96
|
real(c_double),intent(out):: Mxyz(rotors_gl%rotor(rotor)%nbld, rotors_gl%rotor(rotor)%blade(1)%nsec, 3)
|
95
97
|
end subroutine'''
|
96
|
-
return self.get_lib_function('get_aerosections_moments')(rotor, Mxyz)
|
98
|
+
return self.get_lib_function('get_aerosections_moments')(rotor, Mxyz, check_stop=check_stop)
|
97
99
|
|
98
|
-
def get_aerosections_position(self, rotor, position):
|
100
|
+
def get_aerosections_position(self, rotor, position, check_stop=True):
|
99
101
|
'''subroutine get_aerosections_position(rotor, position) bind(C, name="get_aerosections_position")
|
100
102
|
integer*8, intent(in) :: rotor
|
101
103
|
real(c_double),intent(out) :: position(rotors_gl%rotor(rotor)%nbld, rotors_gl%rotor(rotor)%blade(1)%nsec, 3)
|
102
104
|
end subroutine'''
|
103
|
-
return self.get_lib_function('get_aerosections_position')(rotor, position)
|
105
|
+
return self.get_lib_function('get_aerosections_position')(rotor, position, check_stop=check_stop)
|
104
106
|
|
105
|
-
def get_bem_grid(self, rotor, azi, rad):
|
107
|
+
def get_bem_grid(self, rotor, azi, rad, check_stop=True):
|
106
108
|
'''subroutine get_bem_grid(rotor, azi, rad) bind(C, name="get_bem_grid")
|
107
109
|
integer*8, intent(in) :: rotor
|
108
110
|
real(c_double), intent(out) :: azi(rotors_gl%rotor(rotor)%dyn_induc%bem%nazi)
|
109
111
|
real(c_double), intent(out) :: rad(rotors_gl%rotor(rotor)%dyn_induc%bem%nrad)
|
110
112
|
end subroutine'''
|
111
|
-
return self.get_lib_function('get_bem_grid')(rotor, azi, rad)
|
113
|
+
return self.get_lib_function('get_bem_grid')(rotor, azi, rad, check_stop=check_stop)
|
112
114
|
|
113
|
-
def get_bem_grid_dim(self, rotor, nazi, nrad):
|
115
|
+
def get_bem_grid_dim(self, rotor, nazi, nrad, check_stop=True):
|
114
116
|
'''subroutine get_bem_grid_dim(rotor, nazi, nrad) bind(C, name="get_bem_grid_dim")
|
115
117
|
integer*8, intent(in) :: rotor
|
116
118
|
integer*8, intent(out) :: nazi, nrad
|
117
119
|
end subroutine'''
|
118
|
-
return self.get_lib_function('get_bem_grid_dim')(rotor, nazi, nrad)
|
120
|
+
return self.get_lib_function('get_bem_grid_dim')(rotor, nazi, nrad, check_stop=check_stop)
|
119
121
|
|
120
|
-
def get_body_rotation_tensor(self, ibdy, amat, error_code):
|
122
|
+
def get_body_rotation_tensor(self, ibdy, amat, error_code, check_stop=True):
|
121
123
|
'''subroutine get_body_rotation_tensor(ibdy, amat, error_code) &
|
122
124
|
integer(kind=8), intent(in) :: ibdy
|
123
125
|
real(kind=c_double), dimension(3, 3), intent(out) :: amat
|
124
126
|
integer(kind=8), intent(out) :: error_code
|
125
127
|
end subroutine'''
|
126
|
-
return self.get_lib_function('get_body_rotation_tensor')(ibdy, amat, error_code)
|
128
|
+
return self.get_lib_function('get_body_rotation_tensor')(ibdy, amat, error_code, check_stop=check_stop)
|
127
129
|
|
128
|
-
def get_diameter(self, rotor, restype):
|
130
|
+
def get_diameter(self, rotor, restype, check_stop=True):
|
129
131
|
'''function get_diameter(rotor) bind(C, name="get_diameter")
|
130
132
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_diameter
|
131
133
|
integer*8, intent(in) :: rotor
|
132
134
|
Type (Taerorotor),pointer :: rotor_p
|
133
135
|
real(c_double) :: get_diameter
|
134
136
|
end function'''
|
135
|
-
return self.get_lib_function('get_diameter')(rotor, restype=restype)
|
137
|
+
return self.get_lib_function('get_diameter')(rotor, restype=restype, check_stop=check_stop)
|
136
138
|
|
137
|
-
def get_induction_axisymmetric(self, rotor, induction):
|
139
|
+
def get_induction_axisymmetric(self, rotor, induction, check_stop=True):
|
138
140
|
'''subroutine get_induction_axisymmetric(rotor, induction) bind(C, name="get_induction_axisymmetric")
|
139
141
|
integer*8, intent(in) :: rotor
|
140
142
|
real(c_double),intent(out) :: induction(rotors_gl%rotor(rotor)%dyn_induc%bem%nrad)
|
141
143
|
end subroutine'''
|
142
|
-
return self.get_lib_function('get_induction_axisymmetric')(rotor, induction)
|
144
|
+
return self.get_lib_function('get_induction_axisymmetric')(rotor, induction, check_stop=check_stop)
|
143
145
|
|
144
|
-
def get_induction_polargrid(self, rotor, induction):
|
146
|
+
def get_induction_polargrid(self, rotor, induction, check_stop=True):
|
145
147
|
'''subroutine get_induction_polargrid(rotor, induction) bind(C, name="get_induction_polargrid")
|
146
148
|
integer*8, intent(in) :: rotor
|
147
149
|
real(c_double),intent(out) :: induction(rotors_gl%rotor(rotor)%dyn_induc%bem%nazi, rotors_gl%rotor(rotor)%dyn_induc%bem%nrad)
|
148
150
|
end subroutine'''
|
149
|
-
return self.get_lib_function('get_induction_polargrid')(rotor, induction)
|
151
|
+
return self.get_lib_function('get_induction_polargrid')(rotor, induction, check_stop=check_stop)
|
150
152
|
|
151
|
-
def get_induction_rotoravg(self, rotor, induction):
|
153
|
+
def get_induction_rotoravg(self, rotor, induction, check_stop=True):
|
152
154
|
'''subroutine get_induction_rotoravg(rotor, induction) bind(C, name="get_induction_rotoravg")
|
153
155
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_induction_rotoravg
|
154
156
|
integer*8, intent(in) :: rotor
|
155
157
|
real(c_double), intent(out) :: induction
|
156
158
|
end subroutine'''
|
157
|
-
return self.get_lib_function('get_induction_rotoravg')(rotor, induction)
|
159
|
+
return self.get_lib_function('get_induction_rotoravg')(rotor, induction, check_stop=check_stop)
|
158
160
|
|
159
|
-
def get_nSections(self, rotor, blade, restype):
|
161
|
+
def get_nSections(self, rotor, blade, restype, check_stop=True):
|
160
162
|
'''function get_nSections(rotor, blade) bind(C, name="get_nSections")
|
161
163
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_nSections
|
162
164
|
integer*8, intent(in) :: rotor, blade
|
163
165
|
integer*8 :: get_nSections
|
164
166
|
end function'''
|
165
|
-
return self.get_lib_function('get_nSections')(rotor, blade, restype=restype)
|
167
|
+
return self.get_lib_function('get_nSections')(rotor, blade, restype=restype, check_stop=check_stop)
|
166
168
|
|
167
|
-
def get_nblades(self, rotor, restype):
|
169
|
+
def get_nblades(self, rotor, restype, check_stop=True):
|
168
170
|
'''function get_nblades(rotor) bind(C, name="get_nblades")
|
169
171
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_nblades
|
170
172
|
integer*8, intent(in) :: rotor
|
171
173
|
integer*8 :: get_nblades
|
172
174
|
end function'''
|
173
|
-
return self.get_lib_function('get_nblades')(rotor, restype=restype)
|
175
|
+
return self.get_lib_function('get_nblades')(rotor, restype=restype, check_stop=check_stop)
|
174
176
|
|
175
|
-
def get_nrotors(self, restype):
|
177
|
+
def get_nrotors(self, restype, check_stop=True):
|
176
178
|
'''function get_nrotors() bind(C, name="get_nrotors")
|
177
179
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_nrotors
|
178
180
|
integer*8 :: get_nrotors
|
179
181
|
end function'''
|
180
|
-
return self.get_lib_function('get_nrotors')(restype=restype)
|
182
|
+
return self.get_lib_function('get_nrotors')(restype=restype, check_stop=check_stop)
|
181
183
|
|
182
|
-
def get_number_of_bodies_and_constraints(self, nbdy, ncst, error_code):
|
184
|
+
def get_number_of_bodies_and_constraints(self, nbdy, ncst, error_code, check_stop=True):
|
183
185
|
'''subroutine get_number_of_bodies_and_constraints(nbdy, ncst, error_code) &
|
184
186
|
integer(kind=8), intent(out) :: nbdy
|
185
187
|
integer(kind=8), intent(out) :: ncst
|
186
188
|
integer(kind=8), intent(out) :: error_code
|
187
189
|
end subroutine'''
|
188
|
-
return self.get_lib_function('get_number_of_bodies_and_constraints')(
|
190
|
+
return self.get_lib_function('get_number_of_bodies_and_constraints')(
|
191
|
+
nbdy, ncst, error_code, check_stop=check_stop)
|
189
192
|
|
190
|
-
def get_number_of_elements(self, nbdy, nelem, error_code):
|
193
|
+
def get_number_of_elements(self, nbdy, nelem, error_code, check_stop=True):
|
191
194
|
'''subroutine get_number_of_elements(nbdy, nelem, error_code) &
|
192
195
|
integer(kind=8), intent(in) :: nbdy
|
193
196
|
integer(kind=8), dimension(nbdy), intent(out) :: nelem
|
194
197
|
integer(kind=8), intent(out) :: error_code
|
195
198
|
end subroutine'''
|
196
|
-
return self.get_lib_function('get_number_of_elements')(nbdy, nelem, error_code)
|
199
|
+
return self.get_lib_function('get_number_of_elements')(nbdy, nelem, error_code, check_stop=check_stop)
|
197
200
|
|
198
|
-
def get_rotor_avg_wsp(self, coo, rotor, wsp):
|
201
|
+
def get_rotor_avg_wsp(self, coo, rotor, wsp, check_stop=True):
|
199
202
|
'''subroutine get_rotor_avg_wsp(coo, rotor, wsp) bind(C, name="get_rotor_avg_wsp")
|
200
203
|
integer*8, intent(in) :: rotor
|
201
204
|
integer*8, intent(in) :: coo ! 1: global, 2: rotor
|
202
205
|
real(c_double), dimension(3):: wsp
|
203
206
|
end subroutine'''
|
204
|
-
return self.get_lib_function('get_rotor_avg_wsp')(coo, rotor, wsp)
|
207
|
+
return self.get_lib_function('get_rotor_avg_wsp')(coo, rotor, wsp, check_stop=check_stop)
|
205
208
|
|
206
|
-
def get_rotor_orientation(self, rotor, yaw, tilt, azi):
|
209
|
+
def get_rotor_orientation(self, rotor, yaw, tilt, azi, check_stop=True):
|
207
210
|
'''subroutine get_rotor_orientation(rotor, yaw, tilt, azi) bind(C, name="get_rotor_orientation")
|
208
211
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_rotor_orientation
|
209
212
|
integer*8, intent(in) :: rotor
|
210
213
|
real(c_double), intent(out) :: yaw, tilt, azi
|
211
214
|
end subroutine'''
|
212
|
-
return self.get_lib_function('get_rotor_orientation')(rotor, yaw, tilt, azi)
|
215
|
+
return self.get_lib_function('get_rotor_orientation')(rotor, yaw, tilt, azi, check_stop=check_stop)
|
213
216
|
|
214
|
-
def get_rotor_position(self, rotor, position):
|
217
|
+
def get_rotor_position(self, rotor, position, check_stop=True):
|
215
218
|
'''subroutine get_rotor_position(rotor, position) bind(C, name="get_rotor_position")
|
216
219
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_rotor_position
|
217
220
|
integer*8, intent(in) :: rotor
|
@@ -220,24 +223,38 @@ end subroutine'''
|
|
220
223
|
integer*8, intent(in) :: rotor
|
221
224
|
integer*8, intent(in) :: coo ! 1: global, 2: rotor
|
222
225
|
end subroutine'''
|
223
|
-
return self.get_lib_function('get_rotor_position')(rotor, position)
|
226
|
+
return self.get_lib_function('get_rotor_position')(rotor, position, check_stop=check_stop)
|
224
227
|
|
225
|
-
def get_sensor_info(self, id, name, unit, desc):
|
228
|
+
def get_sensor_info(self, id, name, unit, desc, check_stop=True):
|
226
229
|
'''subroutine get_sensor_info(id, name, unit, desc) bind(C, name="get_sensor_info")
|
227
230
|
integer*8, intent(in) :: id
|
228
231
|
character(kind=c_char, len=1), intent(out) :: name(30), unit(10), desc(512)
|
229
232
|
end subroutine'''
|
230
|
-
return self.get_lib_function('get_sensor_info')(id, name, unit, desc)
|
233
|
+
return self.get_lib_function('get_sensor_info')(id, name, unit, desc, check_stop=check_stop)
|
231
234
|
|
232
|
-
def get_sensor_values(self, ids, values, n):
|
235
|
+
def get_sensor_values(self, ids, values, n, check_stop=True):
|
233
236
|
'''subroutine get_sensor_values(ids, values, n) bind(C, name="get_sensor_values")
|
234
237
|
integer*8, intent(in) :: n
|
235
238
|
integer*8, intent(in) :: ids(n)
|
236
239
|
real(c_double), intent(out) :: values(n)
|
237
240
|
end subroutine'''
|
238
|
-
return self.get_lib_function('get_sensor_values')(ids, values, n)
|
241
|
+
return self.get_lib_function('get_sensor_values')(ids, values, n, check_stop=check_stop)
|
239
242
|
|
240
|
-
def
|
243
|
+
def get_stop_code(self, stop_code_, check_stop=True):
|
244
|
+
'''subroutine get_stop_code(stop_code_) bind(C, name="get_stop_code")
|
245
|
+
integer*8, intent(out) :: stop_code_
|
246
|
+
end subroutine'''
|
247
|
+
return self.get_lib_function('get_stop_code')(stop_code_, check_stop=check_stop)
|
248
|
+
|
249
|
+
def get_stop_message(self, stop_message, check_stop=True):
|
250
|
+
'''subroutine get_stop_message(stop_message) bind(C, name="get_stop_message")
|
251
|
+
!DEC$ ATTRIBUTES DLLEXPORT :: get_stop_message
|
252
|
+
character(kind=c_char, len=1), intent(inout) :: stop_message(1024)
|
253
|
+
end subroutine'''
|
254
|
+
return self.get_lib_function('get_stop_message')(stop_message, check_stop=check_stop)
|
255
|
+
|
256
|
+
def get_system_eigval_eigvec_with_damping(self, n_modes, ny, eigenvalues,
|
257
|
+
eigenvectors, error_code, check_stop=True):
|
241
258
|
'''subroutine get_system_eigval_eigvec_with_damping(n_modes, ny, eigenvalues, eigenvectors, error_code) &
|
242
259
|
integer(kind=4), intent(in) :: n_modes
|
243
260
|
integer(kind=4), intent(in) :: ny
|
@@ -245,9 +262,11 @@ complex(kind=c_double_complex), dimension(n_modes), intent(out) :: eigenvalues
|
|
245
262
|
complex(kind=c_double_complex), dimension(ny, n_modes), intent(out) :: eigenvectors
|
246
263
|
integer(kind=8), intent(out) :: error_code
|
247
264
|
end subroutine'''
|
248
|
-
return self.get_lib_function('get_system_eigval_eigvec_with_damping')(
|
265
|
+
return self.get_lib_function('get_system_eigval_eigvec_with_damping')(
|
266
|
+
n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
249
267
|
|
250
|
-
def get_system_eigval_eigvec_without_damping(
|
268
|
+
def get_system_eigval_eigvec_without_damping(
|
269
|
+
self, n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=True):
|
251
270
|
'''subroutine get_system_eigval_eigvec_without_damping(n_modes, ny, eigenvalues, eigenvectors, error_code) &
|
252
271
|
integer(kind=4), intent(in) :: n_modes
|
253
272
|
integer(kind=4), intent(in) :: ny
|
@@ -255,9 +274,10 @@ real(kind=c_double), dimension(n_modes), intent(out) :: eigenvalues
|
|
255
274
|
real(kind=c_double), dimension(ny, n_modes), intent(out) :: eigenvectors
|
256
275
|
integer(kind=8), intent(out) :: error_code
|
257
276
|
end subroutine'''
|
258
|
-
return self.get_lib_function('get_system_eigval_eigvec_without_damping')(
|
277
|
+
return self.get_lib_function('get_system_eigval_eigvec_without_damping')(
|
278
|
+
n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
259
279
|
|
260
|
-
def get_system_matrices(self, n_tdofs, n_rdofs, M, C, K, R, error_code):
|
280
|
+
def get_system_matrices(self, n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=True):
|
261
281
|
'''subroutine get_system_matrices(n_tdofs, n_rdofs, M, C, K, R, error_code) &
|
262
282
|
integer(kind=4), intent(in) :: n_tdofs
|
263
283
|
integer(kind=4), intent(in) :: n_rdofs
|
@@ -267,14 +287,15 @@ real(kind=c_double), dimension(n_rdofs, n_rdofs), intent(out) :: K
|
|
267
287
|
real(kind=c_double), dimension(n_tdofs, n_rdofs), intent(out) :: R
|
268
288
|
integer(kind=8), intent(out) :: error_code
|
269
289
|
end subroutine'''
|
270
|
-
return self.get_lib_function('get_system_matrices')(
|
290
|
+
return self.get_lib_function('get_system_matrices')(
|
291
|
+
n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=check_stop)
|
271
292
|
|
272
|
-
def get_time(self, time):
|
293
|
+
def get_time(self, time, check_stop=True):
|
273
294
|
'''subroutine
|
274
295
|
subroutine'''
|
275
|
-
return self.get_lib_function('get_time')(time)
|
296
|
+
return self.get_lib_function('get_time')(time, check_stop=check_stop)
|
276
297
|
|
277
|
-
def get_timoshenko_location(self, ibdy, ielem, l, r1, r12, tes, error_code):
|
298
|
+
def get_timoshenko_location(self, ibdy, ielem, l, r1, r12, tes, error_code, check_stop=True):
|
278
299
|
'''subroutine get_timoshenko_location(ibdy, ielem, l, r1, r12, tes, error_code) &
|
279
300
|
integer(kind=8), intent(in) :: ibdy
|
280
301
|
integer(kind=8), intent(in) :: ielem
|
@@ -284,89 +305,112 @@ subroutine'''
|
|
284
305
|
real(kind=c_double), dimension(3,3), intent(out) :: tes
|
285
306
|
integer(kind=8), intent(out) :: error_code
|
286
307
|
end subroutine'''
|
287
|
-
return self.get_lib_function('get_timoshenko_location')(
|
308
|
+
return self.get_lib_function('get_timoshenko_location')(
|
309
|
+
ibdy, ielem, l, r1, r12, tes, error_code, check_stop=check_stop)
|
288
310
|
|
289
|
-
def get_version(self, s):
|
311
|
+
def get_version(self, s, check_stop=True):
|
290
312
|
'''subroutine get_version(s) BIND(C, NAME='get_version')
|
291
313
|
character(kind=c_char, len=1), intent(inout) :: s(255)
|
292
314
|
end subroutine'''
|
293
|
-
return self.get_lib_function('get_version')(s)
|
315
|
+
return self.get_lib_function('get_version')(s, check_stop=check_stop)
|
294
316
|
|
295
|
-
def init(self, ):
|
317
|
+
def init(self, check_stop=True):
|
296
318
|
'''subroutine init() bind(C, name="init")
|
297
319
|
!DEC$ ATTRIBUTES DLLEXPORT :: init
|
298
320
|
end subroutine'''
|
299
|
-
return self.get_lib_function('init')()
|
321
|
+
return self.get_lib_function('init')(check_stop=check_stop)
|
322
|
+
|
323
|
+
def init_AD(self, rotor, tiploss_method, tiploss_shen_c2):
|
324
|
+
'''subroutine init_AD(rotor, tiploss_method, tiploss_shen_c2) bind(C, name="init_AD")
|
325
|
+
integer*8, intent(in) :: rotor
|
326
|
+
integer*8, intent(in) :: tiploss_method
|
327
|
+
REAL(c_double), intent(in) :: tiploss_shen_c2
|
328
|
+
end subroutine'''
|
329
|
+
return self.get_lib_function('init_AD')(rotor, tiploss_method, tiploss_shen_c2)
|
330
|
+
|
331
|
+
def init_AL(self, rotor, epsilon_smearing):
|
332
|
+
'''subroutine init_AL(rotor, epsilon_smearing) bind(C, name="init_AL")
|
333
|
+
real(c_double), intent(in) :: epsilon_smearing
|
334
|
+
integer*8, intent(in) :: rotor
|
335
|
+
end subroutine'''
|
336
|
+
return self.get_lib_function('init_AL')(rotor, epsilon_smearing)
|
300
337
|
|
301
338
|
def init_windfield(self, Nxyz, dxyz, box_offset_yz, transport_speed):
|
302
339
|
'''subroutine init_windfield(Nxyz, dxyz, box_offset_yz, transport_speed) bind(C, name="init_windfield")
|
303
340
|
integer*8, dimension(3), intent(in) :: Nxyz
|
304
341
|
real*8 :: transport_speed
|
305
342
|
end subroutine'''
|
306
|
-
return self.get_lib_function('init_windfield')(
|
343
|
+
return self.get_lib_function('init_windfield')(
|
344
|
+
Nxyz, dxyz, box_offset_yz, transport_speed)
|
307
345
|
|
308
|
-
def linearize(self, n_tdofs, n_rdofs):
|
346
|
+
def linearize(self, n_tdofs, n_rdofs, check_stop=True):
|
309
347
|
'''subroutine linearize(n_tdofs, n_rdofs) bind(C, name="linearize")
|
310
348
|
integer(kind=8), intent(out) :: n_tdofs
|
311
349
|
integer(kind=8), intent(out) :: n_rdofs
|
312
350
|
end subroutine'''
|
313
|
-
return self.get_lib_function('linearize')(n_tdofs, n_rdofs)
|
351
|
+
return self.get_lib_function('linearize')(n_tdofs, n_rdofs, check_stop=check_stop)
|
314
352
|
|
315
|
-
def loop(self, N, restype):
|
353
|
+
def loop(self, N, restype, check_stop=True):
|
316
354
|
'''function loop(N) bind(C, Name='loop')
|
317
355
|
!DEC$ ATTRIBUTES DLLEXPORT :: loop
|
318
356
|
integer*8, intent(in) :: N
|
319
357
|
real(c_double) :: loop,a
|
320
358
|
integer*8 :: i, j
|
321
359
|
end function'''
|
322
|
-
return self.get_lib_function('loop')(N, restype=restype)
|
360
|
+
return self.get_lib_function('loop')(N, restype=restype, check_stop=check_stop)
|
323
361
|
|
324
|
-
def myfunction(self, int, dbl, restype):
|
362
|
+
def myfunction(self, int, dbl, restype, check_stop=True):
|
325
363
|
'''function myfunction(int, dbl) bind(C, name='myfunction')
|
326
364
|
!DEC$ ATTRIBUTES DLLEXPORT :: myfunction
|
327
365
|
integer*8, intent(in) :: int
|
328
366
|
real(c_double), intent(in) :: dbl
|
329
367
|
real(c_double) :: myfunction
|
330
368
|
end function'''
|
331
|
-
return self.get_lib_function('myfunction')(int, dbl, restype=restype)
|
369
|
+
return self.get_lib_function('myfunction')(int, dbl, restype=restype, check_stop=check_stop)
|
332
370
|
|
333
|
-
def mysubroutine(self, str_arr, dbl_arr):
|
371
|
+
def mysubroutine(self, str_arr, dbl_arr, check_stop=True):
|
334
372
|
'''subroutine mysubroutine(str_arr, dbl_arr) bind(C, name='mysubroutine')
|
335
373
|
character(kind=c_char, len=1), intent(inout) :: str_arr(20)
|
336
374
|
real(c_double), intent(inout), dimension(2) :: dbl_arr
|
337
375
|
end subroutine'''
|
338
|
-
return self.get_lib_function('mysubroutine')(str_arr, dbl_arr)
|
376
|
+
return self.get_lib_function('mysubroutine')(str_arr, dbl_arr, check_stop=check_stop)
|
339
377
|
|
340
|
-
def read_input(self, htc_path):
|
378
|
+
def read_input(self, htc_path, check_stop=True):
|
341
379
|
'''subroutine read_input(htc_path) bind(C, name="read_input")
|
342
380
|
character(kind=c_char, len=1), intent(in) :: htc_path(1024)
|
343
381
|
end subroutine'''
|
344
|
-
return self.get_lib_function('read_input')(htc_path)
|
382
|
+
return self.get_lib_function('read_input')(htc_path, check_stop=check_stop)
|
345
383
|
|
346
|
-
def run(self, time, restype):
|
384
|
+
def run(self, time, restype, check_stop=True):
|
347
385
|
'''function run(time) bind(C, name='run')
|
348
386
|
!DEC$ ATTRIBUTES DLLEXPORT :: run
|
349
387
|
real(c_double), intent(in) :: time
|
350
388
|
real(c_double) :: run, eps
|
351
389
|
end function'''
|
352
|
-
return self.get_lib_function('run')(time, restype=restype)
|
390
|
+
return self.get_lib_function('run')(time, restype=restype, check_stop=check_stop)
|
353
391
|
|
354
|
-
def
|
392
|
+
def reset_stop_code_and_message(self, check_stop=True):
|
393
|
+
'''subroutine reset_stop_code_and_message() bind(C, name="reset_stop_code_and_message")
|
394
|
+
!DEC$ ATTRIBUTES DLLEXPORT :: reset_stop_code_and_message
|
395
|
+
end subroutine'''
|
396
|
+
return self.get_lib_function('reset_stop_code_and_message')(check_stop=check_stop)
|
397
|
+
|
398
|
+
def setState(self, val, check_stop=True):
|
355
399
|
'''subroutine setState(val) BIND(C, NAME='setState')
|
356
400
|
integer, intent(in) :: val
|
357
401
|
end subroutine'''
|
358
|
-
return self.get_lib_function('setState')(val)
|
402
|
+
return self.get_lib_function('setState')(val, check_stop=check_stop)
|
359
403
|
|
360
|
-
def set_aerosections_windspeed(self, rotor, uvw):
|
404
|
+
def set_aerosections_windspeed(self, rotor, uvw, check_stop=True):
|
361
405
|
'''subroutine set_aerosections_windspeed(rotor, uvw) bind(C, name="set_aerosections_windspeed")
|
362
406
|
integer*8, intent(in) :: rotor
|
363
407
|
real(c_double),intent(in) :: uvw(rotors_gl%rotor(rotor)%nbld, rotors_gl%rotor(rotor)%blade(1)%nsec, 3)
|
364
408
|
end subroutine'''
|
365
|
-
return self.get_lib_function('set_aerosections_windspeed')(rotor, uvw)
|
409
|
+
return self.get_lib_function('set_aerosections_windspeed')(rotor, uvw, check_stop=check_stop)
|
366
410
|
|
367
411
|
def set_orientation_base(self, main_body_name,
|
368
412
|
n_rows, mbdy_eulerang_table, angles_in_deg, reset_orientation, mbdy_ini_rotvec_d1,
|
369
|
-
error_code):
|
413
|
+
error_code, check_stop=True):
|
370
414
|
'''subroutine set_orientation_base(main_body_name, &
|
371
415
|
character(kind=c_char, len=1), dimension(256), intent(in) :: main_body_name
|
372
416
|
real(kind=c_double), dimension(n_rows, 3), intent(in) :: mbdy_eulerang_table
|
@@ -376,13 +420,13 @@ real(kind=c_double), dimension(4), intent(in) :: mbdy_ini_rotvec_d1
|
|
376
420
|
end subroutine'''
|
377
421
|
return self.get_lib_function('set_orientation_base')(main_body_name,
|
378
422
|
n_rows, mbdy_eulerang_table, angles_in_deg, reset_orientation, mbdy_ini_rotvec_d1,
|
379
|
-
error_code)
|
423
|
+
error_code, check_stop=check_stop)
|
380
424
|
|
381
425
|
def set_orientation_relative(self, main_body_1_name, node_1, main_body_2_name, node_2,
|
382
426
|
n_rows, mbdy2_eulerang_table, angles_in_deg,
|
383
427
|
reset_orientation,
|
384
428
|
mbdy2_ini_rotvec_d1,
|
385
|
-
error_code):
|
429
|
+
error_code, check_stop=True):
|
386
430
|
'''subroutine set_orientation_relative(main_body_1_name, node_1, main_body_2_name, node_2, &
|
387
431
|
character(kind=c_char, len=1), dimension(256), intent(in ) :: main_body_1_name ! Defined as an array of length 1 characters because of bind.
|
388
432
|
character(kind=c_char, len=1), dimension(256), intent(in ) :: main_body_2_name ! Defined as an array of length 1 characters because of bind.
|
@@ -401,80 +445,80 @@ end subroutine'''
|
|
401
445
|
n_rows, mbdy2_eulerang_table, angles_in_deg,
|
402
446
|
reset_orientation,
|
403
447
|
mbdy2_ini_rotvec_d1,
|
404
|
-
error_code)
|
448
|
+
error_code, check_stop=check_stop)
|
405
449
|
|
406
|
-
def set_variable_sensor_value(self, id, value):
|
450
|
+
def set_variable_sensor_value(self, id, value, check_stop=True):
|
407
451
|
'''subroutine set_variable_sensor_value(id, value) bind(C, name="set_variable_sensor_value")
|
408
452
|
integer*8, intent(in) :: id
|
409
453
|
real(c_double) :: value
|
410
454
|
end subroutine'''
|
411
|
-
return self.get_lib_function('set_variable_sensor_value')(id, value)
|
455
|
+
return self.get_lib_function('set_variable_sensor_value')(id, value, check_stop=check_stop)
|
412
456
|
|
413
|
-
def set_windfield(self, uvw, box_offset_x, time):
|
457
|
+
def set_windfield(self, uvw, box_offset_x, time, check_stop=True):
|
414
458
|
'''subroutine set_windfield(uvw, box_offset_x, time) bind(C, name="set_windfield")
|
415
459
|
real*4, intent(in) :: uvw(3, gwsd%TMOD%buffer_points_x,gwsd%TMOD%buffer_points_y,gwsd%TMOD%buffer_points_z)
|
416
460
|
real*8, intent(in):: box_offset_x, time
|
417
461
|
end subroutine'''
|
418
|
-
return self.get_lib_function('set_windfield')(uvw, box_offset_x, time)
|
462
|
+
return self.get_lib_function('set_windfield')(uvw, box_offset_x, time, check_stop=check_stop)
|
419
463
|
|
420
|
-
def solver_static_delete(self, ):
|
464
|
+
def solver_static_delete(self, check_stop=True):
|
421
465
|
'''subroutine solver_static_delete() &
|
422
466
|
!DEC$ ATTRIBUTES DLLEXPORT :: solver_static_delete
|
423
467
|
end subroutine'''
|
424
|
-
return self.get_lib_function('solver_static_delete')()
|
468
|
+
return self.get_lib_function('solver_static_delete')(check_stop=check_stop)
|
425
469
|
|
426
|
-
def solver_static_init(self, ):
|
470
|
+
def solver_static_init(self, check_stop=True):
|
427
471
|
'''subroutine solver_static_init() &
|
428
472
|
!DEC$ ATTRIBUTES DLLEXPORT :: solver_static_init
|
429
473
|
end subroutine'''
|
430
|
-
return self.get_lib_function('solver_static_init')()
|
474
|
+
return self.get_lib_function('solver_static_init')(check_stop=check_stop)
|
431
475
|
|
432
|
-
def solver_static_run(self, reset_structure, error_code):
|
476
|
+
def solver_static_run(self, reset_structure, error_code, check_stop=True):
|
433
477
|
'''subroutine solver_static_run(reset_structure, error_code) bind(C, name="solver_static_run")
|
434
478
|
logical(c_bool), intent(in) :: reset_structure
|
435
479
|
integer(8), intent(out) :: error_code
|
436
480
|
end subroutine'''
|
437
|
-
return self.get_lib_function('solver_static_run')(reset_structure, error_code)
|
481
|
+
return self.get_lib_function('solver_static_run')(reset_structure, error_code, check_stop=check_stop)
|
438
482
|
|
439
|
-
def solver_static_solve(self, error_code):
|
483
|
+
def solver_static_solve(self, error_code, check_stop=True):
|
440
484
|
'''subroutine solver_static_solve(error_code) &
|
441
485
|
integer*8, intent(out) :: error_code
|
442
486
|
end subroutine'''
|
443
|
-
return self.get_lib_function('solver_static_solve')(error_code)
|
487
|
+
return self.get_lib_function('solver_static_solve')(error_code, check_stop=check_stop)
|
444
488
|
|
445
|
-
def solver_static_update(self, error_code):
|
489
|
+
def solver_static_update(self, error_code, check_stop=True):
|
446
490
|
'''subroutine solver_static_update(error_code) &
|
447
491
|
integer*8, intent(out) :: error_code
|
448
492
|
end subroutine'''
|
449
|
-
return self.get_lib_function('solver_static_update')(error_code)
|
493
|
+
return self.get_lib_function('solver_static_update')(error_code, check_stop=check_stop)
|
450
494
|
|
451
|
-
def sqr2(self, val):
|
495
|
+
def sqr2(self, val, check_stop=True):
|
452
496
|
'''subroutine sqr2(val) BIND(C, NAME='sqr2')
|
453
497
|
integer, intent(inout) :: val
|
454
498
|
end subroutine'''
|
455
|
-
return self.get_lib_function('sqr2')(val)
|
499
|
+
return self.get_lib_function('sqr2')(val, check_stop=check_stop)
|
456
500
|
|
457
|
-
def step(self, restype):
|
501
|
+
def step(self, restype, check_stop=True):
|
458
502
|
'''function step() bind(C, name='step')
|
459
503
|
!DEC$ ATTRIBUTES DLLEXPORT :: step
|
460
504
|
real(c_double) :: step
|
461
505
|
end function'''
|
462
|
-
return self.get_lib_function('step')(restype=restype)
|
506
|
+
return self.get_lib_function('step')(restype=restype, check_stop=check_stop)
|
463
507
|
|
464
|
-
def stop_on_error(self, flag):
|
508
|
+
def stop_on_error(self, flag, check_stop=True):
|
465
509
|
'''subroutine stop_on_error(flag) bind(C, name="stop_on_error")
|
466
|
-
|
467
|
-
|
468
|
-
return self.get_lib_function('stop_on_error')(flag)
|
510
|
+
logical(c_bool), intent(in) :: flag
|
511
|
+
end subroutine'''
|
512
|
+
return self.get_lib_function('stop_on_error')(flag, check_stop=check_stop)
|
469
513
|
|
470
|
-
def structure_reset(self, ):
|
514
|
+
def structure_reset(self, check_stop=True):
|
471
515
|
'''subroutine structure_reset() bind(C, name="structure_reset")
|
472
516
|
!DEC$ ATTRIBUTES DLLEXPORT :: structure_reset
|
473
517
|
integer*4 :: i, j
|
474
518
|
end subroutine'''
|
475
|
-
return self.get_lib_function('structure_reset')()
|
519
|
+
return self.get_lib_function('structure_reset')(check_stop=check_stop)
|
476
520
|
|
477
|
-
def test_hdf5(self, ):
|
521
|
+
def test_hdf5(self, check_stop=True):
|
478
522
|
'''subroutine test_hdf5() BIND(C, NAME='test_hdf5')
|
479
523
|
!DEC$ ATTRIBUTES DLLEXPORT :: test_hdf5
|
480
524
|
INTEGER :: hdferr ! Error flag
|
@@ -483,22 +527,22 @@ end subroutine'''
|
|
483
527
|
INTEGER(HID_T) :: H5_Create_file,H5_Open_file ! File identifier
|
484
528
|
type(c_ptr) :: x
|
485
529
|
end subroutine'''
|
486
|
-
return self.get_lib_function('test_hdf5')()
|
530
|
+
return self.get_lib_function('test_hdf5')(check_stop=check_stop)
|
487
531
|
|
488
|
-
def work(self, time, restype):
|
532
|
+
def work(self, time, restype, check_stop=True):
|
489
533
|
'''function work(time) bind(C, Name='work')
|
490
534
|
!DEC$ ATTRIBUTES DLLEXPORT :: work
|
491
535
|
real(c_double), intent(in) :: time
|
492
536
|
real*4 :: start_time, t
|
493
537
|
integer*8 :: N, work
|
494
538
|
end function'''
|
495
|
-
return self.get_lib_function('work')(time, restype=restype)
|
539
|
+
return self.get_lib_function('work')(time, restype=restype, check_stop=check_stop)
|
496
540
|
|
497
|
-
def write_output(self, ):
|
541
|
+
def write_output(self, check_stop=True):
|
498
542
|
'''subroutine write_output() bind(C, name="write_output")
|
499
543
|
!DEC$ ATTRIBUTES DLLEXPORT :: write_output
|
500
544
|
integer :: nr, dummy=1
|
501
545
|
character*10 :: status = 'close'
|
502
546
|
Type (Toutvar) :: ov_dummy
|
503
547
|
end subroutine'''
|
504
|
-
return self.get_lib_function('write_output')()
|
548
|
+
return self.get_lib_function('write_output')(check_stop=check_stop)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: h2lib
|
3
|
-
Version: 13.1.
|
4
|
-
Summary: Python interface to HAWC2 (13.1.31+
|
3
|
+
Version: 13.1.3103
|
4
|
+
Summary: Python interface to HAWC2 (13.1.31+5-g08eea40)
|
5
5
|
Download-URL:
|
6
6
|
Author: Mads M. Pedersen, S.G.Horcas and N.G.Ramos
|
7
7
|
Author-email: mmpe@dtu.dk
|
@@ -0,0 +1,10 @@
|
|
1
|
+
h2lib/HAWC2Lib.dll,sha256=HMQo1hg0o6ppTuQP7IEkXJdzpf6QAr0TTIH_u5s0RWg,30970368
|
2
|
+
h2lib/__init__.py,sha256=f3fO4I6IEFRM9LaV2O3w9Pioj3GPI8qRl7P5Tg5ONtE,528
|
3
|
+
h2lib/_h2lib.py,sha256=EOxtjXytUpbQrDxTNORgZlVcZe2msKWwUXtDUGTHycs,39486
|
4
|
+
h2lib/_version.py,sha256=R7-1SL_5w4I6GwKVjYprFWCg2X7FF6zxjqQnGTFxIXc,160
|
5
|
+
h2lib/dll_wrapper.py,sha256=NtH3wVJ4okYLBXjdRxpllnImRDE7p692OgHuwHkt-WQ,13552
|
6
|
+
h2lib/h2lib_signatures.py,sha256=sPCh92WdCc6brPgARZ_QBgSz49Yjq0M5SpWb0or5KvM,29396
|
7
|
+
h2lib-13.1.3103.dist-info/METADATA,sha256=ip-gMxWOmrw2KfZAJ5oW4tnb45TxoEsbVWQRF59WCzQ,862
|
8
|
+
h2lib-13.1.3103.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
|
9
|
+
h2lib-13.1.3103.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
|
10
|
+
h2lib-13.1.3103.dist-info/RECORD,,
|
h2lib-13.1.3101.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
h2lib/HAWC2Lib.dll,sha256=qiYnZFkH4KmFpojGak9B8Kd9rGGpJWQPb3EWldp2aYo,30946304
|
2
|
-
h2lib/__init__.py,sha256=f3fO4I6IEFRM9LaV2O3w9Pioj3GPI8qRl7P5Tg5ONtE,528
|
3
|
-
h2lib/_h2lib.py,sha256=Neau9z21Cv6UTSUVOxXOCAy_EEw3Ricl7MLMn9ttgn0,36903
|
4
|
-
h2lib/_version.py,sha256=PE2MdeTTxKGGEB-pQZrXsw_o_fG0PG6oHUGIzj2T5Oc,160
|
5
|
-
h2lib/dll_wrapper.py,sha256=ZkcHog6jdVvzRNbVFza0atmMDTlbErf-42IqYITdVRE,12897
|
6
|
-
h2lib/h2lib_signatures.py,sha256=hDefbIIUVPdyc-PqV6_tdzmoJVKUrsTJ8rm1JV24yH0,25073
|
7
|
-
h2lib-13.1.3101.dist-info/METADATA,sha256=oQvnzep9gesJ_S4bHgrt1fxJ9AksPpIIqd-gs4Q_YKc,862
|
8
|
-
h2lib-13.1.3101.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
|
9
|
-
h2lib-13.1.3101.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
|
10
|
-
h2lib-13.1.3101.dist-info/RECORD,,
|
File without changes
|
File without changes
|