femethods 0.1.7a2__tar.gz → 0.1.8__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 (33) hide show
  1. femethods-0.1.8/License.txt +7 -0
  2. femethods-0.1.8/PKG-INFO +281 -0
  3. {femethods-0.1.7a2 → femethods-0.1.8}/README.md +243 -243
  4. femethods-0.1.8/femethods/__init__.py +8 -0
  5. femethods-0.1.8/femethods/core/__init__.py +4 -0
  6. femethods-0.1.8/femethods/mesh.py +245 -0
  7. femethods-0.1.8/femethods/validation.py +104 -0
  8. femethods-0.1.8/femethods.egg-info/PKG-INFO +281 -0
  9. femethods-0.1.8/femethods.egg-info/SOURCES.txt +13 -0
  10. femethods-0.1.8/femethods.egg-info/requires.txt +20 -0
  11. {femethods-0.1.7a2 → femethods-0.1.8}/femethods.egg-info/top_level.txt +0 -1
  12. femethods-0.1.8/pyproject.toml +130 -0
  13. {femethods-0.1.7a2 → femethods-0.1.8}/setup.cfg +4 -4
  14. {femethods-0.1.7a2 → femethods-0.1.8}/tests/__init__.py +1 -1
  15. femethods-0.1.7a2/PKG-INFO +0 -257
  16. femethods-0.1.7a2/femethods/__init__.py +0 -5
  17. femethods-0.1.7a2/femethods/core/__init__.py +0 -0
  18. femethods-0.1.7a2/femethods/core/_base_elements.py +0 -422
  19. femethods-0.1.7a2/femethods/core/_common.py +0 -117
  20. femethods-0.1.7a2/femethods/elements.py +0 -389
  21. femethods-0.1.7a2/femethods/loads.py +0 -38
  22. femethods-0.1.7a2/femethods/mesh.py +0 -101
  23. femethods-0.1.7a2/femethods/reactions.py +0 -176
  24. femethods-0.1.7a2/femethods.egg-info/PKG-INFO +0 -257
  25. femethods-0.1.7a2/femethods.egg-info/SOURCES.txt +0 -21
  26. femethods-0.1.7a2/femethods.egg-info/requires.txt +0 -3
  27. femethods-0.1.7a2/setup.py +0 -22
  28. femethods-0.1.7a2/tests/functional tests/__init__.py +0 -0
  29. femethods-0.1.7a2/tests/functional tests/settings.py +0 -11
  30. femethods-0.1.7a2/tests/functional tests/test_fixed_support_beams.py +0 -38
  31. femethods-0.1.7a2/tests/functional tests/test_simply_supported_beam.py +0 -136
  32. femethods-0.1.7a2/tests/functional tests/validate.py +0 -44
  33. {femethods-0.1.7a2 → femethods-0.1.8}/femethods.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,7 @@
1
+ Copyright 2019 Joseph Contreras Jr.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,281 @@
1
+ Metadata-Version: 2.4
2
+ Name: femethods
3
+ Version: 0.1.8
4
+ Summary: Implementation of Finite Element Analysis
5
+ Author-email: Joseph Contreras <26684136+JosephJContreras@users.noreply.github.com>
6
+ Project-URL: Homepage, https://femethods.readthedocs.io/en/latest/index.html
7
+ Project-URL: Source, https://github.com/JJCoding01/FEmethods
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: License.txt
19
+ Requires-Dist: matplotlib
20
+ Requires-Dist: numpy
21
+ Provides-Extra: dev
22
+ Requires-Dist: black; extra == "dev"
23
+ Requires-Dist: coverage; extra == "dev"
24
+ Requires-Dist: coveralls; extra == "dev"
25
+ Requires-Dist: flake8; extra == "dev"
26
+ Requires-Dist: isort; extra == "dev"
27
+ Requires-Dist: mypy; extra == "dev"
28
+ Requires-Dist: pip-tools; extra == "dev"
29
+ Requires-Dist: pre-commit; extra == "dev"
30
+ Requires-Dist: pylint; extra == "dev"
31
+ Requires-Dist: pyproject-fmt; extra == "dev"
32
+ Requires-Dist: pytest; extra == "dev"
33
+ Requires-Dist: pytest-cov; extra == "dev"
34
+ Requires-Dist: validate-pyproject[all]; extra == "dev"
35
+ Provides-Extra: docs
36
+ Requires-Dist: sphinx; extra == "docs"
37
+ Dynamic: license-file
38
+
39
+ # FEmethods
40
+
41
+ [![PyPI version](https://badge.fury.io/py/femethods.svg)](https://badge.fury.io/py/femethods)
42
+ [![Build Status](https://travis-ci.org/josephjcontreras/FEMethods.svg?branch=master)](https://travis-ci.org/josephjcontreras/FEMethods)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/josephjcontreras/FEMethods/blob/master/License.txt)
44
+ [![Coverage Status](https://coveralls.io/repos/github/josephjcontreras/FEMethods/badge.svg?branch=master)](https://coveralls.io/github/josephjcontreras/FEMethods?branch=master)
45
+ [![Documentation Status](https://readthedocs.org/projects/femethods/badge/?version=latest)](https://femethods.readthedocs.io/en/latest/?badge=latest)
46
+
47
+
48
+ ## Introduction
49
+ _FEmethods_ is a python module that uses Finite Element Methods to determine the
50
+ reactions, and plot the shear, moment, and deflection along the length of a beam.
51
+
52
+ Using Finite elements has the advantage over using exact solutions because it
53
+ can be used as a general analysis, and can analyze beams that are statically
54
+ indeterminate. The downside of this numerical approach is it will be less
55
+ accurate than the exact approach.
56
+
57
+ The official documentation is on [Read the Docs](https://femethods.readthedocs.io/en/latest/).
58
+
59
+ ## Installation
60
+
61
+ __FEMethods__ is hosted on PyPi, so installation is simple.
62
+
63
+ `pip install femethods`
64
+
65
+
66
+ ## General Layout
67
+
68
+ `FEMethods` is made up of several sub-classes to make it easy to define loads
69
+ and reaction types.
70
+
71
+ ### femethods.loads
72
+ There are currently only two different load types that are implemented.
73
+
74
+ * `PointLoad`, a normal force acting with a constant magnitude on a single point
75
+ * `MomentLoad`, a rotational moment acting with a constant magnitude acting at a single point
76
+
77
+ All loads are defined by a `location` along the element, and a `magnitude`.
78
+ The `location` must be positive, and must lie on the length of the beam,
79
+ or it will raise a `ValueError`
80
+
81
+ _Future goals are to add a library of standard distributed loads
82
+ (constant, ramp, etc) as well as functionality that will allow a distributed
83
+ load function to be the input._
84
+
85
+ #### femethods.loads.PointLoad
86
+ The `PointLoad` class describes a standard point load. A normal load acting at
87
+ a single point with a constant value. It is defined with a location and a
88
+ magnitude.
89
+
90
+ ```python
91
+ >>> PointLoad(-10, 5)
92
+ PointLoad(magnitude=-10, location=5)
93
+ ```
94
+
95
+ The `location` must be a positive value, and less than or equal to the length
96
+ of the beam, otherwise it raise a `ValueError`.
97
+
98
+ #### femethods.loads.MomentLoad
99
+ A `MomentLoad` class describes a standard moment load. A moment acting at a
100
+ single point with a constant value. It is defined with a location and a value.
101
+
102
+ ```python
103
+ >>> MomentLoad(2, 5)
104
+ MomentLoad(magnitude=2, location=5)
105
+ ```
106
+
107
+ The `location` must be a positive value, and less than or equal to the length
108
+ of the beam, otherwise it raise a `ValueError`.
109
+
110
+ ### femethods.reactions
111
+
112
+ There are two different reactions that can be used to support an element.
113
+
114
+ * `FixedReaction` does not allow vertical or rotational displacement
115
+ * `PinnedReaction` does not allow vertical displacement but does allow rotational displacement
116
+
117
+ All reactions have two properties, a `force` and a `moment`. They represent
118
+ the numerical value for the resistive force or moment acting on the element
119
+ to support the load(s). These properties are set to `None` when the reaction
120
+ is instantiated (ie, they are unknown). They are calculated and set when
121
+ analyzing a element. Note that the `moment` property of a `PinnedReaction`
122
+ will always be `None` because it does not resist a moment.
123
+
124
+ The `value` property is a read-only combination of the `force` and `moment`
125
+ properties, and is in the form `value = (force, moment)`
126
+
127
+ All reactions have an `invalidate` method that will set the `force` and
128
+ `moment` back to `None`. This is useful when changing parameters and the
129
+ calculated reactions are no longer valid.
130
+
131
+ #### femethods.reactions.FixedReaction
132
+ The `FixedReaction` is a reaction class that prevents both vertical and angular
133
+ (rotational displacement). It has boundary conditions of `bc = (0, 0)`
134
+
135
+ ```python
136
+ >>> FixedReaction(3)
137
+ FixedReaction(location=3)
138
+
139
+ >>> print(FixedReaction(3))
140
+ FixedReaction
141
+ Location: 3
142
+ Force: None
143
+ Moment: None
144
+ ```
145
+
146
+ The `location` must be a positive value, and less than or equal to the length
147
+ of the beam, otherwise it raise a `ValueError`.
148
+
149
+ #### femethods.reactions.PinnedReaction
150
+ The `PinnedReaction` is a reaction class that prevents vertical displacement,
151
+ but allows angular (rotational) displacement. It has boundary conditions of `bc = (0, None)`
152
+
153
+ ```python
154
+ >>> PinnedReaction(7)
155
+ PinnedReaction(location=7)
156
+ >>> print(PinnedReaction(7))
157
+ PinnedReaction
158
+ Location: 7
159
+ Force: None
160
+ Moment: None
161
+ ```
162
+
163
+ The `location` must be a positive value, and less than or equal to the length
164
+ of the beam, otherwise it raise a `ValueError`.
165
+
166
+ ### femethods.elements.Beam
167
+ Defines a beam as a finite element. This class will handle the bulk of the
168
+ analysis, populating properties (such as meshing and values for the reactions).
169
+
170
+ To create a `Beam` object, write the following:
171
+
172
+ ```python
173
+ b = Beam(length, loads, reactions, E=1, Ixx=1)
174
+ ```
175
+
176
+ Where the loads and reactions are a list of `loads` and `reactions` respectively.
177
+
178
+ **Note**
179
+ Loads and reactions must be a list, even when there is only one.
180
+
181
+ The `E` and `Ixx` parameters are Young's modulus and the polar moment of
182
+ inertia about the bending axis. They both default to `1`.
183
+
184
+ ## Examples
185
+
186
+ This section contains several different examples of how to use the beam
187
+ element, and their results.
188
+
189
+ For all examples, the following have been imported:
190
+
191
+ ```python
192
+ from femethods.elements import Beam
193
+ from femethods.reactions import FixedReaction, PinnedReaction
194
+ from femethods.loads import PointLoad, MomentLoad
195
+ ```
196
+
197
+ ### Example 1: Cantilevered Beam with Fixed Support and End Loading
198
+
199
+ ```python
200
+ beam_len = 10
201
+ # Note that both the reaction and load are both lists. They must always be
202
+ # given to Beam as a list,
203
+ r = [FixedReaction(0)] # define reactions as list
204
+ p = [PointLoad(magnitude=-2, location=beam_len)] # define loads as list
205
+
206
+ b = Beam(beam_len, loads=p, reactions=r, E=29e6, Ixx=125)
207
+
208
+ # an explicit solve is required to calculate the reaction values
209
+ b.solve()
210
+ print(b)
211
+ ```
212
+
213
+ The output of the program is
214
+ ```
215
+ PARAMETERS
216
+ Length (length): 10
217
+ Young's Modulus (E): 29000000.0
218
+ Area moment of inertia (Ixx): 125
219
+ LOADING
220
+ Type: point load
221
+ Location: 10
222
+ Magnitude: -2
223
+
224
+ REACTIONS
225
+ Type: fixed
226
+ Location: 0
227
+ Force: 2.0
228
+ Moment: 20.0
229
+ ```
230
+
231
+ ### Example 2: Cantilevered Beam with 3 Pinned Supports and End Loading
232
+
233
+ ```python
234
+ beam_len = 10
235
+
236
+ # Note that both the reaction and load are both lists. They must always be
237
+ # given to Beam as a list,
238
+ r = [PinnedReaction(0), PinnedReaction(2), PinnedReaction(6)] # define reactions
239
+ p = [PointLoad(magnitude=-2, location=beam_len)] # define loads
240
+
241
+ b = Beam(beam_len, loads=p, reactions=r, E=29e6, Ixx=125)
242
+
243
+ # an explicit solve is required to calculate the reaction values
244
+ b.solve()
245
+ print(b)
246
+ ```
247
+
248
+ The output of the program is
249
+ ```
250
+ PARAMETERS
251
+ Length (length): 10
252
+ Young's Modulus (E): 29000000.0
253
+ Area moment of inertia (Ixx): 125
254
+ LOADING
255
+ Type: point load
256
+ Location: 10
257
+ Magnitude: -2
258
+
259
+ REACTIONS
260
+ Type: pinned
261
+ Location: 0
262
+ Force: 1.3333333333333346
263
+ Moment: 0.0
264
+ Type: pinned
265
+ Location: 2
266
+ Force: -4.000000000000004
267
+ Moment: 0.0
268
+ Type: pinned
269
+ Location: 6
270
+ Force: 4.666666666666671
271
+ Moment: 0.0
272
+ ```
273
+
274
+ ## TODO
275
+ * Add a more thorough documentation for all the features, limitations and FE fundamentals for each section
276
+ * Add additional element types, such as the bar element
277
+
278
+ ## Acknowledgements
279
+ [Derivation of stiffness matrix for a beam](https://www.12000.org/my_notes/stiffness_matrix/stiffness_matrix_report.htm#x1-50002.1.1) by Nasser M. Abbasi
280
+ [An idiot’s guide to Python documentation with Sphinx and ReadTheDocs](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs) by [Sam Nicholls](https://samnicholls.net/about/) for
281
+ a very helpful guide on how to get sphinx set up