Hi, I am doing topology optimization. I have seen some tutorials. I want to add volume constrain to my model as below:
v/v0=f
which v is material volume and v0 is domain volume and f is volume fraction.
could you please tell me how can i add this to my code
using NLopt
function gf_p_optimize(p_init; r, β, η, TOL = 1e-6, MAX_ITER = 700, fem_params)
##################### Optimize #################
opt = Opt(:LD_CCSAQ, fem_params.np)
opt.lower_bounds = 0
opt.upper_bounds = 1
opt.ftol_rel = TOL
opt.maxeval = MAX_ITER
opt.min_objective = (p0, grad) -> gf_p(p0, grad; r, β, η, fem_params)
(g_opt, p_opt, ret) = optimize(opt, p_init)
@show numevals = opt.numevals # the number of function evaluations
return g_opt, p_opt
end
thank you