Skip to content

Commit

Permalink
Merge pull request #184 from adtzlr/fix-numba-prange
Browse files Browse the repository at this point in the history
fix numba prange
  • Loading branch information
adtzlr authored Jan 11, 2022
2 parents ac2f6a3 + c725285 commit 244ba6e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [2.0.1] - 2022-01-11

### Fixed
- Fixed wrong result of assembly generated by a parallel loop with `prange`.

## [2.0.0] - 2022-01-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion felupe/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0"
__version__ = "2.0.1"
20 changes: 10 additions & 10 deletions felupe/_assembly/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ def integrate_gradv_broadcast(v, fun, dV): # pragma: no cover
out = np.zeros((npoints, dim1, ncells))

for a in prange(npoints): # basis function "a"
for p in prange(ngauss): # integration point "p"
for p in range(ngauss): # integration point "p"
for c in prange(ncells): # cell "c"
for i in prange(dim1): # first index "i"
for J in prange(dim2): # second index "J"
for J in range(dim2): # second index "J"
out[a, i, c] += v[a, J, p, c] * fun[i, J, 0, 0] * dV[p, c]

return out
Expand All @@ -248,10 +248,10 @@ def integrate_gradv(v, fun, dV): # pragma: no cover
out = np.zeros((npoints, dim1, ncells))

for a in prange(npoints): # basis function "a"
for p in prange(ngauss): # integration point "p"
for p in range(ngauss): # integration point "p"
for c in prange(ncells): # cell "c"
for i in prange(dim1): # first index "i"
for J in prange(dim2): # second index "J"
for J in range(dim2): # second index "J"
out[a, i, c] += v[a, J, p, c] * fun[i, J, p, c] * dV[p, c]

return out
Expand All @@ -266,14 +266,14 @@ def integrate_gradv_gradu_broadcast(v, fun, u, dV): # pragma: no cover

out = np.zeros((npoints_a, dim1, npoints_b, dim3, ncells))

for p in prange(ngauss): # integration point "p"
for p in range(ngauss): # integration point "p"
for c in prange(ncells): # cell "c"
for a in prange(npoints_a): # basis function "a"
for b in prange(npoints_b): # basis function "b"
for i in prange(dim1): # first index "i"
for J in prange(dim2): # second index "J"
for J in range(dim2): # second index "J"
for k in prange(dim3): # third index "k"
for L in prange(dim4): # fourth index "L"
for L in range(dim4): # fourth index "L"
out[a, i, b, k, c] += (
v[a, J, p, c]
* u[b, L, p, c]
Expand All @@ -293,14 +293,14 @@ def integrate_gradv_gradu(v, fun, u, dV): # pragma: no cover

out = np.zeros((npoints_a, dim1, npoints_b, dim3, ncells))

for p in prange(ngauss): # integration point "p"
for p in range(ngauss): # integration point "p"
for c in prange(ncells): # cell "c"
for a in prange(npoints_a): # basis function "a"
for b in prange(npoints_b): # basis function "b"
for i in prange(dim1): # first index "i"
for J in prange(dim2): # second index "J"
for J in range(dim2): # second index "J"
for k in prange(dim3): # third index "k"
for L in prange(dim4): # fourth index "L"
for L in range(dim4): # fourth index "L"
out[a, i, b, k, c] += (
v[a, J, p, c]
* u[b, L, p, c]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "felupe"
version = "2.0.0"
version = "2.0.1"
description = "Finite Element Analysis"
readme = "README.md"
requires-python = ">=3.6"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = felupe
version = 2.0.0
version = 2.0.1
author = Andreas Dutzler
author_email = [email protected]
description = Finite Element Analysis
Expand Down

0 comments on commit 244ba6e

Please sign in to comment.