-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSOC-Task #3: Visualizing Triangulation and CellField objects #21
Comments
More examples: using Gridap
using Gridap.ReferenceFEs
using Gridap.Geometry
using CairoMakie
using GridapMakie
using FileIO
model = CartesianDiscreteModel((0.,1.5,0.,1.),(15,10)) |> simplexify
Ω = Triangulation(model)
u = CellField(x->x[1]+x[2],Ω)
celldata = rand(num_cells(grid))
# Fig. 1: surface
fig, = plot(Ω)
save("fig_1.png",fig)
# Fig. 2: surface and edges
fig, = plot(Ω)
edges!()
save("fig_2.png",fig)
# Fig. 3: prescribe edge width
fig, = plot(Ω)
edges!(linewidth=2.5)
save("fig_3.png",fig)
# Fig. 4: set surface and edge color
fig, = plot(Ω,:green)
edges!(color=:red,linewidth=2.5)
save("fig_4.png",fig)
# Fig. 5: set surface color via a cell field
fig, = plot(Ω,celldata)
save("fig_5.png",fig)
# Fig. 6: set surface color via a nodal field
fig, = plot(uh)
save("fig_6.png",fig)
# Fig. 7: display colorbar
fig,ax,tp = plot(uh)
Colorbar(fig[1,2],tp)
save("fig_7.png",fig)
# Fig. 8: change colormap
fig,ax,tp = plot(uh,colormap=:heat,colorrange=[0,1.])
Colorbar(fig[1,2],tp)
save("fig_8.png",fig)
# Fig. 9: edge color via nodal field
# not doable in this case |
Implementation remarksThe idea us to transform
|
Unfortunately, there appears to be an issue when using |
Fixed by PR #24 |
Given
Ω::Triangulation
,uh::CellField
,cell_to_val::AbstractArray
, e.g.,We want to implement:
Example:
cell_nums
fromcells
. Otherwise, we cannot writecells(Ω)
, as it returnsMethodError: objects of type Tuple{Int64, Int64} are not callable
(spent more time that I should looking for the bug...)The text was updated successfully, but these errors were encountered: