Closed fverdugo closed 3 years ago
Steps:
gsoc2021-master
(consensus branch, all test should pass)pr-task1
(you are free to use this branch as you want)GridapMakie
moduleGridap="0.16"
in Project.toml
[compat]
section. You perhaps need to resolve your environment at this point. pkg> resolve
.Griadp.Grid
-> GeometryBasics.Mesh
function AbstractPlotting.convert_arguments(pt::PlotType, grid::Grid)
convert_arguments(pt,UnstructuredGrid(grid))
end
function AbstractPlotting.convert_arguments(::PlotType, grid::UnstructuredGrid)
xs = get_node_coordinates(grid)
Tp = eltype(eltype(xs))
D = length(eltype(xs))
ps = collect(reinterpret(GeometryBasics.Point{D,Tp},xs))
cns = get_cell_node_ids(grid)
Tf = eltype(eltype(cns))
fs = collect(lazy_map(GeometryBasics.NgonFace{D+1,Tf},cns))
m = GeometryBasics.Mesh(GeometryBasics.connect(ps,fs))
m
end
Makie
functions like mesh
and wireframe
. Add this code into a test.simplexify
).Some relevant links/info interchanged during 07/06/21 meeting:
Eric Neiva17:41
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)' Eric Neiva17:43 https://github.com/JuliaPlots/GLMakie.jl/blob/master/.github/workflows/ci.yml https://github.com/JuliaPlots/GLMakie.jl/blob/3762f689ec785ff40b429c9ecca7d81a54895ed0/.github/workflows/ci.yml#L41 Eric Neiva17:45 https://github.com/JuliaPlots/GLMakie.jl#troubleshooting-opengl
@paurierap perhaps it is better to use convert_single_argument
instead of convert_arguments
.
Some updated steps after the meeting on 2021-06-11:
Before the meeting on 21/06/2021, the conversions implemented from Gridap
types to Makie
types allow us to plot:
2D surface + set color (extended to quads too) | 2D edges + set color and linewidth (only for simplices) | 2D surface color via a nodal field + choice of colormap (and colorbar) |
3D surface + set color (extended to quads too) | 3D edges + set color and linewidth (only for simplices) | 3D surface color via a nodal field + choice of colormap (and colorbar) |
So far, we still need to address the drawing of quadrilateral edges in either dimension as well as the plotting of a cell field.
Code discussed in meeting 2021-06-21 for visualizing 3D meshes. (i.e., convert volume mesh to boundary mesh of triangles)
using Gridap
using Gridap.Geometry
using Gridap.Visualization
domain = (0,1,0,1,0,1)
cells = (2,2,2)
grid = CartesianGrid(domain,cells)
write_vtk_file(grid,"grid")
topo = GridTopology(grid)
labels = FaceLabeling(topo)
model = DiscreteModel(grid,topo,labels)
face_grid = Grid(ReferenceFE{2},model)
face_to_mask = get_face_mask(labels,"boundary",2)
@show num_cells(face_grid)
@show length(face_to_mask)
write_vtk_file(face_grid,"face_grid",celldata=["mask"=>collect(Int,face_to_mask)])
boundary_grid = GridPortion(face_grid,face_to_mask) |> simplexify
write_vtk_file(boundary_grid,"boundary_grid")
TODO steps
gsoc2021-master
branchclosed via #18
cc @paurierap @ericneiva @amartinhuertas
This task is to be further defined in the kick-off meeting
Intro
Being able to visualize instances of
Gridap.Geometry.Grid
is the cornerstone to visualize other Gridap objects. So, it is a good place to start.Given a 2D
Grid
object (3D and 1D will be covered in subsequent tasks), we typically want the following kind of visualizations (now they are done with paraview). Here, I am using this code to generate a simple grid of triangles:TODO (outdated, see below for the updated steps)
src
folder)Notes
Most of the functionality we need is provided by the Makie function
mesh
, but it is likely that this does not cover all cases.