FEM-Design 0.0.2__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 StruSoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.1
2
+ Name: FEM-Design
3
+ Version: 0.0.2
4
+ Summary: The FEM-Design API package
5
+ Author-email: FEM-Design <femdesign.api@strusoft.com>
6
+ Maintainer-email: Marco Pellegrino <marco.pellegrino@strusoft.com>
7
+ Project-URL: Homepage, https://femdesign-api-docs.onstrusoft.com
8
+ Project-URL: Repository, https://github.com/strusoft/femdesign-api
9
+ Project-URL: Issues, https://github.com/strusoft/femdesign-api/issues
10
+ Keywords: fem,fea,structures,strusoft,FEM-Design API
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: Microsoft
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+
18
+
19
+
20
+ <a href="https://strusoft.com/software/3d-structural-analysis-software-fem-design/" target="_blank">
21
+ <p align="center">
22
+ <img src="https://raw.githubusercontent.com/strusoft/femdesign-api/refs/heads/master/FemDesign.Core/Resources/icons/FemDesignAPI.png" alt="isolated" width="200" style="centre"/>
23
+ </p>
24
+ </a>
25
+
26
+ # Description
27
+
28
+ FEM-Design is an advanced and intuitive structural analysis software. We support all aspects of your structural engineering requirements: from 3D modelling, design and finite element analysis (FEA) of concrete, steel, timber, composite, masonry and foundation structures. All calculations are performed to Eurocode standards, with some specific National annexes.
29
+
30
+ The quick and easy nature of FEM-Design makes it an ideal choice for all types of construction tasks, from single element design to global stability analysis of large buildings, making it the best practical program for structural engineers to use for their day to day tasks.
31
+
32
+
33
+ ## Scope
34
+
35
+ The python package is mainly focus on [`fdscript`](https://femdesign-api-docs.onstrusoft.com/docs/advanced/fdscript) automation which will help you in automatise processes as running analysis, design and read results.
36
+
37
+ The construction of the `Database` object is currently out of scope as it is delegated to the users. `Database` is based on `xml` sintax and you can use library such as `xml.etree.ElementTree` to manipulate the file.
38
+
39
+ ## Example
40
+
41
+ ```python
42
+ from femdesign.comunication import FemDesignConnection, Verbosity
43
+ from femdesign.calculate.command import DesignModule
44
+ from femdesign.calculate.analysis import Analysis, Design, CombSettings, CombItem
45
+
46
+
47
+ pipe = FemDesignConnection()
48
+ try:
49
+ pipe.SetVerbosity(Verbosity.SCRIPT_LOG_LINES)
50
+ pipe.Open(r"example/simple_beam.str")
51
+ pipe.RunAnalysis(Analysis.FrequencyAnalysis(num_shapes=5))
52
+ pipe.Save(r"example\to_delete\simple_beam_out_2.str")
53
+ pipe.GenerateListTables(bsc_file=r"example\bsc\quantity-estimation-steel.bsc",
54
+ csv_file=r"example\output\quantity-estimation-steel.csv")
55
+ pipe.Exit()
56
+ except Exception as err:
57
+ pipe.KillProgramIfExists()
58
+ raise err
59
+ ```
60
+
61
+ A wider list of examples can be found in [example](https://github.com/strusoft/femdesign-api/tree/master/FemDesign.Python/examples)
62
+
63
+ ## Documentation
64
+
65
+
66
+ https://femdesign-api-docs.onstrusoft.com/docs/intro
@@ -0,0 +1,49 @@
1
+
2
+
3
+ <a href="https://strusoft.com/software/3d-structural-analysis-software-fem-design/" target="_blank">
4
+ <p align="center">
5
+ <img src="https://raw.githubusercontent.com/strusoft/femdesign-api/refs/heads/master/FemDesign.Core/Resources/icons/FemDesignAPI.png" alt="isolated" width="200" style="centre"/>
6
+ </p>
7
+ </a>
8
+
9
+ # Description
10
+
11
+ FEM-Design is an advanced and intuitive structural analysis software. We support all aspects of your structural engineering requirements: from 3D modelling, design and finite element analysis (FEA) of concrete, steel, timber, composite, masonry and foundation structures. All calculations are performed to Eurocode standards, with some specific National annexes.
12
+
13
+ The quick and easy nature of FEM-Design makes it an ideal choice for all types of construction tasks, from single element design to global stability analysis of large buildings, making it the best practical program for structural engineers to use for their day to day tasks.
14
+
15
+
16
+ ## Scope
17
+
18
+ The python package is mainly focus on [`fdscript`](https://femdesign-api-docs.onstrusoft.com/docs/advanced/fdscript) automation which will help you in automatise processes as running analysis, design and read results.
19
+
20
+ The construction of the `Database` object is currently out of scope as it is delegated to the users. `Database` is based on `xml` sintax and you can use library such as `xml.etree.ElementTree` to manipulate the file.
21
+
22
+ ## Example
23
+
24
+ ```python
25
+ from femdesign.comunication import FemDesignConnection, Verbosity
26
+ from femdesign.calculate.command import DesignModule
27
+ from femdesign.calculate.analysis import Analysis, Design, CombSettings, CombItem
28
+
29
+
30
+ pipe = FemDesignConnection()
31
+ try:
32
+ pipe.SetVerbosity(Verbosity.SCRIPT_LOG_LINES)
33
+ pipe.Open(r"example/simple_beam.str")
34
+ pipe.RunAnalysis(Analysis.FrequencyAnalysis(num_shapes=5))
35
+ pipe.Save(r"example\to_delete\simple_beam_out_2.str")
36
+ pipe.GenerateListTables(bsc_file=r"example\bsc\quantity-estimation-steel.bsc",
37
+ csv_file=r"example\output\quantity-estimation-steel.csv")
38
+ pipe.Exit()
39
+ except Exception as err:
40
+ pipe.KillProgramIfExists()
41
+ raise err
42
+ ```
43
+
44
+ A wider list of examples can be found in [example](https://github.com/strusoft/femdesign-api/tree/master/FemDesign.Python/examples)
45
+
46
+ ## Documentation
47
+
48
+
49
+ https://femdesign-api-docs.onstrusoft.com/docs/intro
@@ -0,0 +1,23 @@
1
+ [project]
2
+ name = "FEM-Design"
3
+ version = "0.0.2"
4
+ authors = [
5
+ { name="FEM-Design", email="femdesign.api@strusoft.com" },
6
+ ]
7
+ maintainers = [
8
+ {name = "Marco Pellegrino", email = "marco.pellegrino@strusoft.com"}
9
+ ]
10
+ description = "The FEM-Design API package"
11
+ readme = "README.md"
12
+ requires-python = ">=3.8"
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: Microsoft",
17
+ ]
18
+ keywords = ["fem", "fea", "structures", "strusoft", "FEM-Design API"]
19
+
20
+ [project.urls]
21
+ Homepage = "https://femdesign-api-docs.onstrusoft.com"
22
+ Repository = "https://github.com/strusoft/femdesign-api"
23
+ Issues = "https://github.com/strusoft/femdesign-api/issues"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.1
2
+ Name: FEM-Design
3
+ Version: 0.0.2
4
+ Summary: The FEM-Design API package
5
+ Author-email: FEM-Design <femdesign.api@strusoft.com>
6
+ Maintainer-email: Marco Pellegrino <marco.pellegrino@strusoft.com>
7
+ Project-URL: Homepage, https://femdesign-api-docs.onstrusoft.com
8
+ Project-URL: Repository, https://github.com/strusoft/femdesign-api
9
+ Project-URL: Issues, https://github.com/strusoft/femdesign-api/issues
10
+ Keywords: fem,fea,structures,strusoft,FEM-Design API
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: Microsoft
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+
18
+
19
+
20
+ <a href="https://strusoft.com/software/3d-structural-analysis-software-fem-design/" target="_blank">
21
+ <p align="center">
22
+ <img src="https://raw.githubusercontent.com/strusoft/femdesign-api/refs/heads/master/FemDesign.Core/Resources/icons/FemDesignAPI.png" alt="isolated" width="200" style="centre"/>
23
+ </p>
24
+ </a>
25
+
26
+ # Description
27
+
28
+ FEM-Design is an advanced and intuitive structural analysis software. We support all aspects of your structural engineering requirements: from 3D modelling, design and finite element analysis (FEA) of concrete, steel, timber, composite, masonry and foundation structures. All calculations are performed to Eurocode standards, with some specific National annexes.
29
+
30
+ The quick and easy nature of FEM-Design makes it an ideal choice for all types of construction tasks, from single element design to global stability analysis of large buildings, making it the best practical program for structural engineers to use for their day to day tasks.
31
+
32
+
33
+ ## Scope
34
+
35
+ The python package is mainly focus on [`fdscript`](https://femdesign-api-docs.onstrusoft.com/docs/advanced/fdscript) automation which will help you in automatise processes as running analysis, design and read results.
36
+
37
+ The construction of the `Database` object is currently out of scope as it is delegated to the users. `Database` is based on `xml` sintax and you can use library such as `xml.etree.ElementTree` to manipulate the file.
38
+
39
+ ## Example
40
+
41
+ ```python
42
+ from femdesign.comunication import FemDesignConnection, Verbosity
43
+ from femdesign.calculate.command import DesignModule
44
+ from femdesign.calculate.analysis import Analysis, Design, CombSettings, CombItem
45
+
46
+
47
+ pipe = FemDesignConnection()
48
+ try:
49
+ pipe.SetVerbosity(Verbosity.SCRIPT_LOG_LINES)
50
+ pipe.Open(r"example/simple_beam.str")
51
+ pipe.RunAnalysis(Analysis.FrequencyAnalysis(num_shapes=5))
52
+ pipe.Save(r"example\to_delete\simple_beam_out_2.str")
53
+ pipe.GenerateListTables(bsc_file=r"example\bsc\quantity-estimation-steel.bsc",
54
+ csv_file=r"example\output\quantity-estimation-steel.csv")
55
+ pipe.Exit()
56
+ except Exception as err:
57
+ pipe.KillProgramIfExists()
58
+ raise err
59
+ ```
60
+
61
+ A wider list of examples can be found in [example](https://github.com/strusoft/femdesign-api/tree/master/FemDesign.Python/examples)
62
+
63
+ ## Documentation
64
+
65
+
66
+ https://femdesign-api-docs.onstrusoft.com/docs/intro
@@ -0,0 +1,16 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/FEM_Design.egg-info/PKG-INFO
5
+ src/FEM_Design.egg-info/SOURCES.txt
6
+ src/FEM_Design.egg-info/dependency_links.txt
7
+ src/FEM_Design.egg-info/top_level.txt
8
+ src/femdesign/__init__.py
9
+ src/femdesign/comunication.py
10
+ src/femdesign/database.py
11
+ src/femdesign/calculate/__init__.py
12
+ src/femdesign/calculate/analysis.py
13
+ src/femdesign/calculate/command.py
14
+ src/femdesign/calculate/fdscript.py
15
+ src/femdesign/utilities/__init__.py
16
+ src/femdesign/utilities/filehelper.py
@@ -0,0 +1 @@
1
+ femdesign
File without changes
File without changes
@@ -0,0 +1,418 @@
1
+ from enum import Enum
2
+ import xml.etree.ElementTree as ET
3
+
4
+
5
+
6
+ class Stage:
7
+ """
8
+ Class to represent a stage in FEM-Design
9
+ """
10
+ class Method(Enum):
11
+ """
12
+ Enum to represent the calculation method of the construction stage
13
+ """
14
+ TRACKING = 0
15
+ GHOST = 1
16
+
17
+ def __init__(self, method : Method = Method.TRACKING, tda : bool = True, creepincrementlimit = 25.0):
18
+ self.method = method.value
19
+ self.tda = tda
20
+ self.creepincrementlimit = creepincrementlimit
21
+
22
+ def to_xml_element(self) -> ET.Element:
23
+ """Convert the Stage object to an xml element
24
+
25
+ Returns:
26
+ ET.Element: xml element representing the Stage object
27
+ """
28
+ stage = ET.Element("stage")
29
+ stage.attrib = {
30
+ "ghost": str(self.method.value),
31
+ "tda": str(int(self.tda)),
32
+ "creepincrementlimit": str(self.creepincrementlimit)
33
+ }
34
+ return stage
35
+
36
+
37
+ class CombItem:
38
+ def __init__(self, Calc : bool = True, NLE : bool = False, PL : bool = False, NLS : bool = False, Cr : bool = False, f2nd : bool = False, Im : float = 0, Amplitudo : float = 1.0, Waterlevel : float = 0, ImpfRqd = 0, StabRqd = 0):
39
+ self.Calc = Calc
40
+ self.NLE = NLE
41
+ self.PL = PL
42
+ self.NLS = NLS
43
+ self.Cr = Cr
44
+ self.f2nd = f2nd
45
+ self.Im = Im
46
+ self.Amplitudo = Amplitudo
47
+ self.Waterlevel = Waterlevel
48
+
49
+ self.ImpfRqd = ImpfRqd
50
+ self.StabRqd = StabRqd
51
+
52
+
53
+ @classmethod
54
+ def StaticAnalysis(cls, Calc : bool = True, NLE : bool = False, PL : bool = False):
55
+ return cls(Calc = Calc, NLE = NLE, PL = PL)
56
+
57
+ @classmethod
58
+ def NoCalculation(cls):
59
+ return cls(Calc = False)
60
+
61
+ def to_xml_element(self):
62
+ comb_item = ET.Element("combitem")
63
+ comb_item.attrib = {
64
+ "Calc": str(int(self.Calc)),
65
+ "NLE": str(int(self.NLE)),
66
+ "PL": str(int(self.PL)),
67
+ "NLS": str(int(self.NLS)),
68
+ "Cr": str(int(self.Cr)),
69
+ "f2nd": str(int(self.f2nd)),
70
+ "Im": str(self.Im),
71
+ "Amplitudo": str(self.Amplitudo),
72
+ "Waterlevel": str(self.Waterlevel),
73
+
74
+ "ImpfRqd": str(self.ImpfRqd),
75
+ "StabRqd": str(self.StabRqd),
76
+ }
77
+ return comb_item
78
+
79
+
80
+ class CombSettings:
81
+ def __init__(self, NLEmaxiter : int = 30, PLdefloadstep : int = 20, PLminloadstep : int = 2, PLmaxeqiter : int = 30, PlKeepLoadStep : bool = True, PlTolerance : int = 1, PlShellLayers : int = 10, PlShellCalcStr : bool = 1, NLSMohr : bool = True, NLSinitloadstep : int = 10, NLSminloadstep : int = 10, NLSactiveelemratio : int = 5, NLSplasticelemratio : int = 5, CRloadstep : int = 20, CRmaxiter : int = 30, CRstifferror : int = 2, combitems : list[CombItem] = None):
82
+ self.NLEmaxiter = NLEmaxiter
83
+ self.PLdefloadstep = PLdefloadstep
84
+ self.PLminloadstep = PLminloadstep
85
+ self.PLmaxeqiter = PLmaxeqiter
86
+ self.PlKeepLoadStep = PlKeepLoadStep
87
+ self.PlTolerance = PlTolerance
88
+ self.PlShellLayers = PlShellLayers
89
+ self.PlShellCalcStr = PlShellCalcStr
90
+ self.NLSMohr = NLSMohr
91
+ self.NLSinitloadstep = NLSinitloadstep
92
+ self.NLSminloadstep = NLSminloadstep
93
+ self.NLSactiveelemratio = NLSactiveelemratio
94
+ self.NLSplasticelemratio = NLSplasticelemratio
95
+ self.CRloadstep = CRloadstep
96
+ self.CRmaxiter = CRmaxiter
97
+ self.CRstifferror = CRstifferror
98
+ self.combitems = combitems or []
99
+
100
+ @classmethod
101
+ def Default(cls):
102
+ return cls()
103
+
104
+ def to_xml_element(self) -> ET.Element:
105
+ comb = ET.Element("comb")
106
+ comb.attrib = {
107
+ "NLEmaxiter": str(self.NLEmaxiter),
108
+ "PLdefloadstep": str(self.PLdefloadstep),
109
+ "PLminloadstep": str(self.PLminloadstep),
110
+ "PLmaxeqiter": str(self.PLmaxeqiter),
111
+ "PlKeepLoadStep": str(self.PlKeepLoadStep),
112
+ "PlTolerance": str(self.PlTolerance),
113
+ "PlShellLayers": str(self.PlShellLayers),
114
+ "PlShellCalcStr": str(self.PlShellCalcStr),
115
+ "NLSMohr": str(self.NLSMohr),
116
+ "NLSinitloadstep": str(self.NLSinitloadstep),
117
+ "NLSminloadstep": str(self.NLSminloadstep),
118
+ "NLSactiveelemratio": str(self.NLSactiveelemratio),
119
+ "NLSplasticelemratio": str(self.NLSplasticelemratio),
120
+ "CRloadstep": str(self.CRloadstep),
121
+ "CRmaxiter": str(self.CRmaxiter),
122
+ "CRstifferror": str(self.CRstifferror)
123
+ }
124
+
125
+ for combitem in self.combitems:
126
+ comb.append(combitem.to_xml_element())
127
+ return comb
128
+
129
+
130
+
131
+ class Freq:
132
+ """
133
+ Class to represent the frequency analysis settings
134
+ """
135
+ class ShapeNormalization(Enum):
136
+ """
137
+ Enum to represent the normalization unit of the shape
138
+ """
139
+ MassMatrix = 0
140
+ Unit = 1
141
+
142
+ def __init__(self, num_shapes : int = 2, auto_iter : int = 0, max_sturm : int = 0, norm_unit : ShapeNormalization = ShapeNormalization.MassMatrix, x : bool = True, y : bool = True, z : bool = True, top : float = -0.01):
143
+ self.Numshapes = num_shapes
144
+ self.AutoIter = auto_iter
145
+ self.MaxSturm = max_sturm
146
+ self.NormUnit = norm_unit
147
+ self.X = x
148
+ self.Y = y
149
+ self.Z = z
150
+ self.top = top
151
+
152
+ def to_xml_element(self) -> ET.Element:
153
+ """ Convert the Freq object to an xml element
154
+
155
+ Returns:
156
+ ET.Element: xml element representing the Freq object
157
+ """
158
+ freq = ET.Element("freq")
159
+ freq.attrib = {
160
+ "Numshapes": str(self.Numshapes),
161
+ "MaxSturm": str(self.MaxSturm),
162
+ "NormUnit": str(self.NormUnit.value),
163
+ "X": str(int(self.X)),
164
+ "Y": str(int(self.Y)),
165
+ "Z": str(int(self.Z)),
166
+ "top": str(self.top),
167
+ "AutoIter": str(self.AutoIter)
168
+ }
169
+ return freq
170
+
171
+ @classmethod
172
+ def Default(cls, num_shapes = 5, auto_iter = 0, max_sturm = 0, norm_unit = ShapeNormalization.MassMatrix, x = True, y = True, z = True, top = -0.01):
173
+ return cls(num_shapes, auto_iter, max_sturm, norm_unit, x, y, z, top)
174
+
175
+ class Footfall:
176
+ def __init__(self, TopOfSubstructure : float = -0.01):
177
+ self.TopOfSubstructure = TopOfSubstructure
178
+
179
+ def to_xml_element(self):
180
+ footfall = ET.Element("footfall")
181
+ footfall.attrib = {
182
+ "TopOfSubstructure": str(self.TopOfSubstructure)
183
+ }
184
+ return footfall
185
+
186
+
187
+ class ThGroundAcc:
188
+ def __init__(self, flevelspectra=1, dts=0.20, tsend=5.0, q=1.0, facc=1, nres=5, tcend=20.0, method=0, alpha=0.000, beta=0.000, ksi=5.0):
189
+ self.flevelspectra = flevelspectra
190
+ self.dts = dts
191
+ self.tsend = tsend
192
+ self.q = q
193
+ self.facc = facc
194
+ self.nres = nres
195
+ self.tcend = tcend
196
+ self.method = method
197
+ self.alpha = alpha
198
+ self.beta = beta
199
+ self.ksi = ksi
200
+
201
+ def to_xml_element(self):
202
+ thgroundacc = ET.Element("thgroundacc")
203
+ thgroundacc.attrib = {
204
+ "flevelspectra": str(self.flevelspectra),
205
+ "dts": str(self.dts),
206
+ "tsend": str(self.tsend),
207
+ "q": str(self.q),
208
+ "facc": str(self.facc),
209
+ "nres": str(self.nres),
210
+ "tcend": str(self.tcend),
211
+ "method": str(self.method),
212
+ "alpha": str(self.alpha),
213
+ "beta": str(self.beta),
214
+ "ksi": str(self.ksi)
215
+ }
216
+ return thgroundacc
217
+
218
+
219
+ class ThExForce:
220
+ def __init__(self, nres=5, tcend=20.0, method=0, alpha=0.000, beta=0.000, ksi=5.0):
221
+ self.nres = nres
222
+ self.tcend = tcend
223
+ self.method = method
224
+ self.alpha = alpha
225
+ self.beta = beta
226
+ self.ksi = ksi
227
+
228
+ def to_xml_element(self):
229
+ thexforce = ET.Element("thexforce")
230
+ thexforce.attrib = {
231
+ "nres": str(self.nres),
232
+ "tcend": str(self.tcend),
233
+ "method": str(self.method),
234
+ "alpha": str(self.alpha),
235
+ "beta": str(self.beta),
236
+ "ksi": str(self.ksi)
237
+ }
238
+ return thexforce
239
+
240
+
241
+ class PeriodicExc:
242
+ def __init__(self, deltat=0.0100, tend=5.00, dampeningtype=0, alpha=0.000, beta=0.000, ksi=5.0):
243
+ self.deltat = deltat
244
+ self.tend = tend
245
+ self.dampeningtype = dampeningtype
246
+ self.alpha = alpha
247
+ self.beta = beta
248
+ self.ksi = ksi
249
+
250
+ def to_xml_element(self):
251
+ periodicexc = ET.Element("periodicexc")
252
+ periodicexc.attrib = {
253
+ "deltat": str(self.deltat),
254
+ "tend": str(self.tend),
255
+ "dampeningtype": str(self.dampeningtype),
256
+ "alpha": str(self.alpha),
257
+ "beta": str(self.beta),
258
+ "ksi": str(self.ksi)
259
+ }
260
+ return periodicexc
261
+
262
+
263
+ class Design:
264
+ def __init__(self, autodesign : bool = True, check : bool = True, load_combination : bool = True):
265
+ self.autodesign = autodesign
266
+ self.check = check
267
+ self.load_combination = load_combination
268
+
269
+ def to_xml_element(self):
270
+ design = ET.Element("design")
271
+
272
+
273
+ if self.load_combination:
274
+ comb_element = ET.SubElement(design, "cmax")
275
+ else:
276
+ comb_element = ET.SubElement(design, "gmax")
277
+ comb_element.text = ""
278
+
279
+ autodesign_element = ET.SubElement(design, "autodesign")
280
+ autodesign_element.text = str(self.autodesign).lower()
281
+
282
+ check_element = ET.SubElement(design, "check")
283
+ check_element.text = str(self.check).lower()
284
+ return design
285
+
286
+ class Analysis:
287
+ def __init__(self,
288
+ calcCase : bool = False,
289
+ calcComb : bool = False,
290
+ calcGmax : bool = False,
291
+ calcStage : bool = False,
292
+ calcImpf : bool = False,
293
+ calcStab : bool = False,
294
+ calcFreq : bool = False,
295
+ calcSeis : bool = False,
296
+ calcFootfall : bool = False,
297
+ calcMovingLoad : bool = False,
298
+ calcThGrounAcc : bool = False,
299
+ calcThExforce : bool = False,
300
+ calcPeriodicExc : bool = False,
301
+ calcStoreyFreq : bool = False,
302
+ calcBedding : bool = False,
303
+ calcDesign : bool = False,
304
+ elemfine : bool = True,
305
+ diaphragm : bool = False,
306
+ peaksmoothings : bool = False,
307
+ comb : CombSettings = None,
308
+ stage : Stage = None,
309
+ freq : Freq = None,
310
+ footfall : Footfall = None,
311
+ #bedding=None,
312
+ thgroundacc : ThGroundAcc = None,
313
+ thexforce : ThExForce = None,
314
+ periodicexc : PeriodicExc = None):
315
+ self.calcCase = calcCase
316
+ self.calcStage = calcStage
317
+ self.calcImpf = calcImpf
318
+ self.calcComb = calcComb
319
+ self.calcGmax = calcGmax
320
+ self.calcStab = calcStab
321
+ self.calcFreq = calcFreq
322
+ self.calcSeis = calcSeis
323
+ self.calcFootfall = calcFootfall
324
+ self.calcMovingLoad = calcMovingLoad
325
+ self.calcBedding = calcBedding
326
+ self.calcThGrounAcc = calcThGrounAcc
327
+ self.calcThExforce = calcThExforce
328
+ self.calcPeriodicExc = calcPeriodicExc
329
+ self.calcStoreyFreq = calcStoreyFreq
330
+ self.calcDesign = calcDesign
331
+
332
+ self.elemfine = elemfine
333
+ self.diaphragm = diaphragm
334
+ self.peaksmoothings = peaksmoothings
335
+
336
+ self.stage = stage
337
+ self.comb = comb
338
+ self.freq = freq
339
+ self.footfall = footfall
340
+ #self.bedding = bedding
341
+ self.thgroundacc = thgroundacc
342
+ self.thexforce = thexforce
343
+ self.periodicexc = periodicexc
344
+
345
+ def to_xml_element(self):
346
+ analysis = ET.Element("analysis")
347
+
348
+ analysis.attrib = {
349
+ "calcCase": str(int(self.calcCase)),
350
+ "calcComb": str(int(self.calcComb)),
351
+ "calcGmax": str(int(self.calcGmax)),
352
+ "calcStage": str(int(self.calcStage)),
353
+ "calcImpf": str(int(self.calcImpf)),
354
+ "calcStab": str(int(self.calcStab)),
355
+ "calcFreq": str(int(self.calcFreq)),
356
+ "calcSeis": str(int(self.calcSeis)),
357
+ "calcFootfall": str(int(self.calcFootfall)),
358
+ "calcMovingLoad": str(int(self.calcMovingLoad)),
359
+ "calcThGrounAcc": str(int(self.calcThGrounAcc)),
360
+ "calcThExforce": str(int(self.calcThExforce)),
361
+ "calcPeriodicExc": str(int(self.calcPeriodicExc)),
362
+ "calcStoreyFreq": str(int(self.calcStoreyFreq)),
363
+ "calcBedding": str(int(self.calcBedding)),
364
+ "calcDesign": str(int(self.calcDesign)),
365
+
366
+ "elemfine": str(int(self.elemfine)),
367
+ "diaphragm": str(int(self.diaphragm)),
368
+ "peaksmoothings": str(int(self.peaksmoothings))
369
+ }
370
+
371
+ if self.comb:
372
+ analysis.append(self.comb.to_xml_element())
373
+ if self.stage:
374
+ analysis.append(self.stage.to_xml_element())
375
+ if self.freq:
376
+ analysis.append(self.freq.to_xml_element())
377
+ if self.footfall:
378
+ analysis.append(self.footfall.to_xml_element())
379
+ if self.thgroundacc:
380
+ analysis.append(self.thgroundacc.to_xml_element())
381
+ if self.thexforce:
382
+ analysis.append(self.thexforce.to_xml_element())
383
+ if self.periodicexc:
384
+ analysis.append(self.periodicexc.to_xml_element())
385
+ # if self.bedding:
386
+ # analysis.append(self.bedding.to_xml_element())
387
+
388
+ return analysis
389
+
390
+ @classmethod
391
+ def StaticAnalysis(cls, comb : CombSettings = CombSettings.Default(), calcCase : bool = True, calcComb : bool = True):
392
+ return cls(calcCase = calcCase, calcComb = calcComb, comb = comb)
393
+
394
+ @classmethod
395
+ def FrequencyAnalysis(cls, num_shapes : int = 5, auto_iter : int = 0, max_sturm : int = 0, norm_unit : Freq.ShapeNormalization = Freq.ShapeNormalization.MassMatrix, x : bool = True, y : bool = True, z : bool = True, top : bool = -0.01):
396
+ freq = Freq(num_shapes, auto_iter, max_sturm, norm_unit, x, y, z, top)
397
+ return cls(calcFreq = True, freq = freq)
398
+
399
+ @classmethod
400
+ def FootfallAnalysis(cls, footfall : Footfall, calcFootfall : bool = True):
401
+ return cls(calcFootfall = calcFootfall, footfall = footfall)
402
+
403
+ # class Bedding:
404
+ # def __init__(self, Ldcomb="a", Meshprep=0, Stiff_X=0.5, Stiff_Y=0.5):
405
+ # self.Ldcomb = Ldcomb
406
+ # self.Meshprep = Meshprep
407
+ # self.Stiff_X = Stiff_X
408
+ # self.Stiff_Y = Stiff_Y
409
+
410
+ # def to_xml_element(self):
411
+ # bedding = ET.Element("bedding")
412
+ # bedding.attrib = {
413
+ # "Ldcomb": str(self.Ldcomb),
414
+ # "Meshprep": str(self.Meshprep),
415
+ # "Stiff_X": str(self.Stiff_X),
416
+ # "Stiff_Y": str(self.Stiff_Y)
417
+ # }
418
+ # return bedding