h2lib 13.1.3110__py3-none-win_amd64.whl → 13.2.701__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 +181 -11
- h2lib/_version.py +3 -3
- h2lib/distributed_sections.py +131 -0
- h2lib/h2lib_signatures.py +138 -52
- {h2lib-13.1.3110.dist-info → h2lib-13.2.701.dist-info}/METADATA +2 -2
- h2lib-13.2.701.dist-info/RECORD +11 -0
- h2lib-13.1.3110.dist-info/RECORD +0 -10
- {h2lib-13.1.3110.dist-info → h2lib-13.2.701.dist-info}/WHEEL +0 -0
- {h2lib-13.1.3110.dist-info → h2lib-13.2.701.dist-info}/top_level.txt +0 -0
h2lib/HAWC2Lib.dll
CHANGED
Binary file
|
h2lib/_h2lib.py
CHANGED
@@ -7,11 +7,12 @@ import sys
|
|
7
7
|
from multiclass_interface.multiprocess_interface import MultiProcessClassInterface, ProcessClass
|
8
8
|
import numpy as np
|
9
9
|
from pathlib import Path
|
10
|
+
from h2lib.distributed_sections import H2Lib_DistributedSections
|
10
11
|
|
11
12
|
_ERROR_CODES = {
|
12
13
|
1: ValueError("WRONG_NUMBER_OF_COLUMNS"),
|
13
14
|
2: ValueError("MAIN_BODY_NOT_FOUND"),
|
14
|
-
3:
|
15
|
+
3: NotImplementedError(),
|
15
16
|
4: RuntimeError("STRUCTURE_IS_CONFIDENTIAL"),
|
16
17
|
5: IndexError("BODY_DOES_NOT_EXIST"),
|
17
18
|
6: IndexError("ELEMENT_DOES_NOT_EXIST"),
|
@@ -30,12 +31,7 @@ _ERROR_CODES = {
|
|
30
31
|
}
|
31
32
|
|
32
33
|
|
33
|
-
|
34
|
-
H2 = [H2LibThread, H2LibProcess][subprocess]
|
35
|
-
return H2(suppress_output=suppress_output, cwd=cwd)
|
36
|
-
|
37
|
-
|
38
|
-
class H2LibThread(H2LibSignatures, DLLWrapper):
|
34
|
+
class H2LibThread(DLLWrapper, H2Lib_DistributedSections, H2LibSignatures):
|
39
35
|
_model_path = '.'
|
40
36
|
_aero_sections_data_shape = {}
|
41
37
|
|
@@ -130,19 +126,21 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
130
126
|
self._initialized = True
|
131
127
|
return r
|
132
128
|
|
133
|
-
def init_AD(self, htc_path=None, model_path='.', tiploss_method=2,
|
129
|
+
def init_AD(self, htc_path=None, model_path='.', tiploss_method=2, tiploss2_shen_c2=21, tiploss2_shen_h=0, rotor=0):
|
134
130
|
"""Initialize HAWC2 for Actuator Disc workflow, where wind speeds including induction at the aerodynamic sections
|
135
131
|
are passed from e.g. CFD to HAWC2 via set_aerosections_windspeed.
|
136
132
|
This function will:
|
137
133
|
- Disable wind speed update at blade sections (wind speeds must be set via set_aerosections_windspeed)
|
138
134
|
- Disable HAWC2 induction (induction_method=0).
|
139
135
|
- 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,
|
141
|
-
|
136
|
+
- set the tiploss_method. The default method is 2, which works with the AD workflow,
|
137
|
+
but the tiploss2_shen_c2 and tiploss2_shen_h parameters must be tuned to give sensible results,
|
138
|
+
see tiploss_method in the HAWC2 manual
|
142
139
|
"""
|
143
140
|
assert not self._initialized, "h2lib already initialized via init, init_AD or init_AL"
|
144
141
|
self.read_input(htc_path, model_path)
|
145
|
-
r = H2LibSignatures.init_AD(self, rotor + 1, int(tiploss_method),
|
142
|
+
r = H2LibSignatures.init_AD(self, rotor + 1, int(tiploss_method),
|
143
|
+
float(tiploss2_shen_c2), float(tiploss2_shen_h))
|
146
144
|
self._initialized = True
|
147
145
|
return r
|
148
146
|
|
@@ -168,6 +166,14 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
168
166
|
self.time = np.round(H2LibSignatures.step(self, restype=np.float64)[1], 6)
|
169
167
|
return self.time
|
170
168
|
|
169
|
+
def predict(self): # pragma: no cover
|
170
|
+
"""Temporary functions to reproduce results from old cpl coupling"""
|
171
|
+
self.get_lib_function('step_predict_hawc2')()
|
172
|
+
|
173
|
+
def correct(self): # pragma: no cover
|
174
|
+
"""Temporary functions to reproduce results from old cpl coupling"""
|
175
|
+
self.get_lib_function('step_correct_hawc2')()
|
176
|
+
|
171
177
|
def run(self, time):
|
172
178
|
self.time = np.round(H2LibSignatures.run(self, np.float64(time), restype=np.float64)[1], 6)
|
173
179
|
return self.time
|
@@ -695,6 +701,57 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
695
701
|
assert np.all(np.isfinite(uvw)), "uvw passed to h2lib.set_windfield contains nan or inf"
|
696
702
|
return H2LibSignatures.set_windfield(self, uvw, np.float64(box_offset_x), np.float64(time))
|
697
703
|
|
704
|
+
def set_c2_def(
|
705
|
+
self, main_body_name, c2_def, twist_in_deg=True, check_length=True
|
706
|
+
):
|
707
|
+
"""
|
708
|
+
Set c2_def, which defines the centerline of the specified main body.
|
709
|
+
|
710
|
+
Parameters
|
711
|
+
----------
|
712
|
+
main_body_name : str
|
713
|
+
Name of main body that must be updated.
|
714
|
+
c2_def : (:, 4) ndarray
|
715
|
+
New c2_def. It is an array with at least 2 rows and 4 columns for x, y, z and twist.
|
716
|
+
The number of rows, i.e. sections, must match the ones in the original c2_def.
|
717
|
+
twist_in_deg : bool, optional
|
718
|
+
`True` if the twist (last column in c2_def) is given in [deg].
|
719
|
+
`False` if it is given in [rad]. The default is `True`.
|
720
|
+
check_length : bool, optional
|
721
|
+
`True` if the new beam length needs to be checked, `False` otherwise. The default is `False`.
|
722
|
+
|
723
|
+
Raises
|
724
|
+
------
|
725
|
+
ValueError
|
726
|
+
Can be due to:
|
727
|
+
- MAIN_BODY_NOT_FOUND: none of the main bodies is called `main_body_name`.
|
728
|
+
- TOO_FEW_SECTIONS_IN_C2DEF: `c2_def` must have at least 2 sections, i.e. rows.
|
729
|
+
- BEAM_TOO_SHORT: the minimum beam length is 1.0e-7.
|
730
|
+
- DIFFERENT_NSEC: this command does not allow to add or remove sections,
|
731
|
+
therefore `c2_def` must have the same number of sections as in the HAWC2 model.
|
732
|
+
NotImplementedError
|
733
|
+
Only the c2_def node distribution is supported.
|
734
|
+
|
735
|
+
Returns
|
736
|
+
-------
|
737
|
+
None.
|
738
|
+
|
739
|
+
"""
|
740
|
+
error_code = -1
|
741
|
+
error_code = H2LibSignatures.set_c2_def(
|
742
|
+
self,
|
743
|
+
main_body_name,
|
744
|
+
np.asfortranarray(c2_def.astype(np.float64)),
|
745
|
+
c2_def.shape[0],
|
746
|
+
bool(twist_in_deg),
|
747
|
+
bool(check_length),
|
748
|
+
error_code,
|
749
|
+
check_stop=False,
|
750
|
+
)[0][-1]
|
751
|
+
|
752
|
+
if error_code > 0:
|
753
|
+
raise _ERROR_CODES[error_code]
|
754
|
+
|
698
755
|
# ===================================================================================================================
|
699
756
|
# H2rotor
|
700
757
|
# ===================================================================================================================
|
@@ -926,6 +983,100 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
926
983
|
raise _ERROR_CODES[error_code]
|
927
984
|
return amat
|
928
985
|
|
986
|
+
def body_output_mass(self, ibdy):
|
987
|
+
"""
|
988
|
+
Compute body mass properties. Wrapper of HAWC2 command `new_htc_structure / body_output_file_name`.
|
989
|
+
|
990
|
+
Parameters
|
991
|
+
----------
|
992
|
+
ibdy : int
|
993
|
+
Body index, starting from 0.
|
994
|
+
|
995
|
+
Raises
|
996
|
+
------
|
997
|
+
RuntimeError
|
998
|
+
If the structure is confidential.
|
999
|
+
IndexError
|
1000
|
+
If the body does not exist.
|
1001
|
+
|
1002
|
+
Returns
|
1003
|
+
-------
|
1004
|
+
body_mass : float
|
1005
|
+
Body mass [kg].
|
1006
|
+
body_inertia : (6,) ndarray
|
1007
|
+
Body inertia [Ixx, Iyy, Izz, Ixy, Ixz, Iyz] in [kg*m^2].
|
1008
|
+
cog_global_frame : (3,) ndarray
|
1009
|
+
Body center of gravity in the global frame [m].
|
1010
|
+
cog_body_frame : (3,) ndarray
|
1011
|
+
Body center of gravity in the body frame [m].
|
1012
|
+
"""
|
1013
|
+
body_mass = 0.0
|
1014
|
+
body_inertia = np.zeros((6,), order="F")
|
1015
|
+
cog_global_frame = np.zeros((3,), order="F")
|
1016
|
+
cog_body_frame = np.zeros((3,), order="F")
|
1017
|
+
error_code = -1
|
1018
|
+
|
1019
|
+
_, body_mass, body_inertia, cog_global_frame, cog_body_frame, error_code = (
|
1020
|
+
H2LibSignatures.body_output_mass(
|
1021
|
+
self,
|
1022
|
+
ibdy + 1,
|
1023
|
+
body_mass,
|
1024
|
+
body_inertia,
|
1025
|
+
cog_global_frame,
|
1026
|
+
cog_body_frame,
|
1027
|
+
error_code,
|
1028
|
+
check_stop=False,
|
1029
|
+
)[0]
|
1030
|
+
)
|
1031
|
+
if error_code > 0:
|
1032
|
+
raise _ERROR_CODES[error_code]
|
1033
|
+
return body_mass, body_inertia, cog_global_frame, cog_body_frame
|
1034
|
+
|
1035
|
+
def body_output_element(self, ibdy, ielem):
|
1036
|
+
"""
|
1037
|
+
Compute element matrices. Wrapper of HAWC2 command `new_htc_structure / element_matrix_output`.
|
1038
|
+
|
1039
|
+
Parameters
|
1040
|
+
----------
|
1041
|
+
ibdy : int
|
1042
|
+
Body index, starting from 0.
|
1043
|
+
ielem : int
|
1044
|
+
Element index, starting from 0.
|
1045
|
+
|
1046
|
+
Raises
|
1047
|
+
------
|
1048
|
+
RuntimeError
|
1049
|
+
If the structure is confidential.
|
1050
|
+
IndexError
|
1051
|
+
If the body or the element do not exist.
|
1052
|
+
|
1053
|
+
Returns
|
1054
|
+
-------
|
1055
|
+
mass : (12, 12) ndarray of float
|
1056
|
+
Mass matrix.
|
1057
|
+
stiffness : (12, 12) ndarray of float
|
1058
|
+
Mass matrix.
|
1059
|
+
damping : (12, 12) ndarray of float
|
1060
|
+
Mass matrix.
|
1061
|
+
"""
|
1062
|
+
mass = np.zeros((12, 12), dtype=np.float64, order="F")
|
1063
|
+
stiffness = np.zeros_like(mass)
|
1064
|
+
damping = np.zeros_like(mass)
|
1065
|
+
error_code = -1
|
1066
|
+
_, _, mass, stiffness, damping, error_code = H2LibSignatures.body_output_element(
|
1067
|
+
self,
|
1068
|
+
ibdy + 1,
|
1069
|
+
ielem + 1,
|
1070
|
+
mass,
|
1071
|
+
stiffness,
|
1072
|
+
damping,
|
1073
|
+
error_code,
|
1074
|
+
check_stop=False,
|
1075
|
+
)[0]
|
1076
|
+
if error_code > 0:
|
1077
|
+
raise _ERROR_CODES[error_code]
|
1078
|
+
return mass, stiffness, damping
|
1079
|
+
|
929
1080
|
def get_system_matrices(self, n_tdofs, n_rdofs):
|
930
1081
|
"""
|
931
1082
|
Get the system structural matrices computed during the system_eigenanalysis.
|
@@ -971,6 +1122,20 @@ class H2LibThread(H2LibSignatures, DLLWrapper):
|
|
971
1122
|
raise _ERROR_CODES[error_code]
|
972
1123
|
return M, C, K, R
|
973
1124
|
|
1125
|
+
def get_no_mainbodies(self):
|
1126
|
+
return H2LibSignatures.get_number_of_mainbodies(self, restype=np.int64)[1]
|
1127
|
+
|
1128
|
+
def get_mainbody_name_dict(self):
|
1129
|
+
s = " " * 256
|
1130
|
+
return {H2LibSignatures.get_mainbody_name(self, mainbody_nr=int(i), mainbody_name=s)[0][1].strip(): i
|
1131
|
+
for i in np.arange(self.get_no_mainbodies()) + 1}
|
1132
|
+
|
1133
|
+
def get_mainbody_position_orientation(self, mainbody_nr, mainbody_coo_nr=0):
|
1134
|
+
mbdy_pos = np.zeros(3, dtype=np.float64, order="F")
|
1135
|
+
mbdy_tbg = np.zeros((3, 3), dtype=np.float64, order="F")
|
1136
|
+
return H2Lib_DistributedSections.get_mainbody_position_orientation(
|
1137
|
+
self, int(mainbody_nr), mbdy_pos, mbdy_tbg, int(mainbody_coo_nr))[0][1:-1]
|
1138
|
+
|
974
1139
|
|
975
1140
|
@contextmanager
|
976
1141
|
def set_LD_LIBRARY_PATH():
|
@@ -995,6 +1160,11 @@ class H2LibProcess(ProcessClass, H2LibThread):
|
|
995
1160
|
self(suppress_output=suppress_output, filename=filename, cwd=cwd)
|
996
1161
|
|
997
1162
|
|
1163
|
+
def H2Lib(suppress_output=False, subprocess=True, cwd='.', filename=None) -> H2LibThread:
|
1164
|
+
H2 = [H2LibThread, H2LibProcess][subprocess]
|
1165
|
+
return H2(suppress_output=suppress_output, cwd=cwd, filename=filename)
|
1166
|
+
|
1167
|
+
|
998
1168
|
def MultiH2Lib(N, filename=None, cwd='.', suppress_output=False):
|
999
1169
|
|
1000
1170
|
if not hasattr(suppress_output, '__len__'):
|
h2lib/_version.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
# This file is autogenerated and should not be modified manually
|
2
|
-
__version__ = '13.
|
3
|
-
h2lib_version = '13.
|
4
|
-
hawc2_version = '13.
|
2
|
+
__version__ = '13.2.701'
|
3
|
+
h2lib_version = '13.2.701'
|
4
|
+
hawc2_version = '13.2.7+4-gb779ee7'
|
@@ -0,0 +1,131 @@
|
|
1
|
+
from h2lib.h2lib_signatures import H2LibSignatures
|
2
|
+
import numpy as np
|
3
|
+
from enum import Enum
|
4
|
+
|
5
|
+
|
6
|
+
class DistributedSections():
|
7
|
+
def __init__(self, name, link_type, link_id, nsec):
|
8
|
+
self.name = name
|
9
|
+
assert isinstance(link_type, LinkType)
|
10
|
+
self.link_type = link_type
|
11
|
+
self.link_id = link_id
|
12
|
+
self.nsec = nsec
|
13
|
+
|
14
|
+
|
15
|
+
class LinkType(Enum):
|
16
|
+
BODY = 0 # Distributed sections added via add_distributed_sections
|
17
|
+
BLADE = 1 # Aerodyninamic sections of rotor=1.
|
18
|
+
AERODRAG = 2 # Aerodrag sections
|
19
|
+
HYDRO = 3 # Hydroload sections
|
20
|
+
SOIL = 4 # soil sections
|
21
|
+
|
22
|
+
|
23
|
+
class H2Lib_DistributedSections(H2LibSignatures):
|
24
|
+
"""Distributed sections are sections distributed along a mainbody in HAWC2.
|
25
|
+
These sections follows the structure and the position and orientation of the sections can be obtained by
|
26
|
+
get_distributed_section_position_orientation.
|
27
|
+
|
28
|
+
Furthermore, forces and moments can be set on the sections via set_distributed_section_force_and_moment
|
29
|
+
|
30
|
+
Distributed sections are used inside HAWC2 for aerodynamic loads, aerodrag, hydro, and soil.
|
31
|
+
A reference/link object to these sections can be obtained by get_distributed_sections
|
32
|
+
|
33
|
+
Moreover, custom distributed sections can be added by add_distributed_sections. Remember to call
|
34
|
+
initialize_distributed_sections between the last add_distributed_sections and the first usage.
|
35
|
+
"""
|
36
|
+
|
37
|
+
def add_distributed_sections(self, mainbody_name, section_relative_position):
|
38
|
+
"""Add custom distributed sections along a mainbody.
|
39
|
+
|
40
|
+
Note, that initialize_distributed_sections (see below) must be called after the last call to
|
41
|
+
add_distributed_sections and before first call to get_distributed_sections,
|
42
|
+
get_distributed_section_position_orientation and set_distributed_section_force_and_moment
|
43
|
+
"""
|
44
|
+
mbdy_name_dict = self.get_mainbody_name_dict()
|
45
|
+
assert mainbody_name in mbdy_name_dict, f"'{mainbody_name}' does not exist. Valid names are {list(mbdy_name_dict.keys())}."
|
46
|
+
mbdy_nr = mbdy_name_dict[mainbody_name]
|
47
|
+
nsec = len(section_relative_position)
|
48
|
+
link_id = H2LibSignatures.add_distributed_sections(
|
49
|
+
self,
|
50
|
+
mainbody_nr=int(mbdy_nr),
|
51
|
+
nsec=nsec,
|
52
|
+
sec_rel_pos=np.asfortranarray(section_relative_position, dtype=float),
|
53
|
+
link_id=0)[0][-1]
|
54
|
+
return DistributedSections(mainbody_name, LinkType.BODY, link_id, nsec)
|
55
|
+
|
56
|
+
def initialize_distributed_sections(self):
|
57
|
+
"""Initialize distributed sections added by add_distributed_sections.
|
58
|
+
|
59
|
+
Note, that this method must be called after the last call to
|
60
|
+
add_distributed_sections and before first call to get_distributed_sections,
|
61
|
+
get_distributed_section_position_orientation and set_distributed_section_force_and_moment
|
62
|
+
"""
|
63
|
+
return H2LibSignatures.initialize_distributed_sections(self)
|
64
|
+
|
65
|
+
def get_distributed_sections(self, link_type: LinkType, link_id):
|
66
|
+
"""Return a DistributedSections link object (needed for get_distributed_section_position_orientation
|
67
|
+
and set_distributed_section_force_and_moment).
|
68
|
+
|
69
|
+
To obtain the aerodynamic load sections at blade 3 (only rotor=1 can be accessed):
|
70
|
+
h2.get_distributed_sections(LinkType.BLADE, 3)
|
71
|
+
|
72
|
+
Parameters
|
73
|
+
----------
|
74
|
+
link_type : LinkType
|
75
|
+
Specifies the link type. See enum LinkType
|
76
|
+
link_id : integer
|
77
|
+
index of link. link_id=1 will reference the first added sections, e.g. blade1
|
78
|
+
Returns
|
79
|
+
-------
|
80
|
+
DistributedSections object
|
81
|
+
"""
|
82
|
+
mbdy_nr, nsec = H2LibSignatures.get_distributed_sections(
|
83
|
+
self, link_type.value, link_id, mainbody_nr=0, nsec=0)[0][2:]
|
84
|
+
mbdy_name_dict = self.get_mainbody_name_dict()
|
85
|
+
mbdy_name = {nr: name for name, nr in mbdy_name_dict.items()}[mbdy_nr]
|
86
|
+
return DistributedSections(mbdy_name, link_type, link_id, nsec)
|
87
|
+
|
88
|
+
def get_distributed_section_position_orientation(self, ds: DistributedSections, mainbody_coo_nr=0):
|
89
|
+
"""
|
90
|
+
Parameters
|
91
|
+
----------
|
92
|
+
ds : DistributedSections
|
93
|
+
|
94
|
+
Returns
|
95
|
+
-------
|
96
|
+
sec_pos : array(nsec,3)
|
97
|
+
sec_ori : array(nsec,3,3)
|
98
|
+
Orientation of section in specified coordinates.
|
99
|
+
For mainbody_coo_nr=0, default, the orientation is in global coordinates, i.e. Tsg
|
100
|
+
"""
|
101
|
+
sec_pos = np.zeros((ds.nsec, 3), dtype=np.float64, order="F")
|
102
|
+
sec_ori = np.zeros((ds.nsec, 3, 3), dtype=np.float64, order="F")
|
103
|
+
return H2LibSignatures.get_distributed_section_position_orientation(
|
104
|
+
self, int(ds.link_type.value), int(ds.link_id), int(ds.nsec), sec_pos, sec_ori,
|
105
|
+
int(mainbody_coo_nr))[0][3:-1]
|
106
|
+
|
107
|
+
def set_distributed_section_force_and_moment(self, ds: DistributedSections, sec_frc, sec_mom):
|
108
|
+
"""Set forces and moments at distributed sections
|
109
|
+
|
110
|
+
Parameters
|
111
|
+
----------
|
112
|
+
ds : DistributedSections object
|
113
|
+
object returned by add_distributed_sections or get_distributed_sections
|
114
|
+
sec_frc : array_like
|
115
|
+
Section forces pr. length [N/m] in global coordinates, shape=(nsec,3)
|
116
|
+
sec_momc : array_like
|
117
|
+
Section moments pr. length [Nm/m] in global coordinates, shape=(nsec,3)
|
118
|
+
"""
|
119
|
+
sec_frc = np.asfortranarray(sec_frc, dtype=np.float64)
|
120
|
+
sec_mom = np.asfortranarray(sec_mom, dtype=np.float64)
|
121
|
+
assert sec_frc.shape == (ds.nsec, 3)
|
122
|
+
assert sec_mom.shape == (ds.nsec, 3)
|
123
|
+
|
124
|
+
return H2LibSignatures.set_distributed_section_force_and_moment(
|
125
|
+
self, link_type=int(ds.link_type.value), link_id=int(ds.link_id), nsec=int(ds.nsec),
|
126
|
+
frc_g=sec_frc, mom_g=sec_mom)
|
127
|
+
|
128
|
+
def set_fsi_loads_h2lib(self, fx, fy, fz, mx, my, mz): # pragma: no cover
|
129
|
+
"""Temporary function needed to replicate results of the cpl coupling framework"""
|
130
|
+
fx, fy, fz, mx, my, mz = [np.asfortranarray(v, dtype=np.float64) for v in [fx, fy, fz, mx, my, mz]]
|
131
|
+
self.get_lib_function('set_fsi_loads_hawc2')(fx, fy, fz, mx, my, mz)
|
h2lib/h2lib_signatures.py
CHANGED
@@ -4,6 +4,14 @@ from h2lib.dll_wrapper import DLLWrapper
|
|
4
4
|
|
5
5
|
|
6
6
|
class H2LibSignatures():
|
7
|
+
def add_distributed_sections(self, mainbody_nr, nsec, sec_rel_pos, link_id, check_stop=True):
|
8
|
+
'''subroutine add_distributed_sections(mainbody_nr, nsec, sec_rel_pos, link_id) bind(C, name="add_distributed_sections")
|
9
|
+
integer*8, intent(in) :: mainbody_nr, nsec
|
10
|
+
integer*8, intent(out) :: link_id
|
11
|
+
real(c_double), intent(in) :: sec_rel_pos(nsec)
|
12
|
+
end subroutine'''
|
13
|
+
return self.get_lib_function('add_distributed_sections')(mainbody_nr, nsec, sec_rel_pos, link_id, check_stop=check_stop)
|
14
|
+
|
7
15
|
def add_sensor(self, sensor_line, index_start, index_stop, check_stop=True):
|
8
16
|
'''subroutine add_sensor(sensor_line, index_start, index_stop) bind(C, name="add_sensor")
|
9
17
|
integer*8 :: index_start, index_stop
|
@@ -11,6 +19,28 @@ class H2LibSignatures():
|
|
11
19
|
end subroutine'''
|
12
20
|
return self.get_lib_function('add_sensor')(sensor_line, index_start, index_stop, check_stop=check_stop)
|
13
21
|
|
22
|
+
def body_output_element(self, ibdy, ielem, mass, stiffness, damping, error_code, check_stop=True):
|
23
|
+
'''subroutine body_output_element(ibdy, ielem, mass, stiffness, damping, error_code) &
|
24
|
+
integer(kind=4), intent(in) :: ibdy
|
25
|
+
integer(kind=4), intent(in) :: ielem
|
26
|
+
real(kind=c_double), dimension(12, 12), intent(out) :: mass
|
27
|
+
real(kind=c_double), dimension(12, 12), intent(out) :: stiffness
|
28
|
+
real(kind=c_double), dimension(12, 12), intent(out) :: damping
|
29
|
+
integer(kind=8), intent(out) :: error_code
|
30
|
+
end subroutine'''
|
31
|
+
return self.get_lib_function('body_output_element')(ibdy, ielem, mass, stiffness, damping, error_code, check_stop=check_stop)
|
32
|
+
|
33
|
+
def body_output_mass(self, ibdy, body_mass, body_inertia, cog_global_frame, cog_body_frame, error_code, check_stop=True):
|
34
|
+
'''subroutine body_output_mass(ibdy, body_mass, body_inertia, cog_global_frame, cog_body_frame, error_code) &
|
35
|
+
integer(kind=4), intent(in) :: ibdy
|
36
|
+
real(kind=c_double), intent(out) :: body_mass
|
37
|
+
real(kind=c_double), intent(out) :: body_inertia(6)
|
38
|
+
real(kind=c_double), intent(out) :: cog_global_frame(3)
|
39
|
+
real(kind=c_double), intent(out) :: cog_body_frame(3)
|
40
|
+
integer(kind=8), intent(out) :: error_code
|
41
|
+
end subroutine'''
|
42
|
+
return self.get_lib_function('body_output_mass')(ibdy, body_mass, body_inertia, cog_global_frame, cog_body_frame, error_code, check_stop=check_stop)
|
43
|
+
|
14
44
|
def check_convergence(self, bconv, resq, resg, resd, check_stop=True):
|
15
45
|
'''subroutine check_convergence(bconv, resq, resg, resd) bind(C, name='check_convergence')
|
16
46
|
logical(kind=c_bool), intent(out) :: bconv
|
@@ -20,8 +50,7 @@ class H2LibSignatures():
|
|
20
50
|
end subroutine'''
|
21
51
|
return self.get_lib_function('check_convergence')(bconv, resq, resg, resd, check_stop=check_stop)
|
22
52
|
|
23
|
-
def do_system_eigenanalysis(self, include_damping, n_modes, natural_frequencies,
|
24
|
-
damping_ratios, error_code, check_stop=True):
|
53
|
+
def do_system_eigenanalysis(self, include_damping, n_modes, natural_frequencies, damping_ratios, error_code, check_stop=True):
|
25
54
|
'''subroutine do_system_eigenanalysis(include_damping, n_modes, natural_frequencies, damping_ratios, error_code) &
|
26
55
|
logical(kind=c_bool), intent(in) :: include_damping
|
27
56
|
integer(kind=4), intent(in) :: n_modes
|
@@ -29,8 +58,7 @@ real(kind=c_double), dimension(n_modes), intent(out) :: natural_frequencies
|
|
29
58
|
real(kind=c_double), dimension(n_modes), intent(out) :: damping_ratios
|
30
59
|
integer(kind=8), intent(out) :: error_code
|
31
60
|
end subroutine'''
|
32
|
-
return self.get_lib_function('do_system_eigenanalysis')(include_damping, n_modes,
|
33
|
-
natural_frequencies, damping_ratios, error_code, check_stop=check_stop)
|
61
|
+
return self.get_lib_function('do_system_eigenanalysis')(include_damping, n_modes, natural_frequencies, damping_ratios, error_code, check_stop=check_stop)
|
34
62
|
|
35
63
|
def echo_version(self, check_stop=True):
|
36
64
|
'''subroutine echo_version() BIND(C, NAME='echo_version')
|
@@ -136,6 +164,21 @@ end subroutine'''
|
|
136
164
|
end function'''
|
137
165
|
return self.get_lib_function('get_diameter')(rotor, restype=restype, check_stop=check_stop)
|
138
166
|
|
167
|
+
def get_distributed_section_position_orientation(self, link_type, link_id, nsec, sec_pos, sec_ori, mainbody_coo_nr, check_stop=True):
|
168
|
+
'''subroutine get_distributed_section_position_orientation(link_type, link_id, nsec, sec_pos, sec_ori, mainbody_coo_nr) bind(C, name="get_distributed_section_position_orientation")
|
169
|
+
integer*8, intent(in) :: link_type, link_id, nsec, mainbody_coo_nr
|
170
|
+
real(c_double), intent(out) :: sec_pos(nsec,3)
|
171
|
+
real(c_double), intent(out) :: sec_ori(nsec,3,3)
|
172
|
+
end subroutine'''
|
173
|
+
return self.get_lib_function('get_distributed_section_position_orientation')(link_type, link_id, nsec, sec_pos, sec_ori, mainbody_coo_nr, check_stop=check_stop)
|
174
|
+
|
175
|
+
def get_distributed_sections(self, link_type, link_id, mainbody_nr, nsec, check_stop=True):
|
176
|
+
'''subroutine get_distributed_sections(link_type, link_id, mainbody_nr, nsec) bind(C, name="get_distributed_sections")
|
177
|
+
integer*8, intent(in) :: link_type, link_id
|
178
|
+
integer*8, intent(out) :: nsec, mainbody_nr
|
179
|
+
end subroutine'''
|
180
|
+
return self.get_lib_function('get_distributed_sections')(link_type, link_id, mainbody_nr, nsec, check_stop=check_stop)
|
181
|
+
|
139
182
|
def get_induction_axisymmetric(self, rotor, induction, check_stop=True):
|
140
183
|
'''subroutine get_induction_axisymmetric(rotor, induction) bind(C, name="get_induction_axisymmetric")
|
141
184
|
integer*8, intent(in) :: rotor
|
@@ -158,6 +201,21 @@ end subroutine'''
|
|
158
201
|
end subroutine'''
|
159
202
|
return self.get_lib_function('get_induction_rotoravg')(rotor, induction, check_stop=check_stop)
|
160
203
|
|
204
|
+
def get_mainbody_name(self, mainbody_nr, mainbody_name, check_stop=True):
|
205
|
+
'''subroutine get_mainbody_name(mainbody_nr, mainbody_name) bind(C, name="get_mainbody_name")
|
206
|
+
integer*8 :: mainbody_nr
|
207
|
+
character(kind=c_char, len=1), intent(inout) :: mainbody_name(256)
|
208
|
+
end subroutine'''
|
209
|
+
return self.get_lib_function('get_mainbody_name')(mainbody_nr, mainbody_name, check_stop=check_stop)
|
210
|
+
|
211
|
+
def get_mainbody_position_orientation(self, mainbody_nr, mbdy_pos, mbdy_ori, mainbody_coo_nr, check_stop=True):
|
212
|
+
'''subroutine get_mainbody_position_orientation(mainbody_nr, mbdy_pos, mbdy_ori, mainbody_coo_nr) bind(C, name="get_mainbody_position_orientation")
|
213
|
+
integer*8, intent(in) :: mainbody_nr, mainbody_coo_nr
|
214
|
+
real(c_double), intent(out) :: mbdy_pos(3)
|
215
|
+
real(c_double), intent(out) :: mbdy_ori(3,3)
|
216
|
+
end subroutine'''
|
217
|
+
return self.get_lib_function('get_mainbody_position_orientation')(mainbody_nr, mbdy_pos, mbdy_ori, mainbody_coo_nr, check_stop=check_stop)
|
218
|
+
|
161
219
|
def get_nSections(self, rotor, blade, restype, check_stop=True):
|
162
220
|
'''function get_nSections(rotor, blade) bind(C, name="get_nSections")
|
163
221
|
!DEC$ ATTRIBUTES DLLEXPORT :: get_nSections
|
@@ -187,8 +245,7 @@ end subroutine'''
|
|
187
245
|
integer(kind=8), intent(out) :: ncst
|
188
246
|
integer(kind=8), intent(out) :: error_code
|
189
247
|
end subroutine'''
|
190
|
-
return self.get_lib_function('get_number_of_bodies_and_constraints')(
|
191
|
-
nbdy, ncst, error_code, check_stop=check_stop)
|
248
|
+
return self.get_lib_function('get_number_of_bodies_and_constraints')(nbdy, ncst, error_code, check_stop=check_stop)
|
192
249
|
|
193
250
|
def get_number_of_elements(self, nbdy, nelem, error_code, check_stop=True):
|
194
251
|
'''subroutine get_number_of_elements(nbdy, nelem, error_code) &
|
@@ -198,6 +255,13 @@ end subroutine'''
|
|
198
255
|
end subroutine'''
|
199
256
|
return self.get_lib_function('get_number_of_elements')(nbdy, nelem, error_code, check_stop=check_stop)
|
200
257
|
|
258
|
+
def get_number_of_mainbodies(self, restype, check_stop=True):
|
259
|
+
'''function get_number_of_mainbodies() bind(C, name="get_number_of_mainbodies")
|
260
|
+
!DEC$ ATTRIBUTES DLLEXPORT :: get_number_of_mainbodies
|
261
|
+
integer*8 :: get_number_of_mainbodies
|
262
|
+
end function'''
|
263
|
+
return self.get_lib_function('get_number_of_mainbodies')(restype=restype, check_stop=check_stop)
|
264
|
+
|
201
265
|
def get_rotor_avg_wsp(self, coo, rotor, wsp, check_stop=True):
|
202
266
|
'''subroutine get_rotor_avg_wsp(coo, rotor, wsp) bind(C, name="get_rotor_avg_wsp")
|
203
267
|
integer*8, intent(in) :: rotor
|
@@ -253,8 +317,7 @@ end subroutine'''
|
|
253
317
|
end subroutine'''
|
254
318
|
return self.get_lib_function('get_stop_message')(stop_message, check_stop=check_stop)
|
255
319
|
|
256
|
-
def get_system_eigval_eigvec_with_damping(self, n_modes, ny, eigenvalues,
|
257
|
-
eigenvectors, error_code, check_stop=True):
|
320
|
+
def get_system_eigval_eigvec_with_damping(self, n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=True):
|
258
321
|
'''subroutine get_system_eigval_eigvec_with_damping(n_modes, ny, eigenvalues, eigenvectors, error_code) &
|
259
322
|
integer(kind=4), intent(in) :: n_modes
|
260
323
|
integer(kind=4), intent(in) :: ny
|
@@ -262,11 +325,9 @@ complex(kind=c_double_complex), dimension(n_modes), intent(out) :: eigenvalues
|
|
262
325
|
complex(kind=c_double_complex), dimension(ny, n_modes), intent(out) :: eigenvectors
|
263
326
|
integer(kind=8), intent(out) :: error_code
|
264
327
|
end subroutine'''
|
265
|
-
return self.get_lib_function('get_system_eigval_eigvec_with_damping')(
|
266
|
-
n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
328
|
+
return self.get_lib_function('get_system_eigval_eigvec_with_damping')(n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
267
329
|
|
268
|
-
def get_system_eigval_eigvec_without_damping(
|
269
|
-
self, n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=True):
|
330
|
+
def get_system_eigval_eigvec_without_damping(self, n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=True):
|
270
331
|
'''subroutine get_system_eigval_eigvec_without_damping(n_modes, ny, eigenvalues, eigenvectors, error_code) &
|
271
332
|
integer(kind=4), intent(in) :: n_modes
|
272
333
|
integer(kind=4), intent(in) :: ny
|
@@ -274,8 +335,7 @@ real(kind=c_double), dimension(n_modes), intent(out) :: eigenvalues
|
|
274
335
|
real(kind=c_double), dimension(ny, n_modes), intent(out) :: eigenvectors
|
275
336
|
integer(kind=8), intent(out) :: error_code
|
276
337
|
end subroutine'''
|
277
|
-
return self.get_lib_function('get_system_eigval_eigvec_without_damping')(
|
278
|
-
n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
338
|
+
return self.get_lib_function('get_system_eigval_eigvec_without_damping')(n_modes, ny, eigenvalues, eigenvectors, error_code, check_stop=check_stop)
|
279
339
|
|
280
340
|
def get_system_matrices(self, n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=True):
|
281
341
|
'''subroutine get_system_matrices(n_tdofs, n_rdofs, M, C, K, R, error_code) &
|
@@ -287,8 +347,7 @@ real(kind=c_double), dimension(n_rdofs, n_rdofs), intent(out) :: K
|
|
287
347
|
real(kind=c_double), dimension(n_tdofs, n_rdofs), intent(out) :: R
|
288
348
|
integer(kind=8), intent(out) :: error_code
|
289
349
|
end subroutine'''
|
290
|
-
return self.get_lib_function('get_system_matrices')(
|
291
|
-
n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=check_stop)
|
350
|
+
return self.get_lib_function('get_system_matrices')(n_tdofs, n_rdofs, M, C, K, R, error_code, check_stop=check_stop)
|
292
351
|
|
293
352
|
def get_time(self, time, check_stop=True):
|
294
353
|
'''subroutine
|
@@ -305,8 +364,7 @@ subroutine'''
|
|
305
364
|
real(kind=c_double), dimension(3,3), intent(out) :: tes
|
306
365
|
integer(kind=8), intent(out) :: error_code
|
307
366
|
end subroutine'''
|
308
|
-
return self.get_lib_function('get_timoshenko_location')(
|
309
|
-
ibdy, ielem, l, r1, r12, tes, error_code, check_stop=check_stop)
|
367
|
+
return self.get_lib_function('get_timoshenko_location')(ibdy, ielem, l, r1, r12, tes, error_code, check_stop=check_stop)
|
310
368
|
|
311
369
|
def get_version(self, s, check_stop=True):
|
312
370
|
'''subroutine get_version(s) BIND(C, NAME='get_version')
|
@@ -320,28 +378,41 @@ end subroutine'''
|
|
320
378
|
end subroutine'''
|
321
379
|
return self.get_lib_function('init')(check_stop=check_stop)
|
322
380
|
|
323
|
-
def init_AD(self, rotor, tiploss_method,
|
324
|
-
'''subroutine init_AD(rotor, tiploss_method,
|
381
|
+
def init_AD(self, rotor, tiploss_method, tiploss2_shen_c2, tiploss2_shen_h, check_stop=True):
|
382
|
+
'''subroutine init_AD(rotor, tiploss_method, tiploss2_shen_c2, tiploss2_shen_h) bind(C, name="init_AD")
|
325
383
|
integer*8, intent(in) :: rotor
|
326
384
|
integer*8, intent(in) :: tiploss_method
|
327
|
-
REAL(c_double), intent(in) ::
|
385
|
+
REAL(c_double), intent(in) :: tiploss2_shen_c2, tiploss2_shen_h
|
328
386
|
end subroutine'''
|
329
|
-
return self.get_lib_function('init_AD')(rotor, tiploss_method,
|
387
|
+
return self.get_lib_function('init_AD')(rotor, tiploss_method, tiploss2_shen_c2, tiploss2_shen_h, check_stop=check_stop)
|
330
388
|
|
331
|
-
def init_AL(self, rotor, epsilon_smearing):
|
389
|
+
def init_AL(self, rotor, epsilon_smearing, check_stop=True):
|
332
390
|
'''subroutine init_AL(rotor, epsilon_smearing) bind(C, name="init_AL")
|
333
391
|
real(c_double), intent(in) :: epsilon_smearing
|
334
392
|
integer*8, intent(in) :: rotor
|
335
393
|
end subroutine'''
|
336
|
-
return self.get_lib_function('init_AL')(rotor, epsilon_smearing)
|
394
|
+
return self.get_lib_function('init_AL')(rotor, epsilon_smearing, check_stop=check_stop)
|
337
395
|
|
338
|
-
def init_windfield(self, Nxyz, dxyz, box_offset_yz, transport_speed):
|
396
|
+
def init_windfield(self, Nxyz, dxyz, box_offset_yz, transport_speed, check_stop=True):
|
339
397
|
'''subroutine init_windfield(Nxyz, dxyz, box_offset_yz, transport_speed) bind(C, name="init_windfield")
|
340
398
|
integer*8, dimension(3), intent(in) :: Nxyz
|
341
399
|
real*8 :: transport_speed
|
342
400
|
end subroutine'''
|
343
|
-
return self.get_lib_function('init_windfield')(
|
344
|
-
|
401
|
+
return self.get_lib_function('init_windfield')(Nxyz, dxyz, box_offset_yz, transport_speed, check_stop=check_stop)
|
402
|
+
|
403
|
+
def initialize_distributed_sections(self, check_stop=True):
|
404
|
+
'''subroutine initialize_distributed_sections() bind(C, name="initialize_distributed_sections")
|
405
|
+
!DEC$ ATTRIBUTES DLLEXPORT :: initialize_distributed_sections
|
406
|
+
type (TBodyLink), pointer :: bodylink
|
407
|
+
type (Tseclink),dimension(:),pointer :: seclinks
|
408
|
+
Type (Tbaselink) :: baselink
|
409
|
+
type (body_type),dimension(:),pointer :: b_vec
|
410
|
+
type (TBodySectionLink), pointer :: bsl
|
411
|
+
Type (Tmain_body_input),pointer :: mbdy
|
412
|
+
integer :: nnodes
|
413
|
+
integer :: i
|
414
|
+
end subroutine'''
|
415
|
+
return self.get_lib_function('initialize_distributed_sections')(check_stop=check_stop)
|
345
416
|
|
346
417
|
def linearize(self, n_tdofs, n_rdofs, check_stop=True):
|
347
418
|
'''subroutine linearize(n_tdofs, n_rdofs) bind(C, name="linearize")
|
@@ -381,6 +452,12 @@ end subroutine'''
|
|
381
452
|
end subroutine'''
|
382
453
|
return self.get_lib_function('read_input')(htc_path, check_stop=check_stop)
|
383
454
|
|
455
|
+
def reset_stop_code_and_message(self, check_stop=True):
|
456
|
+
'''subroutine reset_stop_code_and_message() bind(C, name="reset_stop_code_and_message")
|
457
|
+
!DEC$ ATTRIBUTES DLLEXPORT :: reset_stop_code_and_message
|
458
|
+
end subroutine'''
|
459
|
+
return self.get_lib_function('reset_stop_code_and_message')(check_stop=check_stop)
|
460
|
+
|
384
461
|
def run(self, time, restype, check_stop=True):
|
385
462
|
'''function run(time) bind(C, name='run')
|
386
463
|
!DEC$ ATTRIBUTES DLLEXPORT :: run
|
@@ -389,12 +466,6 @@ end subroutine'''
|
|
389
466
|
end function'''
|
390
467
|
return self.get_lib_function('run')(time, restype=restype, check_stop=check_stop)
|
391
468
|
|
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
469
|
def setState(self, val, check_stop=True):
|
399
470
|
'''subroutine setState(val) BIND(C, NAME='setState')
|
400
471
|
integer, intent(in) :: val
|
@@ -408,32 +479,51 @@ end subroutine'''
|
|
408
479
|
end subroutine'''
|
409
480
|
return self.get_lib_function('set_aerosections_windspeed')(rotor, uvw, check_stop=check_stop)
|
410
481
|
|
411
|
-
def
|
412
|
-
|
413
|
-
|
414
|
-
|
482
|
+
def set_c2_def(self, main_body_name, c2_def, nsec, twist_in_deg, check_length, error_code, check_stop=True):
|
483
|
+
'''subroutine set_c2_def(main_body_name, c2_def, nsec, twist_in_deg, check_length, error_code) &
|
484
|
+
character(kind=c_char, len=1), dimension(256), intent(in ) :: main_body_name ! Defined as an array of length 1 characters because of bind.
|
485
|
+
real(kind=c_double), dimension(nsec, 4), intent(in ) :: c2_def
|
486
|
+
integer(kind=4), intent(in ) :: nsec
|
487
|
+
logical(kind=c_bool), intent(in ) :: twist_in_deg
|
488
|
+
logical(kind=c_bool), intent(in ) :: check_length
|
489
|
+
integer(kind=8), intent( out) :: error_code
|
490
|
+
character(kind=c_char, len=256) :: mbdy_name ! Same as main_body_name, but as string instead of an array of characters.
|
491
|
+
type(Tmain_body_input), pointer :: main_body ! The main body whose c2_def we want to update.
|
492
|
+
type(Tc2def_input), pointer :: c2def_input ! The c2_def of main_body.
|
493
|
+
end subroutine'''
|
494
|
+
return self.get_lib_function('set_c2_def')(main_body_name, c2_def, nsec, twist_in_deg, check_length, error_code, check_stop=check_stop)
|
495
|
+
|
496
|
+
def set_distributed_section_force_and_moment(self, link_type, link_id, nsec, frc_g, mom_g, check_stop=True):
|
497
|
+
'''subroutine set_distributed_section_force_and_moment(link_type, link_id, nsec, frc_g, mom_g) bind(C, name="set_distributed_section_force_and_moment")
|
498
|
+
integer*8, intent(in) :: link_type, link_id, nsec
|
499
|
+
real(c_double), intent(in) :: frc_g(nsec,3), mom_g(nsec,3)
|
500
|
+
end subroutine'''
|
501
|
+
return self.get_lib_function('set_distributed_section_force_and_moment')(link_type, link_id, nsec, frc_g, mom_g, check_stop=check_stop)
|
502
|
+
|
503
|
+
def set_orientation_base(self, main_body_name, n_rows, mbdy_eulerang_table, angles_in_deg, reset_orientation, mbdy_ini_rotvec_d1, error_code, check_stop=True):
|
504
|
+
'''subroutine set_orientation_base(main_body_name, n_rows, mbdy_eulerang_table, angles_in_deg, reset_orientation, mbdy_ini_rotvec_d1, error_code) &
|
415
505
|
character(kind=c_char, len=1), dimension(256), intent(in) :: main_body_name
|
506
|
+
integer(kind=4), intent(in) :: n_rows
|
416
507
|
real(kind=c_double), dimension(n_rows, 3), intent(in) :: mbdy_eulerang_table
|
417
508
|
logical(c_bool), intent(in) :: angles_in_deg
|
418
509
|
logical(c_bool), intent(in) :: reset_orientation
|
419
510
|
real(kind=c_double), dimension(4), intent(in) :: mbdy_ini_rotvec_d1
|
511
|
+
integer(kind=8), intent(out) :: error_code ! Error code.
|
420
512
|
end subroutine'''
|
421
|
-
return self.get_lib_function('set_orientation_base')(main_body_name,
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
def set_orientation_relative(self, main_body_1_name, node_1, main_body_2_name, node_2,
|
426
|
-
n_rows, mbdy2_eulerang_table, angles_in_deg,
|
427
|
-
reset_orientation,
|
428
|
-
mbdy2_ini_rotvec_d1,
|
429
|
-
error_code, check_stop=True):
|
430
|
-
'''subroutine set_orientation_relative(main_body_1_name, node_1, main_body_2_name, node_2, &
|
513
|
+
return self.get_lib_function('set_orientation_base')(main_body_name, n_rows, mbdy_eulerang_table, angles_in_deg, reset_orientation, mbdy_ini_rotvec_d1, error_code, check_stop=check_stop)
|
514
|
+
|
515
|
+
def set_orientation_relative(self, main_body_1_name, node_1, main_body_2_name, node_2, n_rows, mbdy2_eulerang_table, angles_in_deg, reset_orientation, mbdy2_ini_rotvec_d1, error_code, check_stop=True):
|
516
|
+
'''subroutine set_orientation_relative(main_body_1_name, node_1, main_body_2_name, node_2, n_rows, mbdy2_eulerang_table, angles_in_deg, reset_orientation, mbdy2_ini_rotvec_d1, error_code) &
|
431
517
|
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.
|
432
518
|
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.
|
433
519
|
integer(kind=8), intent(in ) :: node_1
|
434
520
|
integer(kind=8), intent(in ) :: node_2
|
521
|
+
integer(kind=4), intent(in ) :: n_rows
|
435
522
|
real(kind=c_double), dimension(n_rows, 3), intent(in ) :: mbdy2_eulerang_table
|
436
523
|
logical(c_bool), intent(in ) :: angles_in_deg
|
524
|
+
logical(c_bool), intent(in ) :: reset_orientation
|
525
|
+
real(kind=c_double), dimension(4), intent(in ) :: mbdy2_ini_rotvec_d1 ! Initial angular velocity direction and magnitude.
|
526
|
+
integer(kind=8), intent( out) :: error_code
|
437
527
|
character(kind=c_char, len=256) :: mbdy_1_name ! Same as main_body_1_name, but as string instead of an array of characters.
|
438
528
|
character(kind=c_char, len=256) :: mbdy_2_name ! Same as main_body_2_name, but as string instead of an array of characters.
|
439
529
|
type(Tmain_body_input), pointer :: main_body_1 ! The main body pointer associated to main_body_1_name.
|
@@ -441,11 +531,7 @@ type(Tmain_body_input), pointer :: main_body_2 ! The main body pointer associat
|
|
441
531
|
integer(kind=4) :: node_1_local, node_2_local ! Internal copy of node_1 and node_2.
|
442
532
|
real*8, dimension(3) :: eulerang ! Euler angles associated to 1 row of mbdy2_eulerang_table.
|
443
533
|
end subroutine'''
|
444
|
-
return self.get_lib_function('set_orientation_relative')(main_body_1_name, node_1, main_body_2_name, node_2,
|
445
|
-
n_rows, mbdy2_eulerang_table, angles_in_deg,
|
446
|
-
reset_orientation,
|
447
|
-
mbdy2_ini_rotvec_d1,
|
448
|
-
error_code, check_stop=check_stop)
|
534
|
+
return self.get_lib_function('set_orientation_relative')(main_body_1_name, node_1, main_body_2_name, node_2, n_rows, mbdy2_eulerang_table, angles_in_deg, reset_orientation, mbdy2_ini_rotvec_d1, error_code, check_stop=check_stop)
|
449
535
|
|
450
536
|
def set_variable_sensor_value(self, id, value, check_stop=True):
|
451
537
|
'''subroutine set_variable_sensor_value(id, value) bind(C, name="set_variable_sensor_value")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: h2lib
|
3
|
-
Version: 13.
|
4
|
-
Summary: Python interface to HAWC2 (13.
|
3
|
+
Version: 13.2.701
|
4
|
+
Summary: Python interface to HAWC2 (13.2.7+4-gb779ee7)
|
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,11 @@
|
|
1
|
+
h2lib/HAWC2Lib.dll,sha256=UhEa8wYrBfkZ3f-6MQDeNOTP9ncDIkWpfj8zJ1skSfA,30628864
|
2
|
+
h2lib/__init__.py,sha256=f3fO4I6IEFRM9LaV2O3w9Pioj3GPI8qRl7P5Tg5ONtE,528
|
3
|
+
h2lib/_h2lib.py,sha256=mA4W91BbSO2edvHzsrroVbRD_pW4axwGlwxBE9nDnkQ,45730
|
4
|
+
h2lib/_version.py,sha256=JiP-kg_iCUO5g8WQvSp95pNuU7r-swyVJphX5dw60eU,157
|
5
|
+
h2lib/distributed_sections.py,sha256=VhcYr94se4Zq8PaHg_6z6r7YjwSvbEQoxPiA25HYXBg,6233
|
6
|
+
h2lib/dll_wrapper.py,sha256=O_lGZ_w3FirjEn4FIE5OeZz30nwpufJB5sflVzf4Cc4,13446
|
7
|
+
h2lib/h2lib_signatures.py,sha256=P-9iysIIwgi18qBEUXj5X_-YFS7xt5Em4NSwfgrfDVE,36509
|
8
|
+
h2lib-13.2.701.dist-info/METADATA,sha256=evKD9QTQXimcV0tk8B3kJq5i2PrXJX89n9yjtMYwOIY,860
|
9
|
+
h2lib-13.2.701.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
|
10
|
+
h2lib-13.2.701.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
|
11
|
+
h2lib-13.2.701.dist-info/RECORD,,
|
h2lib-13.1.3110.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
h2lib/HAWC2Lib.dll,sha256=d9L59FXhqepZw8oeAZqEFhE6hw0tHhk1c-4dvUOICNQ,30970368
|
2
|
-
h2lib/__init__.py,sha256=f3fO4I6IEFRM9LaV2O3w9Pioj3GPI8qRl7P5Tg5ONtE,528
|
3
|
-
h2lib/_h2lib.py,sha256=X0G8PYTrArB1Wk9IbhHvUMlximW3oCP54hIWy0SnNuM,39438
|
4
|
-
h2lib/_version.py,sha256=5oL1UbtrpDubFMvgb7RwXWV3qywadrQ8_1cDWkUJFgo,160
|
5
|
-
h2lib/dll_wrapper.py,sha256=O_lGZ_w3FirjEn4FIE5OeZz30nwpufJB5sflVzf4Cc4,13446
|
6
|
-
h2lib/h2lib_signatures.py,sha256=sPCh92WdCc6brPgARZ_QBgSz49Yjq0M5SpWb0or5KvM,29396
|
7
|
-
h2lib-13.1.3110.dist-info/METADATA,sha256=UUEZgPxZjcaYNBFvCqGUvcfDZjWa10j33FB_59B6aAw,862
|
8
|
-
h2lib-13.1.3110.dist-info/WHEEL,sha256=8UP9x9puWI0P1V_d7K2oMTBqfeLNm21CTzZ_Ptr0NXU,101
|
9
|
-
h2lib-13.1.3110.dist-info/top_level.txt,sha256=y_a-tUqphEZQ_0nsWSMaSb21P8Lsd8hUxUdE9g2Dcbk,6
|
10
|
-
h2lib-13.1.3110.dist-info/RECORD,,
|
File without changes
|
File without changes
|