Skip to content

Commit

Permalink
Merge pull request #421 from adtzlr/fix-mesh-expand-revolve-isscalar
Browse files Browse the repository at this point in the history
Fix scalar-checks in `mesh.expand()` and `mesh.revolve()`
  • Loading branch information
adtzlr authored Apr 3, 2023
2 parents d7085ec + 5865233 commit 38ae800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ All notable changes to this project will be documented in this file. The format
- Change `einsumt` from an optional to a required dependency.
- Vectorize implementations of `MultiPointConstraint` and `MultiPointContact` and re-implement both as `scipy.sparse.lil_matrix()`.

### Fixed
- Fix `tools.project()` for higher-order quad- and hexahedron elements.
- Fix transposed output of `tools.project()`.
- Fix failed scalar-value checks by using `np.isscalar()` in `mesh.expand(z=1)` and `mesh.revolve(phi=180)` where `z` or `phi` are of type `np.int32`.

### Removed
- Remove `jit`-compilation of forms (`parallel` is the preferred method).
- Remove unused `tools.check()`.
Expand Down
4 changes: 2 additions & 2 deletions src/felupe/mesh/_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def expand(points, cells, cell_type, n=11, z=1):
p = np.pad(points, ((0, 0), (0, 1)))

# generate new points array for every thickness expansion ``h``
if isinstance(z, int) or isinstance(z, float):
if np.isscalar(z):
points_z = np.linspace(0, z, n)
else:
points_z = z
Expand Down Expand Up @@ -182,7 +182,7 @@ def revolve(points, cells, cell_type, n=11, phi=180, axis=0):
"quad": ("hexahedron", slice(None, None, None)),
}[cell_type]

if isinstance(phi, int) or isinstance(phi, float):
if np.isscalar(phi):
points_phi = np.linspace(0, phi, n)
else:
points_phi = phi
Expand Down

0 comments on commit 38ae800

Please sign in to comment.