Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mawc2019 committed Aug 4, 2023
1 parent 6c94f35 commit 4390001
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/adjoint/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ def mesh_grid(

if Nx <= 1 and Ny <= 1:
raise AssertionError(
"The grid size is improper. Check the size and resolution of the design region.")
"The grid size is improper. Check the size and resolution of the design region."
)

xv = np.arange(0, Lx / 2, 1 / resolution[0]) if resolution[0] > 0 else [0]
yv = np.arange(0, Ly / 2, 1 / resolution[1]) if resolution[1] > 0 else [0]
Expand Down Expand Up @@ -943,7 +944,9 @@ def indicator_solid(x, c, filter_f, threshold_f, resolution, periodic_axes=None)
[1] Zhou, M., Lazarov, B. S., Wang, F., & Sigmund, O. (2015). Minimum length scale in topology optimization by
geometric constraints. Computer Methods in Applied Mechanics and Engineering, 293, 266-282.
"""
design_field, grad_mag = length_indicator(x, filter_f, threshold_f, resolution, periodic_axes)
design_field, grad_mag = length_indicator(
x, filter_f, threshold_f, resolution, periodic_axes
)
return design_field * npa.exp(-c * grad_mag)


Expand Down Expand Up @@ -1023,7 +1026,9 @@ def indicator_void(x, c, filter_f, threshold_f, resolution, periodic_axes=None):
[1] Zhou, M., Lazarov, B. S., Wang, F., & Sigmund, O. (2015). Minimum length scale in topology optimization by
geometric constraints. Computer Methods in Applied Mechanics and Engineering, 293, 266-282.
"""
design_field, grad_mag = length_indicator(x, filter_f, threshold_f, resolution, periodic_axes)
design_field, grad_mag = length_indicator(
x, filter_f, threshold_f, resolution, periodic_axes
)
return (1 - design_field) * npa.exp(-c * grad_mag)


Expand Down

0 comments on commit 4390001

Please sign in to comment.