Closed pitipatw closed 1 year ago
@pitipatw PR #140 starts to support visualize(problem; cell_colors=color_per_cell)
where color_per_cell
is a vector of dimension length(x)
. You can also change the color scheme to make sure it matches red for compression and blue for tension scheme by changing the default colormap=ColorSchemes.Spectral_10
.
The only caveat is that you have to compute the per-cell stress from the FEA solver, and pass it into cell_colors
.
Im currently using TopOpt 0.7.0 but still getting "got unsupported keywords "cell_color", "colormap".
I saw these keywords written in the visualization.jl file too. I merged #140 to my local machine. Is there any other possible version conflict I could look for?
update, after I merged #140, the same script cant find the "visualize"
Can you try ] add Example#master
?
Also, you have to open a new Julia session after you pull a new version to trigger compilation for the visualization module.
I tried ] add Example#master
, still cant find the "visualize".
I also notice an error about CUDA.jl outdated, so I updated it and now it seems that either Julia or Visual Studio can't find my CUDA runtime library.
I will keep using ver0.6.0 for now.
@pitipatw the visualize
module is only loaded when Makie
is imported as well. Try this:
using Makie, GLMakie, TopOpt
using TopOpt.TrussTopOptProblems.TrussVisualization: visualize
Also, what julia version you are using?
For the CUDA problem, I have never encountered this before. @mohamed82008 I thought we've got rid of all CUDA dependencies?
@yijiangh Thank you for the help
I already have the
using Makie, GLMakie, TopOpt TopOpt.TrussTopOptProblems.Trussvisualization:visualize
on top of the script.
The script I'm using is basically the truss 3d example with some adjustments for input from GH through JSON.
The second line is the one that throws the error of can't find visualize
I'm on Julia 1.8.5
For the CUDA problem, I have never encountered this before. @mohamed82008 I thought we've got rid of all CUDA dependencies?
I think that may be GLMakie's fault.
I'm currently using the truss optimization to generate truss structure. Currently I can't find options in the visualize component to set the color according to the result stress or the stress in each element.
My current solution is to send the vector of element areas to post process outside of TopOpt.jl