Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 committed Nov 16, 2023
1 parent 842becd commit 8fbfe7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[deps]
NonconvexUtils = "c48e48a2-1f5e-44ff-8799-c8e168d11d1b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TopOpt = "53a1e1a5-51bb-58a9-8a02-02056cc81109"
7 changes: 3 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ using NonconvexTOBS, TopOpt, Test
# define FEA solver and auxiliary functions
solver = FEASolver(Direct, problem; xmin = xmin)
cheqfilter = DensityFilter(solver; rmin = rmin) # filter function
comp = TopOpt.Compliance(problem, solver) # compliance function
comp = TopOpt.Compliance(solver) # compliance function

obj(x) = comp(cheqfilter(x)) # compliance objective
constr(x) = sum(cheqfilter(x)) / length(x) - V # volume fraction constraint
obj(x) = comp(cheqfilter(PseudoDensities(x))) # compliance objective
constr(x) = sum(cheqfilter(PseudoDensities(x))) / length(x) - V # volume fraction constraint

# Optimization setup
using NonconvexUtils
tobj = TraceFunction(obj, on_grad = true)
m = Model(tobj) # create optimization model
addvar!(m, zeros(length(x0)), ones(length(x0))) # setup optimization variables
Expand Down

0 comments on commit 8fbfe7b

Please sign in to comment.