Skip to content

Commit bf9b9dc

Browse files
committed
Minor update
1 parent 4d46ee0 commit bf9b9dc

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Installing ``PARDISO`` Solver
3232

3333
The default sparse solver used in ``scipy`` is ``SuperLU``.
3434
It performs okay for small matrices but appears to be very slow for larger matrices.
35-
The ``PARDISO`` solver is a much faster alternative, but it requires the installation of the ``MKL`` library, which takes a lot of disk space.
35+
The ``PARDISO`` solver is a much faster alternative (see `pypadiso <https://github.com/haasad/PyPardisoProject>`_), but it requires the installation of the ``MKL`` library, which takes a lot of disk space.
3636

3737
If you do not have a disk space constraint, you can use the ``PARDISO`` solver by:
3838

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ classifiers = [
3232
]
3333
packages = [
3434
{ include = "sectionproperties", from = "src" },
35-
{ include = "src/sectionproperties/py.typed"},
35+
{ include = "src/sectionproperties/py.typed" },
3636
]
3737
include = [
3838
"*.3dm",
@@ -48,7 +48,7 @@ Changelog = "https://github.com/robbievanleeuwen/section-properties/releases"
4848

4949
[tool.poetry.dependencies]
5050
python = ">=3.9.0,<3.12"
51-
numpy = "^1.25.2"
51+
numpy = "^1.25.2" # numba requires numpy <1.26
5252
scipy = "^1.11.3"
5353
matplotlib = "^3.8.0"
5454
shapely = "^2.0.1"

src/sectionproperties/analysis/fea.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,16 +563,16 @@ def element_stress(
563563
:math:`\sigma_{zy,vx}`, :math:`\sigma_{zx,vy}`,
564564
:math:`\sigma_{zy,vy}`, :math:`w_i`)
565565
"""
566-
# calculate axial stress
567-
sig_zz_n = n * np.ones(6) * self.material.elastic_modulus / ea
568-
569566
n_points: int = 6
570567

568+
# calculate axial stress
569+
sig_zz_n = n * np.ones(n_points) * self.material.elastic_modulus / ea
570+
571571
# initialise stresses at the gauss points
572-
sig_zz_mxx_gp = np.zeros((n_points, 1))
573-
sig_zz_myy_gp = np.zeros((n_points, 1))
574-
sig_zz_m11_gp = np.zeros((n_points, 1))
575-
sig_zz_m22_gp = np.zeros((n_points, 1))
572+
sig_zz_mxx_gp = np.zeros(n_points)
573+
sig_zz_myy_gp = np.zeros(n_points)
574+
sig_zz_m11_gp = np.zeros(n_points)
575+
sig_zz_m22_gp = np.zeros(n_points)
576576
sig_zxy_mzz_gp = np.zeros((n_points, 2))
577577
sig_zxy_vx_gp = np.zeros((n_points, 2))
578578
sig_zxy_vy_gp = np.zeros((n_points, 2))
@@ -597,16 +597,16 @@ def element_stress(
597597
r, q, d1, d2, h1, h2 = _shear_parameter(nx, ny, ixx, iyy, ixy)
598598

599599
# calculate element stresses
600-
sig_zz_mxx_gp[i, :] = self.material.elastic_modulus * (
600+
sig_zz_mxx_gp[i] = self.material.elastic_modulus * (
601601
-(ixy * mxx) / (ixx * iyy - ixy**2) * nx
602602
+ (iyy * mxx) / (ixx * iyy - ixy**2) * ny
603603
)
604-
sig_zz_myy_gp[i, :] = self.material.elastic_modulus * (
604+
sig_zz_myy_gp[i] = self.material.elastic_modulus * (
605605
-(ixx * myy) / (ixx * iyy - ixy**2) * nx
606606
+ (ixy * myy) / (ixx * iyy - ixy**2) * ny
607607
)
608-
sig_zz_m11_gp[i, :] = self.material.elastic_modulus * m11 / i11 * ny_22
609-
sig_zz_m22_gp[i, :] = self.material.elastic_modulus * -m22 / i22 * nx_11
608+
sig_zz_m11_gp[i] = self.material.elastic_modulus * m11 / i11 * ny_22
609+
sig_zz_m22_gp[i] = self.material.elastic_modulus * -m22 / i22 * nx_11
610610

611611
if mzz != 0:
612612
sig_zxy_mzz_gp[i, :] = (
@@ -633,10 +633,10 @@ def element_stress(
633633
)
634634

635635
# extrapolate results to nodes
636-
sig_zz_mxx = extrapolate_to_nodes(w=sig_zz_mxx_gp[:, 0])
637-
sig_zz_myy = extrapolate_to_nodes(w=sig_zz_myy_gp[:, 0])
638-
sig_zz_m11 = extrapolate_to_nodes(w=sig_zz_m11_gp[:, 0])
639-
sig_zz_m22 = extrapolate_to_nodes(w=sig_zz_m22_gp[:, 0])
636+
sig_zz_mxx = extrapolate_to_nodes(w=sig_zz_mxx_gp)
637+
sig_zz_myy = extrapolate_to_nodes(w=sig_zz_myy_gp)
638+
sig_zz_m11 = extrapolate_to_nodes(w=sig_zz_m11_gp)
639+
sig_zz_m22 = extrapolate_to_nodes(w=sig_zz_m22_gp)
640640
sig_zx_mzz = extrapolate_to_nodes(w=sig_zxy_mzz_gp[:, 0])
641641
sig_zy_mzz = extrapolate_to_nodes(w=sig_zxy_mzz_gp[:, 1])
642642
sig_zx_vx = extrapolate_to_nodes(w=sig_zxy_vx_gp[:, 0])
@@ -1111,7 +1111,7 @@ def extrapolate_to_nodes(w: np.ndarray) -> np.ndarray:
11111111
Returns:
11121112
Extrapolated nodal values at the six nodes, of size ``[1 x 6]``
11131113
"""
1114-
return h_inv.dot(w)
1114+
return h_inv @ w
11151115

11161116

11171117
@njit(cache=True, nogil=True)

0 commit comments

Comments
 (0)