Skip to content

Commit

Permalink
Merge branch 'master' into hyperelastic
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 committed Oct 11, 2024
2 parents edef8ae + a100998 commit f73911a
Show file tree
Hide file tree
Showing 69 changed files with 881 additions and 673 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1'
- '1.10'
os:
- ubuntu-latest
arch:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version: ['1',]
version: ['1.10',]
os: ['ubuntu-latest',]
steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 9 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TopOpt"
uuid = "53a1e1a5-51bb-58a9-8a02-02056cc81109"
authors = ["mohamed82008 <[email protected]>", "yijiangh <[email protected]>"]
version = "0.9.1"
version = "0.9.2"

[deps]
AbstractDifferentiation = "c29ec348-61ec-40c8-8164-b8c60e9d9f3d"
Expand Down Expand Up @@ -34,7 +34,6 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Preconditioners = "af69fa37-3177-5a40-98ee-561f696e4fcd"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -50,6 +49,12 @@ VTKDataTypes = "10d27dd1-1d0f-5a4c-b178-bd2d0045a217"
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[weakdeps]
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"

[extensions]
TopOptMakieExt = "Makie"

[compat]
AbstractDifferentiation = "0.4, 0.5, 0.6"
ChainRulesCore = "1"
Expand All @@ -66,6 +71,7 @@ IterativeSolvers = "0.9"
JSON = "0.21"
JuliaFormatter = "1"
MacroTools = "0.5"
Makie = "0.21"
MappedArrays = "0.4"
NearestNeighbors = "0.4"
Nonconvex = "2"
Expand All @@ -75,7 +81,6 @@ NonconvexSemidefinite = "0.1.7"
Parameters = "0.12"
Preconditioners = "0.3, 0.4, 0.5, 0.6"
Reexport = "1"
Requires = "1.1"
Revise = "3"
Setfield = "0.7, 0.8, 1"
StaticArrays = "1"
Expand All @@ -86,4 +91,4 @@ TimerOutputs = "0.5"
VTKDataTypes = "0.1"
WriteVTK = "1.9"
Zygote = "0.6"
julia = "1.5, 1.6"
julia = "1.9"
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Nonconvex = "01bcebdf-4d21-426d-b5c4-6132c1619978"
NonconvexTOBS = "6c0b5230-d4c9-466e-bfd4-b31e6272ab65"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
Expand Down
13 changes: 6 additions & 7 deletions docs/src/literate/beso.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ x0 = ones(length(solver.vars))
result = beso(x0)

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(problem; topology = result.topology)
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(problem; topology=result.topology)
Makie.display(fig)

#md # ## [Plain Program](@id beso-plain-program)
#md #
Expand Down
22 changes: 13 additions & 9 deletions docs/src/literate/csimp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,19 @@ end
@show constr(x)

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(problem; topology = x, default_exagg_scale = 0.07,
# scale_range = 10.0, vector_linewidth = 3, vector_arrowsize = 0.5,
# )
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(
problem;
topology=x,
default_exagg_scale=0.07,
scale_range=10.0,
vector_linewidth=3,
vector_arrowsize=0.5,
)
Makie.display(fig)

#md # ## [Plain Program](@id csimp-plain-program)
#md #
Expand Down
13 changes: 6 additions & 7 deletions docs/src/literate/geso.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ x0 = ones(length(solver.vars))
result = geso(x0)

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(problem; topology = result.topology)
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(problem; topology=result.topology)
Makie.display(fig)

#md # ## [Plain Program](@id geso-plain-program)
#md #
Expand Down
13 changes: 6 additions & 7 deletions docs/src/literate/global_stress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ r = optimize(model, alg, x0; options)
@show constr(r.minimizer)

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(problem; topology = r.minimizer)
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(problem; topology=r.minimizer)
Makie.display(fig)

#md # ## [Plain Program](@id global-stress-plain-program)
#md #
Expand Down
23 changes: 13 additions & 10 deletions docs/src/literate/local_stress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ maximum(stress(filter(PseudoDensities(x0))))
maximum(stress(filter(PseudoDensities(x))))

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(
# problem; topology = r.minimizer, default_exagg_scale = 0.07,
# scale_range = 10.0, vector_linewidth = 3, vector_arrowsize = 0.5,
# )
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(
problem;
topology=r.minimizer,
default_exagg_scale=0.07,
scale_range=10.0,
vector_linewidth=3,
vector_arrowsize=0.5,
)
Makie.display(fig)

#md # ## [Plain Program](@id local-stress-plain-program)
#md #
Expand Down
32 changes: 16 additions & 16 deletions docs/src/literate/simp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@ r = optimize(model, alg, x0; options)
@show obj(r.minimizer)

# ### (Optional) Visualize the result using Makie.jl
# Need to run `using Pkg; Pkg.add(["Makie", "GLMakie"])` first
# ```julia
# using Makie, GLMakie
# using TopOpt.TopOptProblems.Visualization: visualize
# fig = visualize(
# problem; topology = r.minimizer,
# default_exagg_scale = 0.07, scale_range = 10.0,
# vector_linewidth = 3, vector_arrowsize = 0.5,
# )
# Makie.display(fig)
# ```
# Need to run `using Pkg; Pkg.add("Makie")` first and either `Pkg.add("CairoMakie")` or `Pkg.add("GLMakie")`
using Makie
using CairoMakie
# alternatively, `using GLMakie`
fig = visualize(
problem;
topology=r.minimizer,
default_exagg_scale=0.07,
scale_range=10.0,
vector_linewidth=3,
vector_arrowsize=0.5,
)
Makie.display(fig)

# or convert it to a Mesh
# Need to run `using Pkg; Pkg.add(GeometryBasics)` first
# ```julia
# import Makie, GeometryBasics
# result_mesh = GeometryBasics.Mesh(problem, r.minimizer);
# Makie.mesh(result_mesh)
# ```
using Makie, GeometryBasics
result_mesh = GeometryBasics.Mesh(problem, r.minimizer);
Makie.mesh(result_mesh)

#md # ## [Plain Program](@id simp-plain-program)
#md #
Expand Down
Loading

0 comments on commit f73911a

Please sign in to comment.