Skip to content
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

Work Product of GSoC 2021 project "[Gridap] Visualizing PDE approximations in Julia with Gridap.jl and Makie.jl" #24

Merged
merged 60 commits into from Aug 22, 2021

Conversation

paurierap
Copy link
Collaborator

@paurierap paurierap commented Aug 18, 2021

Overview

This Pull Request serves as a general description for the GridapMakie project as part of the Google Summer of Code 2021 program. The main goal of the project is to improve the data visualization experience of Gridap.jl, a numerical software for the solution of partial differential equations, by providing the tools towards a fully integrated, end-to-end workflow, from code development and testing, to data visualization. To this end, a new integration with Makie.jl, a plotting environment in the Julia programming language, has been developed in GridapMakie.jl. By doing so, the user no longer needs to rely on external applications (e.g., Paraview), to visualize Gridap data types.

Package Summary

Using conversions from Gridap types to GeometryBasics.jl, GridapMakie.jl allows to plot finite element (FE) triangulations as well as FE functions defined on them via the color attribute. Moreover, the API that GridapMakie uses is quite intuitive for previous Makie users: to visualize surface or volume meshes, we have extended the functions mesh and plot, whereas the visualization of lines (e.g., cell boundaries) and points (e.g., cell vertices) is handled by wireframe and scatter. Of course, each plotting function has its mutating variant (plot!, mesh!, etc.) in order to superpose to existing plots.

Student-Mentor Communication

Overall, the process has been as smooth as velvet. I joined the Gridap Slack channel, where I communicated with my mentors towards the accomplishment of the project goals, as stated in the project proposal. Additionally, we hold a weekly meeting every Tuesday morning to discuss problems as well as new directions and perspectives. These meetings did usually surpass a two-hour duration and were always clarifying for both parties, the student and the mentors.

Coding Work

We started off trying to visualize 2D and 3D plot objects (as in #16) with straightforward plot conversions. We then turned to create our own Plot Recipes in #17 and extending the visualization to account for FE approximations in #18. However, we were not convinced by our plot recipes due to potentially confusing functions names, and restructured the way GridapMakie plots objects: instead of relying on the recipes, we would just extend the existing Makie functions. This way, the user would feel more comfortable with an easy-to-understand API (see #23). All along, these functions do have Observable support, allowing the creation of animations and interactive plots. For proof of results, see the Examples in GridapMakie.jl README file. As seen, most of the objectives set in the project proposal have been reached. Also, the GSoC 2021 blog contains a follow-up of the steps taken towards the completion of GridapMakie, which, by the way, can always be expanded.

Next steps

Finally, future work on the package will concern higher-order visualization in #27 (for example, meshes with curved elements and quadratic polynomials) or quadrilateral meshes in #33, the creation of PackageCompiler.jl warm-up files to reduce Makie start-up time (in #26), or the extension of the Makie function arrows to visualize vector fields (currently, any vectorial field is plotted according to the norm of the function at a certain point). In addition to those, we could attain the visualization of sections and slices of triangulations (e.g., the section created by the intersection of a grid and a plane), which would be achieved using GridapEmbedded.jl and the latest Makie release, where support for slices was announced.

paurierap and others added 30 commits June 8, 2021 13:17
Clean-up of the module and first tests.
Visualize a Grid() or UnstructuredGrid() using mesh and wireframe from Makie.
Add nodaldata and colormap. Send .DS_Store to .gitignore.
Extension of wireframe function to fit quad meshes. Addition of colormap and colorbar in the tests.
Added a couple of lines in the conversion in 3D: the connectivity cns is converted via SimplexFace{D+1,Type} instead of NgonFace{D+1,Type} since the latter creates quads in 3D. Also, Makie.mesh does not support the type tetrahedron, so the grid is converted with normal_mesh.
This reverts commit bcadf31.
This implementation is capable of plotting every figure in #Task2.
New approach to plot cell fields in 3D grids along with subtle modifications.
Change single color edges to avoid missing corners.
Implement dg_mesh, introduce vertices, add all attributes to plotting functions, remove shading.
New approach to plot 3D grids
End of Task 2 and beginning of Task 3
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@ericneiva ericneiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, job, @paurierap! My review is finished.

.github/workflows/ci.yml Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
Copy link
Member

@fverdugo fverdugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paurierap excellent job! The examples in the README look very nice!

See some minor comments below.

I'll accept and merge the PR once we have the description with the summary of the work done.

_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
_readme/README.jl Outdated Show resolved Hide resolved
@paurierap
Copy link
Collaborator Author

paurierap commented Aug 21, 2021

@fverdugo The description is on its way!

Final version of README file with comments from @amartinhuertas, @ericneiva  and @fverdugo.
@paurierap paurierap added the gsoc label Aug 22, 2021
README.md Outdated Show resolved Hide resolved
@fverdugo fverdugo merged commit 6afee42 into master Aug 22, 2021
@paurierap paurierap changed the title Gsoc2021 master Work Product of GSoC 2021 project "[Gridap] Visualizing PDE approximations in Julia with Gridap.jl and Makie.jl" Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants