PyCBA 0.6.0__tar.gz → 0.8.0__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.
Files changed (34) hide show
  1. {pycba-0.6.0/src/PyCBA.egg-info → pycba-0.8.0}/PKG-INFO +1 -1
  2. {pycba-0.6.0 → pycba-0.8.0/src/PyCBA.egg-info}/PKG-INFO +1 -1
  3. {pycba-0.6.0 → pycba-0.8.0}/src/PyCBA.egg-info/SOURCES.txt +7 -1
  4. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/__init__.py +3 -1
  5. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/analysis.py +80 -10
  6. pycba-0.8.0/src/pycba/beam.py +856 -0
  7. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/bridge.py +31 -5
  8. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/inf_lines.py +11 -7
  9. pycba-0.8.0/src/pycba/load.py +1186 -0
  10. pycba-0.8.0/src/pycba/nonlinear.py +913 -0
  11. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/results.py +186 -48
  12. pycba-0.8.0/src/pycba/section.py +525 -0
  13. {pycba-0.6.0 → pycba-0.8.0}/tests/test_basic.py +305 -6
  14. pycba-0.8.0/tests/test_bridge.py +274 -0
  15. {pycba-0.6.0 → pycba-0.8.0}/tests/test_inf_lines.py +27 -0
  16. pycba-0.8.0/tests/test_moving_load.py +82 -0
  17. pycba-0.8.0/tests/test_nonlinear.py +302 -0
  18. pycba-0.8.0/tests/test_nonprismatic.py +619 -0
  19. pycba-0.8.0/tests/test_results.py +83 -0
  20. pycba-0.6.0/src/pycba/beam.py +0 -498
  21. pycba-0.6.0/src/pycba/load.py +0 -716
  22. pycba-0.6.0/tests/test_bridge.py +0 -102
  23. {pycba-0.6.0 → pycba-0.8.0}/LICENSE +0 -0
  24. {pycba-0.6.0 → pycba-0.8.0}/README.md +0 -0
  25. {pycba-0.6.0 → pycba-0.8.0}/pyproject.toml +0 -0
  26. {pycba-0.6.0 → pycba-0.8.0}/setup.cfg +0 -0
  27. {pycba-0.6.0 → pycba-0.8.0}/setup.py +0 -0
  28. {pycba-0.6.0 → pycba-0.8.0}/src/PyCBA.egg-info/dependency_links.txt +0 -0
  29. {pycba-0.6.0 → pycba-0.8.0}/src/PyCBA.egg-info/requires.txt +0 -0
  30. {pycba-0.6.0 → pycba-0.8.0}/src/PyCBA.egg-info/top_level.txt +0 -0
  31. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/pattern.py +0 -0
  32. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/types.py +0 -0
  33. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/utils.py +0 -0
  34. {pycba-0.6.0 → pycba-0.8.0}/src/pycba/vehicle.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyCBA
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: Python Continuous Beam Analysis
5
5
  Author-email: Colin Caprani <colin.caprani@monash.edu>
6
6
  License: Apache 2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyCBA
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: Python Continuous Beam Analysis
5
5
  Author-email: Colin Caprani <colin.caprani@monash.edu>
6
6
  License: Apache 2.0
@@ -13,11 +13,17 @@ src/pycba/beam.py
13
13
  src/pycba/bridge.py
14
14
  src/pycba/inf_lines.py
15
15
  src/pycba/load.py
16
+ src/pycba/nonlinear.py
16
17
  src/pycba/pattern.py
17
18
  src/pycba/results.py
19
+ src/pycba/section.py
18
20
  src/pycba/types.py
19
21
  src/pycba/utils.py
20
22
  src/pycba/vehicle.py
21
23
  tests/test_basic.py
22
24
  tests/test_bridge.py
23
- tests/test_inf_lines.py
25
+ tests/test_inf_lines.py
26
+ tests/test_moving_load.py
27
+ tests/test_nonlinear.py
28
+ tests/test_nonprismatic.py
29
+ tests/test_results.py
@@ -2,10 +2,11 @@
2
2
  PyCBA - Continuous Beam Analysis in Python
3
3
  """
4
4
 
5
- __version__ = "0.6.0"
5
+ __version__ = "0.8.0"
6
6
 
7
7
  from .analysis import BeamAnalysis
8
8
  from .beam import Beam
9
+ from .section import SectionEI
9
10
  from .load import (
10
11
  LoadCNL,
11
12
  MemberResults,
@@ -21,3 +22,4 @@ from .utils import parse_beam_string
21
22
  from .bridge import BridgeAnalysis
22
23
  from .vehicle import Vehicle, make_train, VehicleLibrary
23
24
  from .pattern import LoadPattern
25
+ from .nonlinear import NonlinearBeamAnalysis, NonlinearResult, HingeEvent
@@ -78,9 +78,13 @@ class BeamAnalysis:
78
78
  ----------
79
79
  L : array_like of float
80
80
  Span lengths. Length ``N`` for an ``N``-span beam.
81
- EI : float or array_like of float
82
- Flexural rigidity of each span. A scalar value is applied to all
83
- spans; otherwise one value per span is required.
81
+ EI : float, pycba.section.SectionEI, or array_like
82
+ Flexural rigidity of each span. A single scalar (or a single
83
+ :class:`~pycba.section.SectionEI`) is applied to all spans;
84
+ otherwise one entry per span is required. A span whose rigidity is
85
+ given as a :class:`~pycba.section.SectionEI` is treated as
86
+ **non-prismatic** (variable ``EI``) and analysed by flexibility
87
+ integration; scalar entries use the closed-form prismatic element.
84
88
  R : array_like of int or float
85
89
  Nodal restraint vector, length ``2(N+1)``. Two entries per node
86
90
  (vertical DOF then rotational DOF), ordered left to right:
@@ -91,13 +95,18 @@ class BeamAnalysis:
91
95
  * ``+k`` — elastic spring stiffness in consistent units.
92
96
 
93
97
  LM : list of list, optional
94
- Load matrix: a list of load descriptors, each of the form
95
- ``[span, load_type, value, a, c]``. Load types:
96
-
97
- 1. UDL — ``value`` is load intensity; set ``a = c = 0``.
98
- 2. Point load — ``value`` at distance ``a`` from the span start.
99
- 3. Partial UDL — ``value`` intensity from ``a`` for length ``c``.
100
- 4. Moment load — ``value`` at distance ``a`` from the span start.
98
+ Load matrix: a list of load descriptors. The number of columns
99
+ per entry depends on the load type:
100
+
101
+ 1. UDL — ``[span, 1, w]``.
102
+ 2. Point load — ``[span, 2, P, a]``.
103
+ 3. Partial UDL — ``[span, 3, w, a, c]``.
104
+ 4. Moment load — ``[span, 4, M, a]``.
105
+ 5. Trapezoidal — ``[span, 5, w1, w2]`` (full span) or
106
+ ``[span, 5, w1, w2, a, c]`` (partial).
107
+ 6. Imposed curvature — ``[span, 6, k0, k1, ...]`` where the free
108
+ curvature field is ``κ(x) = k0 + k1·x + …`` (e.g. creep,
109
+ shrinkage or thermal curvature).
101
110
 
102
111
  eletype : array_like of int, optional
103
112
  Element type for each span, controlling which end(s) carry moment:
@@ -241,6 +250,67 @@ class BeamAnalysis:
241
250
  load = [i_span, 4, m, a]
242
251
  self._beam.add_load(load)
243
252
 
253
+ def add_ic(self, i_span: int, kappa):
254
+ r"""
255
+ Append an imposed-curvature (initial-strain) member load.
256
+
257
+ The free curvature field ``κ(x) = k0 + k1·x + k2·x² + …`` is imposed
258
+ over the member. On a simply-supported span it produces no internal
259
+ forces (only a free deflected shape); on a restrained or continuous
260
+ structure its restraint generates real moments and reactions. This is
261
+ the mechanism for applying creep, shrinkage and thermal curvatures to a
262
+ continuous beam (see :class:`pycba.load.LoadIC`).
263
+
264
+ Parameters
265
+ ----------
266
+ i_span : int
267
+ 1-based span index.
268
+ kappa : float or array_like of float
269
+ Imposed-curvature polynomial coefficients in increasing powers of
270
+ ``x``: ``[k0, k1, k2, ...]``. A scalar is a uniform curvature.
271
+ """
272
+ coeffs = np.atleast_1d(np.asarray(kappa, dtype=float)).tolist()
273
+ load = [i_span, 6] + coeffs
274
+ self._beam.add_load(load)
275
+
276
+ def add_trap(
277
+ self,
278
+ i_span: int,
279
+ w1: float,
280
+ w2: float,
281
+ a: Optional[float] = None,
282
+ c: Optional[float] = None,
283
+ ):
284
+ """
285
+ Append a trapezoidal (linearly varying) distributed load.
286
+
287
+ When *a* and *c* are omitted the load covers the full span, varying
288
+ from *w1* at the left end to *w2* at the right end. When *a* and *c*
289
+ are given the load covers the region from *a* to *a + c*, varying from
290
+ *w1* to *w2* over that length.
291
+
292
+ Parameters
293
+ ----------
294
+ i_span : int
295
+ 1-based span index.
296
+ w1 : float
297
+ Load intensity at the start of the load. Positive values act downward.
298
+ w2 : float
299
+ Load intensity at the end of the load. Positive values act downward.
300
+ a : float, optional
301
+ Distance from the left end of the span to the start of the load.
302
+ If given, *c* must also be provided.
303
+ c : float, optional
304
+ Length (cover) of the load. Required when *a* is provided.
305
+ """
306
+ if a is not None and c is None:
307
+ raise ValueError("If 'a' is specified, 'c' must also be provided")
308
+ if a is not None:
309
+ load = [i_span, 5, w1, w2, a, c]
310
+ else:
311
+ load = [i_span, 5, w1, w2]
312
+ self._beam.add_load(load)
313
+
244
314
  def analyze(self, npts: Optional[int] = None) -> int:
245
315
  """
246
316
  Execute the direct-stiffness analysis.