-
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 #1: Visualizing 2D and 3D Grid objects #16
Comments
Steps:
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
|
Some relevant links/info interchanged during 07/06/21 meeting:
|
@paurierap perhaps it is better to use |
Some updated steps after the meeting on 2021-06-11:
|
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
|
closed 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.The text was updated successfully, but these errors were encountered: