sgio 0.2.13__py3-none-any.whl → 0.2.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sgio/__init__.py +24 -4
- sgio/_version.py +1 -1
- sgio/iofunc/_meshio.py +31 -28
- sgio/iofunc/main.py +3 -1
- sgio/iofunc/swiftcomp/_input.py +14 -3
- sgio/iofunc/swiftcomp/_mesh.py +54 -10
- sgio/iofunc/swiftcomp/_swiftcomp.py +4 -1
- sgio/iofunc/vabs/_mesh.py +48 -2
- sgio/model/beam.py +116 -979
- sgio/utils/execu.py +12 -1
- {sgio-0.2.13.dist-info → sgio-0.2.15.dist-info}/METADATA +5 -1
- {sgio-0.2.13.dist-info → sgio-0.2.15.dist-info}/RECORD +15 -15
- {sgio-0.2.13.dist-info → sgio-0.2.15.dist-info}/WHEEL +1 -1
- {sgio-0.2.13.dist-info → sgio-0.2.15.dist-info}/entry_points.txt +0 -0
- {sgio-0.2.13.dist-info → sgio-0.2.15.dist-info}/licenses/LICENSE +0 -0
sgio/model/beam.py
CHANGED
|
@@ -1,111 +1,118 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import math
|
|
4
|
+
from typing import Optional, List
|
|
5
|
+
from pydantic import BaseModel, Field, field_validator, computed_field
|
|
4
6
|
|
|
5
7
|
# from dataclasses import dataclass
|
|
6
8
|
|
|
7
9
|
# @dataclass
|
|
8
|
-
class EulerBernoulliBeamModel:
|
|
10
|
+
class EulerBernoulliBeamModel(BaseModel):
|
|
9
11
|
"""Euler-Bernoulli Beam Model
|
|
10
12
|
"""
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
# #: float: Generalized shear center location in x3 direction
|
|
95
|
-
# self.xs3 = None
|
|
96
|
-
# #: float: Principal shear stiffness GA22
|
|
97
|
-
# self.ga22 = None
|
|
98
|
-
# #: float: Principal shear stiffness GA33
|
|
99
|
-
# self.ga33 = None
|
|
100
|
-
# #: float: Principal shear axes rotation angle in degree
|
|
101
|
-
# self.phi_psa = None
|
|
102
|
-
|
|
14
|
+
# Class attributes (not Pydantic fields)
|
|
15
|
+
dim: int = 1
|
|
16
|
+
label: str = 'bm1'
|
|
17
|
+
model_name: str = 'Euler-Bernoulli beam model'
|
|
18
|
+
|
|
19
|
+
# Basic properties
|
|
20
|
+
name: str = Field(default='', description="Beam name")
|
|
21
|
+
id: Optional[int] = Field(default=None, description="Beam ID")
|
|
22
|
+
|
|
23
|
+
# Inertial properties
|
|
24
|
+
mass: Optional[List[List[float]]] = Field(
|
|
25
|
+
default=None,
|
|
26
|
+
description="The 6x6 mass matrix"
|
|
27
|
+
)
|
|
28
|
+
mass_mc: Optional[List[List[float]]] = Field(
|
|
29
|
+
default=None,
|
|
30
|
+
description="The 6x6 mass matrix at the mass center"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Mass center locations
|
|
34
|
+
xm2: Optional[float] = Field(default=None, description="Mass center location in x2 direction")
|
|
35
|
+
xm3: Optional[float] = Field(default=None, description="Mass center location in x3 direction")
|
|
36
|
+
|
|
37
|
+
# Mass properties
|
|
38
|
+
mu: Optional[float] = Field(default=None, ge=0, description="Mass per unit span")
|
|
39
|
+
i11: Optional[float] = Field(default=None, ge=0, description="Mass moments of inertia i11")
|
|
40
|
+
i22: Optional[float] = Field(default=None, ge=0, description="Principal mass moments of inertia i22")
|
|
41
|
+
i33: Optional[float] = Field(default=None, ge=0, description="Principal mass moments of inertia i33")
|
|
42
|
+
phi_pia: float = Field(default=0, description="Principal inertial axes rotation angle in degree")
|
|
43
|
+
rg: Optional[float] = Field(default=None, ge=0, description="Mass-weighted radius of gyration")
|
|
44
|
+
|
|
45
|
+
# Structural properties
|
|
46
|
+
stff: Optional[List[List[float]]] = Field(
|
|
47
|
+
default=None,
|
|
48
|
+
description="Classical stiffness matrix (1-extension; 2-twist; 3,4-bending)"
|
|
49
|
+
)
|
|
50
|
+
cmpl: Optional[List[List[float]]] = Field(
|
|
51
|
+
default=None,
|
|
52
|
+
description="Classical compliance matrix (1-extension; 2-twist; 3,4-bending)"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Tension center locations
|
|
56
|
+
xt2: Optional[float] = Field(default=None, description="Tension center location in x2 direction")
|
|
57
|
+
xt3: Optional[float] = Field(default=None, description="Tension center location in x3 direction")
|
|
58
|
+
|
|
59
|
+
# Stiffness properties
|
|
60
|
+
ea: Optional[float] = Field(default=None, ge=0, description="Extension stiffness EA")
|
|
61
|
+
gj: Optional[float] = Field(default=None, ge=0, description="Torsional stiffness GJ")
|
|
62
|
+
ei22: Optional[float] = Field(default=None, ge=0, description="Principal bending stiffness EI22")
|
|
63
|
+
ei33: Optional[float] = Field(default=None, ge=0, description="Principal bending stiffness EI33")
|
|
64
|
+
phi_pba: float = Field(default=0, description="Principal bending axes rotation angle in degree")
|
|
65
|
+
|
|
66
|
+
# Pydantic configuration
|
|
67
|
+
model_config = {"arbitrary_types_allowed": True}
|
|
68
|
+
|
|
69
|
+
# Field validators
|
|
70
|
+
@field_validator('mass', 'mass_mc')
|
|
71
|
+
@classmethod
|
|
72
|
+
def validate_6x6_matrix(cls, v):
|
|
73
|
+
"""Validate that mass matrices are 6x6"""
|
|
74
|
+
if v is not None:
|
|
75
|
+
if not isinstance(v, list) or len(v) != 6:
|
|
76
|
+
raise ValueError('Matrix must be 6x6 (6 rows)')
|
|
77
|
+
for i, row in enumerate(v):
|
|
78
|
+
if not isinstance(row, list) or len(row) != 6:
|
|
79
|
+
raise ValueError(f'Row {i} must have 6 columns')
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
@field_validator('stff', 'cmpl')
|
|
83
|
+
@classmethod
|
|
84
|
+
def validate_4x4_matrix(cls, v):
|
|
85
|
+
"""Validate that stiffness/compliance matrices are 4x4"""
|
|
86
|
+
if v is not None:
|
|
87
|
+
if not isinstance(v, list) or len(v) != 4:
|
|
88
|
+
raise ValueError('Matrix must be 4x4 (4 rows)')
|
|
89
|
+
for i, row in enumerate(v):
|
|
90
|
+
if not isinstance(row, list) or len(row) != 4:
|
|
91
|
+
raise ValueError(f'Row {i} must have 4 columns')
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
# Computed properties
|
|
95
|
+
@computed_field
|
|
103
96
|
@property
|
|
104
|
-
def gyr1(self)
|
|
97
|
+
def gyr1(self) -> Optional[float]:
|
|
98
|
+
"""Mass-weighted radius of gyration (same as rg)"""
|
|
99
|
+
return self.rg
|
|
100
|
+
|
|
101
|
+
@computed_field
|
|
105
102
|
@property
|
|
106
|
-
def gyr2(self)
|
|
103
|
+
def gyr2(self) -> Optional[float]:
|
|
104
|
+
"""Radius of gyration about x2 axis"""
|
|
105
|
+
if self.i22 is not None and self.mu is not None and self.mu > 0:
|
|
106
|
+
return math.sqrt(self.i22 / self.mu)
|
|
107
|
+
return None
|
|
108
|
+
|
|
109
|
+
@computed_field
|
|
107
110
|
@property
|
|
108
|
-
def gyr3(self)
|
|
111
|
+
def gyr3(self) -> Optional[float]:
|
|
112
|
+
"""Radius of gyration about x3 axis"""
|
|
113
|
+
if self.i33 is not None and self.mu is not None and self.mu > 0:
|
|
114
|
+
return math.sqrt(self.i33 / self.mu)
|
|
115
|
+
return None
|
|
109
116
|
|
|
110
117
|
|
|
111
118
|
def __repr__(self):
|
|
@@ -282,7 +289,9 @@ class EulerBernoulliBeamModel:
|
|
|
282
289
|
|
|
283
290
|
# Mass
|
|
284
291
|
if name.startswith('ms'):
|
|
285
|
-
|
|
292
|
+
if self.mass is not None:
|
|
293
|
+
return self.mass[int(name[2])-1][int(name[3])-1]
|
|
294
|
+
return None
|
|
286
295
|
if name == 'mu':
|
|
287
296
|
return self.mu
|
|
288
297
|
if name == 'mmoi1':
|
|
@@ -300,11 +309,15 @@ class EulerBernoulliBeamModel:
|
|
|
300
309
|
|
|
301
310
|
# Stiffness
|
|
302
311
|
if name.startswith('stf'):
|
|
303
|
-
|
|
312
|
+
if self.stff is not None:
|
|
313
|
+
return self.stff[int(name[3])-1][int(name[4])-1]
|
|
314
|
+
return None
|
|
304
315
|
|
|
305
316
|
# Compliance
|
|
306
317
|
if name.startswith('cmp'):
|
|
307
|
-
|
|
318
|
+
if self.cmpl is not None:
|
|
319
|
+
return self.cmpl[int(name[3])-1][int(name[4])-1]
|
|
320
|
+
return None
|
|
308
321
|
|
|
309
322
|
if name == 'ea':
|
|
310
323
|
return self.ea
|
|
@@ -331,12 +344,17 @@ class EulerBernoulliBeamModel:
|
|
|
331
344
|
if name == 'phi_pba':
|
|
332
345
|
return self.phi_pba
|
|
333
346
|
|
|
347
|
+
# Return None for unrecognized properties (e.g., ga22, ga33 which are Timoshenko-only)
|
|
348
|
+
return None
|
|
349
|
+
|
|
334
350
|
elif isinstance(name, list) or isinstance(name, tuple):
|
|
335
351
|
props = []
|
|
336
352
|
for n in name:
|
|
337
353
|
props.append(self.get(n))
|
|
338
354
|
return props
|
|
339
355
|
|
|
356
|
+
return None
|
|
357
|
+
|
|
340
358
|
|
|
341
359
|
def getAll(self):
|
|
342
360
|
"""Get all beam properties.
|
|
@@ -815,884 +833,3 @@ class TimoshenkoBeamModel:
|
|
|
815
833
|
|
|
816
834
|
return dict_prop
|
|
817
835
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
# # Legacy
|
|
827
|
-
|
|
828
|
-
# class BeamModel():
|
|
829
|
-
# """A beam property class (smdim = 1)
|
|
830
|
-
|
|
831
|
-
# """
|
|
832
|
-
|
|
833
|
-
# def __init__(self):
|
|
834
|
-
# # MaterialSection.__init__(self, smdim=1)
|
|
835
|
-
|
|
836
|
-
# #: float: Geometric center location in x2 direction
|
|
837
|
-
# self.xg2 = 0.
|
|
838
|
-
# #: float: Geometric center location in x3 direction
|
|
839
|
-
# self.xg3 = 0.
|
|
840
|
-
|
|
841
|
-
# #: float: Area of the cross-section
|
|
842
|
-
# self.area = 0.
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
# # Inertial properties
|
|
846
|
-
# # -------------------
|
|
847
|
-
|
|
848
|
-
# #: list of list of floats:
|
|
849
|
-
# #: The 6x6 mass matrix
|
|
850
|
-
# self.mass = []
|
|
851
|
-
|
|
852
|
-
# #: list of lists of floats:
|
|
853
|
-
# #: The 6x6 mass matrix at the mass center
|
|
854
|
-
# self.mass_cs = []
|
|
855
|
-
|
|
856
|
-
# #: float: Mass center location in x2 direction
|
|
857
|
-
# self.xm2 = 0.
|
|
858
|
-
# #: float: Mass center location in x3 direction
|
|
859
|
-
# self.xm3 = 0.
|
|
860
|
-
|
|
861
|
-
# #: float: Mass per unit span
|
|
862
|
-
# self.mu = 0.
|
|
863
|
-
# #: float: Mass moments of inertia i11
|
|
864
|
-
# self.i11 = 0.
|
|
865
|
-
# #: float: Principal mass moments of inertia i22
|
|
866
|
-
# self.i22 = 0.
|
|
867
|
-
# #: float: Principle mass moments of inertia i33
|
|
868
|
-
# self.i33 = 0.
|
|
869
|
-
# #: float: Principal inertial axes rotation angle in degree
|
|
870
|
-
# self.phi_pia = 0.
|
|
871
|
-
# #: float: mass-weighted radius of gyration
|
|
872
|
-
# self.rg = 0.
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
# # Structural properties
|
|
876
|
-
# # ---------------------
|
|
877
|
-
|
|
878
|
-
# #: list of lists of floats:
|
|
879
|
-
# #: Classical stiffness matrix (1-extension; 2-twist; 3,4-bending)
|
|
880
|
-
# self.stff = []
|
|
881
|
-
# #: list of lists of floats:
|
|
882
|
-
# #: Classical compliance matrix (1-extension; 2-twist; 3,4-bending)
|
|
883
|
-
# self.cmpl = []
|
|
884
|
-
|
|
885
|
-
# #: float: Tension center location in x2 direction
|
|
886
|
-
# self.xt2 = 0.
|
|
887
|
-
# #: float: Tension center location in x3 direction
|
|
888
|
-
# self.xt3 = 0.
|
|
889
|
-
|
|
890
|
-
# #: float: Extension stiffness EA
|
|
891
|
-
# self.ea = 0.
|
|
892
|
-
# #: float: Torsional stiffness GJ
|
|
893
|
-
# self.gj = 0.
|
|
894
|
-
# #: float: Principal bending stiffness EI22
|
|
895
|
-
# self.ei22 = 0.
|
|
896
|
-
# #: float: Principal bending stiffness EI33
|
|
897
|
-
# self.ei33 = 0.
|
|
898
|
-
# #: float: Principle bending axes rotation angle in degree
|
|
899
|
-
# self.phi_pba = 0.
|
|
900
|
-
|
|
901
|
-
# #: list of lists of floats:
|
|
902
|
-
# #: Timoshenko stiffness matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)
|
|
903
|
-
# self.stff_t = []
|
|
904
|
-
# #: list of lists of floats:
|
|
905
|
-
# #: Timoshenko compliance matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)
|
|
906
|
-
# self.cmpl_t = []
|
|
907
|
-
|
|
908
|
-
# #: float: Generalized shear center location in x2 direction
|
|
909
|
-
# self.xs2 = 0.
|
|
910
|
-
# #: float: Generalized shear center location in x3 direction
|
|
911
|
-
# self.xs3 = 0.
|
|
912
|
-
# #: float: Principal shear stiffness GA22
|
|
913
|
-
# self.ga22 = 0.
|
|
914
|
-
# #: float: Principal shear stiffness GA33
|
|
915
|
-
# self.ga33 = 0.
|
|
916
|
-
# #: float: Principal shear axes rotation angle in degree
|
|
917
|
-
# self.phi_psa = 0.
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
# def printData(self):
|
|
921
|
-
# fmt = '20.10E'
|
|
922
|
-
# print('Summary')
|
|
923
|
-
# print()
|
|
924
|
-
# print('The 6x6 mass matrix')
|
|
925
|
-
# print(utio.matrixToString(self.mass, fmt=fmt))
|
|
926
|
-
# print()
|
|
927
|
-
# print('The Mass Center of the Cross-Section')
|
|
928
|
-
# # print(f'({self.xm2:{fmt}}, {self.xm3:{fmt}})')
|
|
929
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xm2, self.xm3, fmt=fmt))
|
|
930
|
-
# print()
|
|
931
|
-
# print('The Mass Properties with respect to Principal Inertial Axes')
|
|
932
|
-
# # print(f'Mass per unit span = {self.mu:{fmt}}')
|
|
933
|
-
# print('Mass per unit span = {:{fmt}}'.format(self.mu, fmt=fmt))
|
|
934
|
-
# # print(f'Mass moments of innertia i11 = {self.i11:{fmt}}')
|
|
935
|
-
# print('Mass moments of innertia i11 = {:{fmt}}'.format(self.i11, fmt=fmt))
|
|
936
|
-
# # print(f'Principle mass moments of innertia i22 = {self.i22:{fmt}}')
|
|
937
|
-
# print('Principle mass moments of innertia i22 = {:{fmt}}'.format(self.i22, fmt=fmt))
|
|
938
|
-
# # print(f'Principle mass moments of innertia i33 = {self.i33:{fmt}}')
|
|
939
|
-
# print('Principle mass moments of innertia i33 = {:{fmt}}'.format(self.i33, fmt=fmt))
|
|
940
|
-
# # print(f'The principal inertial axes rotation = {self.phi_pia:{fmt}}')
|
|
941
|
-
# print('The principal inertial axes rotation = {:{fmt}}'.format(self.phi_pia, fmt=fmt))
|
|
942
|
-
# # print(f'The mass-weighted radius of gyration = {self.rg:{fmt}}')
|
|
943
|
-
# print('The mass-weighted radius of gyration = {:{fmt}}'.format(self.rg, fmt=fmt))
|
|
944
|
-
# print()
|
|
945
|
-
# print('Classical Stiffness Matrix (1-extension; 2-twist; 3,4-bending)')
|
|
946
|
-
# print(utio.matrixToString(self.stff, fmt=fmt))
|
|
947
|
-
# print('Classical Flexibility Matrix (1-extension; 2-twist; 3,4-bending)')
|
|
948
|
-
# print(utio.matrixToString(self.cmpl, fmt=fmt))
|
|
949
|
-
# print()
|
|
950
|
-
# print('The Tension Center of the Cross-Section')
|
|
951
|
-
# # print(f'({self.xt2:{fmt}}, {self.xt3:{fmt}})')
|
|
952
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xt2, self.xt3, fmt=fmt))
|
|
953
|
-
# print()
|
|
954
|
-
# # print(f'The extension stiffness EA = {self.ea:{fmt}}')
|
|
955
|
-
# print('The extension stiffness EA = {:{fmt}}'.format(self.ea, fmt=fmt))
|
|
956
|
-
# # print(f'The torsional stiffness GJ = {self.gj:{fmt}}')
|
|
957
|
-
# print('The torsional stiffness GJ = {:{fmt}}'.format(self.gj, fmt=fmt))
|
|
958
|
-
# # print(f'Principal bending stiffness EI22 = {self.ei22:{fmt}}')
|
|
959
|
-
# print('Principal bending stiffness EI22 = {:{fmt}}'.format(self.ei22, fmt=fmt))
|
|
960
|
-
# # print(f'Principal bending stiffness EI33 = {self.ei33:{fmt}}')
|
|
961
|
-
# print('Principal bending stiffness EI33 = {:{fmt}}'.format(self.ei33, fmt=fmt))
|
|
962
|
-
# # print(f'The principal bending axes rotation = {self.phi_pba:{fmt}}')
|
|
963
|
-
# print('The principal bending axes rotation = {:{fmt}}'.format(self.phi_pba, fmt=fmt))
|
|
964
|
-
# print()
|
|
965
|
-
# print('Timoshenko Stiffness Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)')
|
|
966
|
-
# print(utio.matrixToString(self.stff_t, fmt=fmt))
|
|
967
|
-
# print('Timoshenko Flexibility Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)')
|
|
968
|
-
# print(utio.matrixToString(self.cmpl_t, fmt=fmt))
|
|
969
|
-
# print()
|
|
970
|
-
# print('The Generalized Shear Center of the Cross-Section')
|
|
971
|
-
# # print(f'({self.xs2:{fmt}}, {self.xs3:{fmt}})')
|
|
972
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xs2, self.xs3, fmt=fmt))
|
|
973
|
-
# print()
|
|
974
|
-
# # print(f'Principal shear stiffness GA22 = {self.ga22:{fmt}}')
|
|
975
|
-
# print('Principal shear stiffness GA22 = {:{fmt}}'.format(self.ga22, fmt=fmt))
|
|
976
|
-
# # print(f'Principal shear stiffness GA33 = {self.ga33:{fmt}}')
|
|
977
|
-
# print('Principal shear stiffness GA33 = {:{fmt}}'.format(self.ga33, fmt=fmt))
|
|
978
|
-
# # print(f'The principal shear axes rotation = {self.phi_psa:{fmt}}')
|
|
979
|
-
# print('The principal shear axes rotation = {:{fmt}}'.format(self.phi_psa, fmt=fmt))
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
# def get(self, name):
|
|
983
|
-
# """Get beam properties using specific names.
|
|
984
|
-
|
|
985
|
-
# Parameters
|
|
986
|
-
# ----------
|
|
987
|
-
# name : str
|
|
988
|
-
# Name of the property that will be returned.
|
|
989
|
-
|
|
990
|
-
# Returns
|
|
991
|
-
# -------
|
|
992
|
-
# float:
|
|
993
|
-
# Value of the specified beam property.
|
|
994
|
-
|
|
995
|
-
# Notes
|
|
996
|
-
# -----
|
|
997
|
-
|
|
998
|
-
# .. list-table:: Inertial properties
|
|
999
|
-
# :header-rows: 1
|
|
1000
|
-
|
|
1001
|
-
# * - Name
|
|
1002
|
-
# - Description
|
|
1003
|
-
# * - ``msijo`` (``i``, ``j`` are numbers 1 to 6)
|
|
1004
|
-
# - Entry (i, j) of the 6x6 mass matrix at the origin
|
|
1005
|
-
# * - ``msijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1006
|
-
# - Entry (i, j) of the 6x6 mass matrix at the mass center
|
|
1007
|
-
# * - ``mu``
|
|
1008
|
-
# - Mass per unit length
|
|
1009
|
-
# * - ``mmoi1`` | ``mmoi2`` | ``mmoi3``
|
|
1010
|
-
# - Mass moment of inertia about x1/x2/x3 axis
|
|
1011
|
-
|
|
1012
|
-
# .. list-table:: Stiffness properties
|
|
1013
|
-
# :header-rows: 1
|
|
1014
|
-
|
|
1015
|
-
# * - Name
|
|
1016
|
-
# - Description
|
|
1017
|
-
# * - ``stfijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1018
|
-
# - Entry (i, j) of the 4x4 classical stiffness matrix
|
|
1019
|
-
# * - ``stfijr`` (``i``, ``j`` are numbers 1 to 6)
|
|
1020
|
-
# - Entry (i, j) of the 6x6 refined stiffness matrix
|
|
1021
|
-
# * - ``eac`` | ``ear``
|
|
1022
|
-
# - Axial stiffness of the classical/refined model
|
|
1023
|
-
# * - ``gjc`` | ``gjr``
|
|
1024
|
-
# - Torsional stiffness of the classical/refined model
|
|
1025
|
-
# * - ``ei2c`` | ``eifc`` | ``ei2r`` | ``eifr``
|
|
1026
|
-
# - Bending stiffness around x2 (flapwise) of the classical/refined model
|
|
1027
|
-
# * - ``ei3c`` | ``eicc`` | ``ei3r`` | ``eicr``
|
|
1028
|
-
# - Bending stiffness around x3 (chordwise or lead-lag) of the classical/refined model
|
|
1029
|
-
# * - ``cmpijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1030
|
-
# - Entry (i, j) of the 4x4 classical compliance matrix
|
|
1031
|
-
# * - ``cmpijr`` (``i``, ``j`` are numbers 1 to 6)
|
|
1032
|
-
# - Entry (i, j) of the 6x6 refined compliance matrix
|
|
1033
|
-
|
|
1034
|
-
# .. list-table:: Center offsets
|
|
1035
|
-
# :header-rows: 1
|
|
1036
|
-
|
|
1037
|
-
# * - Name
|
|
1038
|
-
# - Description
|
|
1039
|
-
# * - ``mcy`` | ``mc2``
|
|
1040
|
-
# - y (or x2) component of the mass center
|
|
1041
|
-
# * - ``mcz`` | ``mc3``
|
|
1042
|
-
# - z (or x3) component of the mass center
|
|
1043
|
-
# * - ``tcy`` | ``tc2``
|
|
1044
|
-
# - y (or x2) component of the tension center
|
|
1045
|
-
# * - ``tcz`` | ``tc3``
|
|
1046
|
-
# - z (or x3) component of the tension center
|
|
1047
|
-
# * - ``scy`` | ``sc2``
|
|
1048
|
-
# - y (or x2) component of the shear center
|
|
1049
|
-
# * - ``scz`` | ``sc3``
|
|
1050
|
-
# - z (or x3) component of the shear center
|
|
1051
|
-
|
|
1052
|
-
# .
|
|
1053
|
-
|
|
1054
|
-
# """
|
|
1055
|
-
|
|
1056
|
-
# if isinstance(name, str):
|
|
1057
|
-
# name = name.lower()
|
|
1058
|
-
|
|
1059
|
-
# # Mass
|
|
1060
|
-
# if name.startswith('ms'):
|
|
1061
|
-
# return self.mass[int(name[2])-1][int(name[3])-1]
|
|
1062
|
-
# if name == 'mu':
|
|
1063
|
-
# return self.mu
|
|
1064
|
-
# if name == 'mmoi1':
|
|
1065
|
-
# return self.i11
|
|
1066
|
-
# if name == 'mmoi2':
|
|
1067
|
-
# return self.i22
|
|
1068
|
-
# if name == 'mmoi3':
|
|
1069
|
-
# return self.i33
|
|
1070
|
-
|
|
1071
|
-
# # Stiffness
|
|
1072
|
-
# if name.startswith('stf'):
|
|
1073
|
-
# if name[-1] == 'c':
|
|
1074
|
-
# return self.stff[int(name[3])-1][int(name[4])-1]
|
|
1075
|
-
# elif name[-1] == 'r':
|
|
1076
|
-
# return self.stff_t[int(name[3])-1][int(name[4])-1]
|
|
1077
|
-
|
|
1078
|
-
# # Compliance
|
|
1079
|
-
# if name.startswith('cmp'):
|
|
1080
|
-
# if name[-1] == 'c':
|
|
1081
|
-
# return self.cmpl[int(name[3])-1][int(name[4])-1]
|
|
1082
|
-
# elif name[-1] == 'r':
|
|
1083
|
-
# return self.cmpl_t[int(name[3])-1][int(name[4])-1]
|
|
1084
|
-
|
|
1085
|
-
# if name == 'ea':
|
|
1086
|
-
# return self.ea
|
|
1087
|
-
# if name in ['ga22', 'gayy', 'ga2', 'gay']:
|
|
1088
|
-
# return self.ga22
|
|
1089
|
-
# if name in ['ga33', 'gazz', 'ga3', 'gaz']:
|
|
1090
|
-
# return self.ga33
|
|
1091
|
-
# if name == 'gj':
|
|
1092
|
-
# return self.gj
|
|
1093
|
-
# if name in ['ei22', 'eiyy', 'ei2', 'eiy']:
|
|
1094
|
-
# return self.ei22
|
|
1095
|
-
# if name in ['ei33', 'eizz', 'ei3', 'eiz']:
|
|
1096
|
-
# return self.ei33
|
|
1097
|
-
|
|
1098
|
-
# # Various centers
|
|
1099
|
-
# if name == 'mcy' or name == 'mc2':
|
|
1100
|
-
# return self.xm2
|
|
1101
|
-
# if name == 'mcz' or name == 'mc3':
|
|
1102
|
-
# return self.xm3
|
|
1103
|
-
# if name == 'tcy' or name == 'tc2':
|
|
1104
|
-
# return self.xt2
|
|
1105
|
-
# if name == 'tcz' or name == 'tc3':
|
|
1106
|
-
# return self.xt3
|
|
1107
|
-
# if name == 'scy' or name == 'sc2':
|
|
1108
|
-
# return self.xs2
|
|
1109
|
-
# if name == 'scz' or name == 'sc3':
|
|
1110
|
-
# return self.xs3
|
|
1111
|
-
|
|
1112
|
-
# elif isinstance(name, list) or isinstance(name, tuple):
|
|
1113
|
-
# props = []
|
|
1114
|
-
# for n in name:
|
|
1115
|
-
# props.append(self.get(n))
|
|
1116
|
-
# return props
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
# def getAll(self):
|
|
1120
|
-
# """Get all beam properties.
|
|
1121
|
-
|
|
1122
|
-
# Returns
|
|
1123
|
-
# -------
|
|
1124
|
-
# dict:
|
|
1125
|
-
# A Dictionary of all beam properties.
|
|
1126
|
-
|
|
1127
|
-
# Notes
|
|
1128
|
-
# -----
|
|
1129
|
-
|
|
1130
|
-
# Names are
|
|
1131
|
-
|
|
1132
|
-
# - mu, mmoi1, mmoi2, mmoi3
|
|
1133
|
-
# - ea, ga22, ga33, gj, ei22, ei33
|
|
1134
|
-
# - mc2, mc3, tc2, tc3, sc2, sc3
|
|
1135
|
-
# - msij, stfijc, cmpijc, stfijr, cmpijr
|
|
1136
|
-
|
|
1137
|
-
# """
|
|
1138
|
-
# names = [
|
|
1139
|
-
# 'mu', 'mmoi1', 'mmoi2', 'mmoi3',
|
|
1140
|
-
# 'ea', 'ga22', 'ga33', 'gj', 'ei22', 'ei33',
|
|
1141
|
-
# 'mc2', 'mc3', 'tc2', 'tc3', 'sc2', 'sc3'
|
|
1142
|
-
# ]
|
|
1143
|
-
# for i in range(4):
|
|
1144
|
-
# for j in range(4):
|
|
1145
|
-
# names.append('stf{}{}c'.format(i+1, j+1))
|
|
1146
|
-
# names.append('cmp{}{}c'.format(i+1, j+1))
|
|
1147
|
-
# for i in range(6):
|
|
1148
|
-
# for j in range(6):
|
|
1149
|
-
# names.append('ms{}{}'.format(i+1, j+1))
|
|
1150
|
-
# names.append('stf{}{}r'.format(i+1, j+1))
|
|
1151
|
-
# names.append('cmp{}{}r'.format(i+1, j+1))
|
|
1152
|
-
|
|
1153
|
-
# dict_prop = {}
|
|
1154
|
-
# for n in names:
|
|
1155
|
-
# dict_prop[n] = self.get(n)
|
|
1156
|
-
|
|
1157
|
-
# return dict_prop
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
# import copy
|
|
1168
|
-
# import numpy as np
|
|
1169
|
-
# import sgio.utils.io as utio
|
|
1170
|
-
|
|
1171
|
-
# from .general import MaterialSection
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
# class BeamProperty(MaterialSection):
|
|
1175
|
-
# """A beam property class (smdim = 1)
|
|
1176
|
-
|
|
1177
|
-
# """
|
|
1178
|
-
|
|
1179
|
-
# def __init__(self):
|
|
1180
|
-
# MaterialSection.__init__(self, smdim=1)
|
|
1181
|
-
|
|
1182
|
-
# #: float: Geometric center location in x2 direction
|
|
1183
|
-
# self.xg2 = 0.
|
|
1184
|
-
# #: float: Geometric center location in x3 direction
|
|
1185
|
-
# self.xg3 = 0.
|
|
1186
|
-
|
|
1187
|
-
# #: float: Area of the cross-section
|
|
1188
|
-
# self.area = 0.
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
# # Inertial properties
|
|
1192
|
-
# # -------------------
|
|
1193
|
-
|
|
1194
|
-
# #: list of list of floats:
|
|
1195
|
-
# #: The 6x6 mass matrix
|
|
1196
|
-
# self.mass = []
|
|
1197
|
-
|
|
1198
|
-
# #: list of lists of floats:
|
|
1199
|
-
# #: The 6x6 mass matrix at the mass center
|
|
1200
|
-
# self.mass_cs = []
|
|
1201
|
-
|
|
1202
|
-
# #: float: Mass center location in x2 direction
|
|
1203
|
-
# self.xm2 = 0.
|
|
1204
|
-
# #: float: Mass center location in x3 direction
|
|
1205
|
-
# self.xm3 = 0.
|
|
1206
|
-
|
|
1207
|
-
# #: float: Mass per unit span
|
|
1208
|
-
# self.mu = 0.
|
|
1209
|
-
# #: float: Mass moments of inertia i11
|
|
1210
|
-
# self.i11 = 0.
|
|
1211
|
-
# #: float: Principal mass moments of inertia i22
|
|
1212
|
-
# self.i22 = 0.
|
|
1213
|
-
# #: float: Principle mass moments of inertia i33
|
|
1214
|
-
# self.i33 = 0.
|
|
1215
|
-
# #: float: Principal inertial axes rotation angle in degree
|
|
1216
|
-
# self.phi_pia = 0.
|
|
1217
|
-
# #: float: mass-weighted radius of gyration
|
|
1218
|
-
# self.rg = 0.
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
# # Structural properties
|
|
1222
|
-
# # ---------------------
|
|
1223
|
-
|
|
1224
|
-
# #: list of lists of floats:
|
|
1225
|
-
# #: Classical stiffness matrix (1-extension; 2-twist; 3,4-bending)
|
|
1226
|
-
# self.stff = []
|
|
1227
|
-
# #: list of lists of floats:
|
|
1228
|
-
# #: Classical compliance matrix (1-extension; 2-twist; 3,4-bending)
|
|
1229
|
-
# self.cmpl = []
|
|
1230
|
-
|
|
1231
|
-
# #: float: Tension center location in x2 direction
|
|
1232
|
-
# self.xt2 = 0.
|
|
1233
|
-
# #: float: Tension center location in x3 direction
|
|
1234
|
-
# self.xt3 = 0.
|
|
1235
|
-
|
|
1236
|
-
# #: float: Extension stiffness EA
|
|
1237
|
-
# self.ea = 0.
|
|
1238
|
-
# #: float: Torsional stiffness GJ
|
|
1239
|
-
# self.gj = 0.
|
|
1240
|
-
# #: float: Principal bending stiffness EI22
|
|
1241
|
-
# self.ei22 = 0.
|
|
1242
|
-
# #: float: Principal bending stiffness EI33
|
|
1243
|
-
# self.ei33 = 0.
|
|
1244
|
-
# #: float: Principle bending axes rotation angle in degree
|
|
1245
|
-
# self.phi_pba = 0.
|
|
1246
|
-
|
|
1247
|
-
# #: list of lists of floats:
|
|
1248
|
-
# #: Timoshenko stiffness matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)
|
|
1249
|
-
# self.stff_t = []
|
|
1250
|
-
# #: list of lists of floats:
|
|
1251
|
-
# #: Timoshenko compliance matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)
|
|
1252
|
-
# self.cmpl_t = []
|
|
1253
|
-
|
|
1254
|
-
# #: float: Generalized shear center location in x2 direction
|
|
1255
|
-
# self.xs2 = 0.
|
|
1256
|
-
# #: float: Generalized shear center location in x3 direction
|
|
1257
|
-
# self.xs3 = 0.
|
|
1258
|
-
# #: float: Principal shear stiffness GA22
|
|
1259
|
-
# self.ga22 = 0.
|
|
1260
|
-
# #: float: Principal shear stiffness GA33
|
|
1261
|
-
# self.ga33 = 0.
|
|
1262
|
-
# #: float: Principal shear axes rotation angle in degree
|
|
1263
|
-
# self.phi_psa = 0.
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
# def printData(self):
|
|
1267
|
-
# fmt = '20.10E'
|
|
1268
|
-
# print('Summary')
|
|
1269
|
-
# print()
|
|
1270
|
-
# print('The 6x6 mass matrix')
|
|
1271
|
-
# print(utio.matrixToString(self.mass, fmt=fmt))
|
|
1272
|
-
# print()
|
|
1273
|
-
# print('The Mass Center of the Cross-Section')
|
|
1274
|
-
# # print(f'({self.xm2:{fmt}}, {self.xm3:{fmt}})')
|
|
1275
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xm2, self.xm3, fmt=fmt))
|
|
1276
|
-
# print()
|
|
1277
|
-
# print('The Mass Properties with respect to Principal Inertial Axes')
|
|
1278
|
-
# # print(f'Mass per unit span = {self.mu:{fmt}}')
|
|
1279
|
-
# print('Mass per unit span = {:{fmt}}'.format(self.mu, fmt=fmt))
|
|
1280
|
-
# # print(f'Mass moments of innertia i11 = {self.i11:{fmt}}')
|
|
1281
|
-
# print('Mass moments of innertia i11 = {:{fmt}}'.format(self.i11, fmt=fmt))
|
|
1282
|
-
# # print(f'Principle mass moments of innertia i22 = {self.i22:{fmt}}')
|
|
1283
|
-
# print('Principle mass moments of innertia i22 = {:{fmt}}'.format(self.i22, fmt=fmt))
|
|
1284
|
-
# # print(f'Principle mass moments of innertia i33 = {self.i33:{fmt}}')
|
|
1285
|
-
# print('Principle mass moments of innertia i33 = {:{fmt}}'.format(self.i33, fmt=fmt))
|
|
1286
|
-
# # print(f'The principal inertial axes rotation = {self.phi_pia:{fmt}}')
|
|
1287
|
-
# print('The principal inertial axes rotation = {:{fmt}}'.format(self.phi_pia, fmt=fmt))
|
|
1288
|
-
# # print(f'The mass-weighted radius of gyration = {self.rg:{fmt}}')
|
|
1289
|
-
# print('The mass-weighted radius of gyration = {:{fmt}}'.format(self.rg, fmt=fmt))
|
|
1290
|
-
# print()
|
|
1291
|
-
# print('Classical Stiffness Matrix (1-extension; 2-twist; 3,4-bending)')
|
|
1292
|
-
# print(utio.matrixToString(self.stff, fmt=fmt))
|
|
1293
|
-
# print('Classical Flexibility Matrix (1-extension; 2-twist; 3,4-bending)')
|
|
1294
|
-
# print(utio.matrixToString(self.cmpl, fmt=fmt))
|
|
1295
|
-
# print()
|
|
1296
|
-
# print('The Tension Center of the Cross-Section')
|
|
1297
|
-
# # print(f'({self.xt2:{fmt}}, {self.xt3:{fmt}})')
|
|
1298
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xt2, self.xt3, fmt=fmt))
|
|
1299
|
-
# print()
|
|
1300
|
-
# # print(f'The extension stiffness EA = {self.ea:{fmt}}')
|
|
1301
|
-
# print('The extension stiffness EA = {:{fmt}}'.format(self.ea, fmt=fmt))
|
|
1302
|
-
# # print(f'The torsional stiffness GJ = {self.gj:{fmt}}')
|
|
1303
|
-
# print('The torsional stiffness GJ = {:{fmt}}'.format(self.gj, fmt=fmt))
|
|
1304
|
-
# # print(f'Principal bending stiffness EI22 = {self.ei22:{fmt}}')
|
|
1305
|
-
# print('Principal bending stiffness EI22 = {:{fmt}}'.format(self.ei22, fmt=fmt))
|
|
1306
|
-
# # print(f'Principal bending stiffness EI33 = {self.ei33:{fmt}}')
|
|
1307
|
-
# print('Principal bending stiffness EI33 = {:{fmt}}'.format(self.ei33, fmt=fmt))
|
|
1308
|
-
# # print(f'The principal bending axes rotation = {self.phi_pba:{fmt}}')
|
|
1309
|
-
# print('The principal bending axes rotation = {:{fmt}}'.format(self.phi_pba, fmt=fmt))
|
|
1310
|
-
# print()
|
|
1311
|
-
# print('Timoshenko Stiffness Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)')
|
|
1312
|
-
# print(utio.matrixToString(self.stff_t, fmt=fmt))
|
|
1313
|
-
# print('Timoshenko Flexibility Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)')
|
|
1314
|
-
# print(utio.matrixToString(self.cmpl_t, fmt=fmt))
|
|
1315
|
-
# print()
|
|
1316
|
-
# print('The Generalized Shear Center of the Cross-Section')
|
|
1317
|
-
# # print(f'({self.xs2:{fmt}}, {self.xs3:{fmt}})')
|
|
1318
|
-
# print('({:{fmt}}, {:{fmt}})'.format(self.xs2, self.xs3, fmt=fmt))
|
|
1319
|
-
# print()
|
|
1320
|
-
# # print(f'Principal shear stiffness GA22 = {self.ga22:{fmt}}')
|
|
1321
|
-
# print('Principal shear stiffness GA22 = {:{fmt}}'.format(self.ga22, fmt=fmt))
|
|
1322
|
-
# # print(f'Principal shear stiffness GA33 = {self.ga33:{fmt}}')
|
|
1323
|
-
# print('Principal shear stiffness GA33 = {:{fmt}}'.format(self.ga33, fmt=fmt))
|
|
1324
|
-
# # print(f'The principal shear axes rotation = {self.phi_psa:{fmt}}')
|
|
1325
|
-
# print('The principal shear axes rotation = {:{fmt}}'.format(self.phi_psa, fmt=fmt))
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
# def get(self, name):
|
|
1329
|
-
# """Get beam properties using specific names.
|
|
1330
|
-
|
|
1331
|
-
# Parameters
|
|
1332
|
-
# ----------
|
|
1333
|
-
# name : str
|
|
1334
|
-
# Name of the property that will be returned.
|
|
1335
|
-
|
|
1336
|
-
# Returns
|
|
1337
|
-
# -------
|
|
1338
|
-
# float:
|
|
1339
|
-
# Value of the specified beam property.
|
|
1340
|
-
|
|
1341
|
-
# Notes
|
|
1342
|
-
# -----
|
|
1343
|
-
|
|
1344
|
-
# .. list-table:: Inertial properties
|
|
1345
|
-
# :header-rows: 1
|
|
1346
|
-
|
|
1347
|
-
# * - Name
|
|
1348
|
-
# - Description
|
|
1349
|
-
# * - ``msijo`` (``i``, ``j`` are numbers 1 to 6)
|
|
1350
|
-
# - Entry (i, j) of the 6x6 mass matrix at the origin
|
|
1351
|
-
# * - ``msijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1352
|
-
# - Entry (i, j) of the 6x6 mass matrix at the mass center
|
|
1353
|
-
# * - ``mu``
|
|
1354
|
-
# - Mass per unit length
|
|
1355
|
-
# * - ``mmoi1`` | ``mmoi2`` | ``mmoi3``
|
|
1356
|
-
# - Mass moment of inertia about x1/x2/x3 axis
|
|
1357
|
-
|
|
1358
|
-
# .. list-table:: Stiffness properties
|
|
1359
|
-
# :header-rows: 1
|
|
1360
|
-
|
|
1361
|
-
# * - Name
|
|
1362
|
-
# - Description
|
|
1363
|
-
# * - ``stfijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1364
|
-
# - Entry (i, j) of the 4x4 classical stiffness matrix
|
|
1365
|
-
# * - ``stfijr`` (``i``, ``j`` are numbers 1 to 6)
|
|
1366
|
-
# - Entry (i, j) of the 6x6 refined stiffness matrix
|
|
1367
|
-
# * - ``eac`` | ``ear``
|
|
1368
|
-
# - Axial stiffness of the classical/refined model
|
|
1369
|
-
# * - ``gjc`` | ``gjr``
|
|
1370
|
-
# - Torsional stiffness of the classical/refined model
|
|
1371
|
-
# * - ``ei2c`` | ``eifc`` | ``ei2r`` | ``eifr``
|
|
1372
|
-
# - Bending stiffness around x2 (flapwise) of the classical/refined model
|
|
1373
|
-
# * - ``ei3c`` | ``eicc`` | ``ei3r`` | ``eicr``
|
|
1374
|
-
# - Bending stiffness around x3 (chordwise or lead-lag) of the classical/refined model
|
|
1375
|
-
# * - ``cmpijc`` (``i``, ``j`` are numbers 1 to 6)
|
|
1376
|
-
# - Entry (i, j) of the 4x4 classical compliance matrix
|
|
1377
|
-
# * - ``cmpijr`` (``i``, ``j`` are numbers 1 to 6)
|
|
1378
|
-
# - Entry (i, j) of the 6x6 refined compliance matrix
|
|
1379
|
-
|
|
1380
|
-
# .. list-table:: Center offsets
|
|
1381
|
-
# :header-rows: 1
|
|
1382
|
-
|
|
1383
|
-
# * - Name
|
|
1384
|
-
# - Description
|
|
1385
|
-
# * - ``mcy`` | ``mc2``
|
|
1386
|
-
# - y (or x2) component of the mass center
|
|
1387
|
-
# * - ``mcz`` | ``mc3``
|
|
1388
|
-
# - z (or x3) component of the mass center
|
|
1389
|
-
# * - ``tcy`` | ``tc2``
|
|
1390
|
-
# - y (or x2) component of the tension center
|
|
1391
|
-
# * - ``tcz`` | ``tc3``
|
|
1392
|
-
# - z (or x3) component of the tension center
|
|
1393
|
-
# * - ``scy`` | ``sc2``
|
|
1394
|
-
# - y (or x2) component of the shear center
|
|
1395
|
-
# * - ``scz`` | ``sc3``
|
|
1396
|
-
# - z (or x3) component of the shear center
|
|
1397
|
-
|
|
1398
|
-
# .
|
|
1399
|
-
|
|
1400
|
-
# """
|
|
1401
|
-
|
|
1402
|
-
# # mm = self.mass_origin
|
|
1403
|
-
# # stf_c = self.stiffness
|
|
1404
|
-
# # cmp_c = self.compliance
|
|
1405
|
-
# # stf_r = self.stiffness_refined
|
|
1406
|
-
# # cmp_r = self.compliance_refined
|
|
1407
|
-
|
|
1408
|
-
# # if type(center).__name__ == 'str':
|
|
1409
|
-
# # if center == 'tc':
|
|
1410
|
-
# # mm, stf_c, cmp_c, stf_r, cmp_r = calcOffsetBeamProperty(self.tension_center[1], self.tension_center[2])
|
|
1411
|
-
# # elif center == 'sc':
|
|
1412
|
-
# # mm, stf_c, cmp_c, stf_r, cmp_r = calcOffsetBeamProperty(self.shear_center[1], self.shear_center[2])
|
|
1413
|
-
# # elif center == 'mc':
|
|
1414
|
-
# # mm, stf_c, cmp_c, stf_r, cmp_r = calcOffsetBeamProperty(self.mass_center[1], self.mass_center[2])
|
|
1415
|
-
|
|
1416
|
-
# if isinstance(name, str):
|
|
1417
|
-
# name = name.lower()
|
|
1418
|
-
|
|
1419
|
-
# # Mass
|
|
1420
|
-
# if name.startswith('ms'):
|
|
1421
|
-
# return self.mass[int(name[2])-1][int(name[3])-1]
|
|
1422
|
-
# if name == 'mu':
|
|
1423
|
-
# return self.mu
|
|
1424
|
-
# if name == 'mmoi1':
|
|
1425
|
-
# return self.i11
|
|
1426
|
-
# if name == 'mmoi2':
|
|
1427
|
-
# return self.i22
|
|
1428
|
-
# if name == 'mmoi3':
|
|
1429
|
-
# return self.i33
|
|
1430
|
-
|
|
1431
|
-
# # Stiffness
|
|
1432
|
-
# if name.startswith('stf'):
|
|
1433
|
-
# if name[-1] == 'c':
|
|
1434
|
-
# return self.stff[int(name[3])-1][int(name[4])-1]
|
|
1435
|
-
# elif name[-1] == 'r':
|
|
1436
|
-
# return self.stff_t[int(name[3])-1][int(name[4])-1]
|
|
1437
|
-
|
|
1438
|
-
# # Compliance
|
|
1439
|
-
# if name.startswith('cmp'):
|
|
1440
|
-
# if name[-1] == 'c':
|
|
1441
|
-
# return self.cmpl[int(name[3])-1][int(name[4])-1]
|
|
1442
|
-
# elif name[-1] == 'r':
|
|
1443
|
-
# return self.cmpl_t[int(name[3])-1][int(name[4])-1]
|
|
1444
|
-
|
|
1445
|
-
# if name == 'ea':
|
|
1446
|
-
# return self.ea
|
|
1447
|
-
# if name in ['ga22', 'gayy', 'ga2', 'gay']:
|
|
1448
|
-
# return self.ga22
|
|
1449
|
-
# if name in ['ga33', 'gazz', 'ga3', 'gaz']:
|
|
1450
|
-
# return self.ga33
|
|
1451
|
-
# if name == 'gj':
|
|
1452
|
-
# return self.gj
|
|
1453
|
-
# if name in ['ei22', 'eiyy', 'ei2', 'eiy']:
|
|
1454
|
-
# return self.ei22
|
|
1455
|
-
# if name in ['ei33', 'eizz', 'ei3', 'eiz']:
|
|
1456
|
-
# return self.ei33
|
|
1457
|
-
|
|
1458
|
-
# # Various centers
|
|
1459
|
-
# if name == 'mcy' or name == 'mc2':
|
|
1460
|
-
# return self.xm2
|
|
1461
|
-
# if name == 'mcz' or name == 'mc3':
|
|
1462
|
-
# return self.xm3
|
|
1463
|
-
# if name == 'tcy' or name == 'tc2':
|
|
1464
|
-
# return self.xt2
|
|
1465
|
-
# if name == 'tcz' or name == 'tc3':
|
|
1466
|
-
# return self.xt3
|
|
1467
|
-
# if name == 'scy' or name == 'sc2':
|
|
1468
|
-
# return self.xs2
|
|
1469
|
-
# if name == 'scz' or name == 'sc3':
|
|
1470
|
-
# return self.xs3
|
|
1471
|
-
|
|
1472
|
-
# elif isinstance(name, list) or isinstance(name, tuple):
|
|
1473
|
-
# props = []
|
|
1474
|
-
# for n in name:
|
|
1475
|
-
# props.append(self.get(n))
|
|
1476
|
-
# return props
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
# def getAll(self):
|
|
1480
|
-
# """Get all beam properties.
|
|
1481
|
-
|
|
1482
|
-
# Returns
|
|
1483
|
-
# -------
|
|
1484
|
-
# dict:
|
|
1485
|
-
# A Dictionary of all beam properties.
|
|
1486
|
-
|
|
1487
|
-
# Notes
|
|
1488
|
-
# -----
|
|
1489
|
-
|
|
1490
|
-
# Names are
|
|
1491
|
-
|
|
1492
|
-
# - mu, mmoi1, mmoi2, mmoi3
|
|
1493
|
-
# - ea, ga22, ga33, gj, ei22, ei33
|
|
1494
|
-
# - mc2, mc3, tc2, tc3, sc2, sc3
|
|
1495
|
-
# - msij, stfijc, cmpijc, stfijr, cmpijr
|
|
1496
|
-
|
|
1497
|
-
# """
|
|
1498
|
-
# names = [
|
|
1499
|
-
# 'mu', 'mmoi1', 'mmoi2', 'mmoi3',
|
|
1500
|
-
# 'ea', 'ga22', 'ga33', 'gj', 'ei22', 'ei33',
|
|
1501
|
-
# 'mc2', 'mc3', 'tc2', 'tc3', 'sc2', 'sc3'
|
|
1502
|
-
# ]
|
|
1503
|
-
# for i in range(4):
|
|
1504
|
-
# for j in range(4):
|
|
1505
|
-
# names.append('stf{}{}c'.format(i+1, j+1))
|
|
1506
|
-
# names.append('cmp{}{}c'.format(i+1, j+1))
|
|
1507
|
-
# for i in range(6):
|
|
1508
|
-
# for j in range(6):
|
|
1509
|
-
# names.append('ms{}{}'.format(i+1, j+1))
|
|
1510
|
-
# names.append('stf{}{}r'.format(i+1, j+1))
|
|
1511
|
-
# names.append('cmp{}{}r'.format(i+1, j+1))
|
|
1512
|
-
|
|
1513
|
-
# dict_prop = {}
|
|
1514
|
-
# for n in names:
|
|
1515
|
-
# dict_prop[n] = self.get(n)
|
|
1516
|
-
|
|
1517
|
-
# return dict_prop
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
# def calcPropertyAt(self, new_origin):
|
|
1521
|
-
# """Offset the beam reference center and recalculate beam properties.
|
|
1522
|
-
|
|
1523
|
-
# Parameters
|
|
1524
|
-
# ----------
|
|
1525
|
-
# offset_x2 : float
|
|
1526
|
-
# x2 of the offset of the new center with respect to the current one.
|
|
1527
|
-
# offset_x3 : float
|
|
1528
|
-
# x3 of the offset of the new center with respect to the current one.
|
|
1529
|
-
|
|
1530
|
-
# """
|
|
1531
|
-
|
|
1532
|
-
# bp_new = copy.copy(self)
|
|
1533
|
-
|
|
1534
|
-
# # offset = [0.0, offset[0], offset[1]]
|
|
1535
|
-
# if isinstance(new_origin, str):
|
|
1536
|
-
# if new_origin == 'gc':
|
|
1537
|
-
# offset_x2 = self.xg2
|
|
1538
|
-
# offset_x3 = self.xg3
|
|
1539
|
-
# elif new_origin == 'mc':
|
|
1540
|
-
# offset_x2 = self.xm2
|
|
1541
|
-
# offset_x3 = self.xm3
|
|
1542
|
-
# elif new_origin == 'tc':
|
|
1543
|
-
# offset_x2 = self.xt2
|
|
1544
|
-
# offset_x3 = self.xt3
|
|
1545
|
-
# elif new_origin == 'sc':
|
|
1546
|
-
# offset_x2 = self.xs2
|
|
1547
|
-
# offset_x3 = self.xs3
|
|
1548
|
-
# else:
|
|
1549
|
-
# offset_x2 = new_origin[0]
|
|
1550
|
-
# offset_x3 = new_origin[1]
|
|
1551
|
-
|
|
1552
|
-
# bp_new.xg2 -= offset_x2
|
|
1553
|
-
# bp_new.xg3 -= offset_x3
|
|
1554
|
-
|
|
1555
|
-
# # Offset mass matrix
|
|
1556
|
-
# mm_o = np.asarray(self.mass_cs)
|
|
1557
|
-
# if (offset_x2 != self.xm2) or (offset_x3 != self.xm3):
|
|
1558
|
-
# # mm_c = np.asarray(self.mass_mc)
|
|
1559
|
-
# mu = mm_o[0, 0]
|
|
1560
|
-
# mi_c = mm_o[3:, 3:]
|
|
1561
|
-
|
|
1562
|
-
# x2 = self.xm2 - offset_x2
|
|
1563
|
-
# x3 = self.xm3 - offset_x3
|
|
1564
|
-
# r_tilde = np.array([
|
|
1565
|
-
# [0, -x3, x2],
|
|
1566
|
-
# [x3, 0, 0],
|
|
1567
|
-
# [-x2, 0, 0]
|
|
1568
|
-
# ])
|
|
1569
|
-
|
|
1570
|
-
# mm_o[:3, 3:] = mu * r_tilde.T
|
|
1571
|
-
# mm_o[3:, :3] = mu * r_tilde
|
|
1572
|
-
|
|
1573
|
-
# # I_o = I_c + m * r_tilde.r_tilde^T
|
|
1574
|
-
# mm_o[3:, 3:] = mm_o[3:, 3:] + mu * np.dot(r_tilde, r_tilde.T)
|
|
1575
|
-
# bp_new.mass = mm_o
|
|
1576
|
-
# bp_new.xm2 -= offset_x2
|
|
1577
|
-
# bp_new.xm3 -= offset_x3
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
# # Offset stiffness and compliance
|
|
1581
|
-
# trfm_4 = np.eye(4)
|
|
1582
|
-
# trfm_6 = np.eye(6)
|
|
1583
|
-
|
|
1584
|
-
# trfm_4[2, 0] = offset_x3
|
|
1585
|
-
# trfm_4[3, 0] = -offset_x2
|
|
1586
|
-
|
|
1587
|
-
# trfm_6[4, 0] = offset_x3
|
|
1588
|
-
# trfm_6[5, 0] = -offset_x2
|
|
1589
|
-
# trfm_6[3, 1] = -offset_x3
|
|
1590
|
-
# trfm_6[3, 2] = offset_x2
|
|
1591
|
-
|
|
1592
|
-
# cmp_4 = np.asarray(self.cmpl)
|
|
1593
|
-
# cmp_6 = np.asarray(self.cmpl_t)
|
|
1594
|
-
|
|
1595
|
-
# bp_new.cmpl = np.dot(trfm_4.T, np.dot(cmp_4, trfm_4))
|
|
1596
|
-
# bp_new.cmpl_t = np.dot(trfm_6.T, np.dot(cmp_6, trfm_6))
|
|
1597
|
-
|
|
1598
|
-
# bp_new.stff = np.linalg.inv(bp_new.cmpl)
|
|
1599
|
-
# bp_new.stff_t = np.linalg.inv(bp_new.cmpl_t)
|
|
1600
|
-
|
|
1601
|
-
# bp_new.xt2 -= offset_x2
|
|
1602
|
-
# bp_new.xt3 -= offset_x3
|
|
1603
|
-
|
|
1604
|
-
# bp_new.xs2 -= offset_x2
|
|
1605
|
-
# bp_new.xs3 -= offset_x3
|
|
1606
|
-
|
|
1607
|
-
# return bp_new
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
# def writeToFile(self, fn, fmt='vabs'):
|
|
1611
|
-
# with open(fn, 'w') as fo:
|
|
1612
|
-
# if fmt.startswith('v'):
|
|
1613
|
-
# self.writeToFileVABS(fo)
|
|
1614
|
-
|
|
1615
|
-
# return
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
# def writeToFileVABS(self, fo):
|
|
1619
|
-
# fmt_float = '20.10E'
|
|
1620
|
-
|
|
1621
|
-
# fo.write('\n The 6X6 Mass Matrix\n')
|
|
1622
|
-
# fo.write(' '+'='*56)
|
|
1623
|
-
# fo.write('\n\n')
|
|
1624
|
-
# utio.writeFormatFloatsMatrix(fo, self.mass, fmt=fmt_float, indent=1)
|
|
1625
|
-
|
|
1626
|
-
# fo.write('\n The Mass Center of the Cross Section\n')
|
|
1627
|
-
# fo.write(' '+'='*56)
|
|
1628
|
-
# fo.write('\n\n')
|
|
1629
|
-
# utio.writeFormatFloats(fo, (self.xm2, self.xm3), fmt=fmt_float, indent=1)
|
|
1630
|
-
|
|
1631
|
-
# fo.write('\n The 6X6 Mass Matrix at the Mass Center\n')
|
|
1632
|
-
# fo.write(' '+'='*56)
|
|
1633
|
-
# fo.write('\n\n')
|
|
1634
|
-
# utio.writeFormatFloatsMatrix(fo, self.mass_cs, fmt='20.12E', indent=1)
|
|
1635
|
-
|
|
1636
|
-
# fo.write('\n The Mass Properties with respect to Principal Inertial Axes\n')
|
|
1637
|
-
# fo.write(' '+'='*56)
|
|
1638
|
-
# fo.write('\n\n')
|
|
1639
|
-
# fo.write(' {:39s}={:20.10E}\n'.format('Mass per unit span', self.mu))
|
|
1640
|
-
# fo.write(' {:39s}={:20.10E}\n'.format('Mass moment of inertia i11', self.i11))
|
|
1641
|
-
# fo.write(' {:39s}={:20.10E}\n'.format('Principal mass moments of inertia i22', self.i22))
|
|
1642
|
-
# fo.write(' {:39s}={:20.10E}\n'.format('Principal mass moments of inertia i33', self.i33))
|
|
1643
|
-
# fo.write(' The principal inertial axes rotated from user coordinate system by {} degrees about the positive direction of x1 axis.\n'.format(self.phi_pia))
|
|
1644
|
-
# fo.write(' {:39s}={:20.10E}\n'.format('The mass-weighted radius of gyration', self.rg))
|
|
1645
|
-
|
|
1646
|
-
# fo.write('\n The Geometric Center of the Cross Section\n')
|
|
1647
|
-
# fo.write(' '+'='*56)
|
|
1648
|
-
# fo.write('\n\n')
|
|
1649
|
-
# utio.writeFormatFloats(fo, (self.xg2, self.xg3), fmt=fmt_float, indent=1)
|
|
1650
|
-
|
|
1651
|
-
# fo.write('\n The Area of the Cross Section\n')
|
|
1652
|
-
# fo.write(' '+'='*56)
|
|
1653
|
-
# fo.write('\n\n')
|
|
1654
|
-
# fo.write(' Area ={:20.10E}\n'.format(self.area))
|
|
1655
|
-
|
|
1656
|
-
# fo.write('\n Classical Stiffness Matrix (1-extension; 2-twist; 3,4-bending)\n')
|
|
1657
|
-
# fo.write(' '+'='*56)
|
|
1658
|
-
# fo.write('\n\n')
|
|
1659
|
-
# utio.writeFormatFloatsMatrix(fo, self.stff, fmt='20.10E', indent=1)
|
|
1660
|
-
|
|
1661
|
-
# fo.write('\n Classical Compliance Matrix (1-extension; 2-twist; 3,4-bending)\n')
|
|
1662
|
-
# fo.write(' '+'='*56)
|
|
1663
|
-
# fo.write('\n\n')
|
|
1664
|
-
# utio.writeFormatFloatsMatrix(fo, self.cmpl, fmt='20.10E', indent=1)
|
|
1665
|
-
|
|
1666
|
-
# fo.write('\n The Tension Center of the Cross Section\n')
|
|
1667
|
-
# fo.write(' '+'='*56)
|
|
1668
|
-
# fo.write('\n\n')
|
|
1669
|
-
# utio.writeFormatFloats(fo, (self.xt2, self.xt3), fmt=fmt_float, indent=1)
|
|
1670
|
-
|
|
1671
|
-
# fo.write('\n')
|
|
1672
|
-
# fo.write(' {:34s}={:20.10E}\n'.format('The extension stiffness EA', self.ea))
|
|
1673
|
-
# fo.write(' {:34s}={:20.10E}\n'.format('The torsional stiffness GJ', self.gj))
|
|
1674
|
-
# fo.write(' {:34s}={:20.10E}\n'.format('Principal bending stiffness EI22', self.ei22))
|
|
1675
|
-
# fo.write(' {:34s}={:20.10E}\n'.format('Principal bending stiffness EI33', self.ei33))
|
|
1676
|
-
# fo.write(' The principal bending axes rotated from the user coordinate system by {} degrees about the positive direction of x1 axis.\n'.format(self.phi_pba))
|
|
1677
|
-
|
|
1678
|
-
# fo.write('\n Timoshenko Stiffness Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)\n')
|
|
1679
|
-
# fo.write(' '+'='*56)
|
|
1680
|
-
# fo.write('\n\n')
|
|
1681
|
-
# utio.writeFormatFloatsMatrix(fo, self.stff_t, fmt=fmt_float, indent=1)
|
|
1682
|
-
|
|
1683
|
-
# fo.write('\n Timoshenko Compliance Matrix (1-extension; 2,3-shear, 4-twist; 5,6-bending)\n')
|
|
1684
|
-
# fo.write(' '+'='*56)
|
|
1685
|
-
# fo.write('\n\n')
|
|
1686
|
-
# utio.writeFormatFloatsMatrix(fo, self.cmpl_t, fmt=fmt_float, indent=1)
|
|
1687
|
-
|
|
1688
|
-
# fo.write('\n The Shear Center of the Cross Section in the User Coordinate System\n')
|
|
1689
|
-
# fo.write(' '+'='*56)
|
|
1690
|
-
# fo.write('\n\n')
|
|
1691
|
-
# utio.writeFormatFloats(fo, (self.xs2, self.xs3), fmt=fmt_float, indent=1)
|
|
1692
|
-
|
|
1693
|
-
# fo.write('\n')
|
|
1694
|
-
# fo.write(' {:31s}={:20.10E}\n'.format('Principal shear stiffness GA22', self.ga22))
|
|
1695
|
-
# fo.write(' {:31s}={:20.10E}\n'.format('Principal shear stiffness GA33', self.ga33))
|
|
1696
|
-
# fo.write(' The principal shear axes rotated from user coordinate system by {} degrees about the positive direction of x1 axis.\n'.format(self.phi_psa))
|
|
1697
|
-
|
|
1698
|
-
# return
|