# Setup for the quick PDE solving session with Julia **Disclaimer:** Solving PDEs with frameworks requires initial time for learning the tools. We will therefore not solve crazy complicated PDEs, but instead just see how the tools work and apply them to simple cases. ## Installation of Julia and VS Code I made a quick video which shows these steps. Essentially: 1. Download and install [Julia](https://julialang.org/downloads/) (take version 1.8): - make sure that Julia is either added to the PATH (checkbox during installation) or that you know the install path. In VS Code (**VS Code is optional, feel free to use Juno instead.**): 2. Download and install [VS Code](https://code.visualstudio.com/). 3. Install the [Julia extension](https://code.visualstudio.com/docs/languages/julia). 4. Go to File > Preferences > Settings. And seach for "Julia path". Set the "Julia: Executable Path" according to your installation. - Example: On Linux I have `/home/plunder/julia/1.7.3/bin/julia` but this might be different for you. 5. To test the installation, create a `.jl` file, type `1+1` into it and press `Shift+Enter` to execute the line. ## Installation of meshing and visualisation tools The most difficult aspect of solving PDEs is often not just the numerical method, but also handeling the inputs and visualising the outputs. We will use `Paraview` for the visualisation and `Gmsh` for creating meshes of the domains. Both are quite well suppored by many PDE solvers (e.g. also by [FEniCSx](https://fenicsproject.org/), [deal.II](https://www.dealii.org/), [libMESH](libmesh)...), so, independent of Julia or not, it is useful to know them. Therefore, we will need: - [Gmsh](https://gmsh.info/#Download) - [Paraview](https://www.paraview.org/download/) (On Linux, both can be installed via the package manager of your choice, e.g. `sudo apt-get install gmsh paraview`). ## Quick intro to VS Code VS Code looks complicated, but it is by far the easiest powerful editor you can imagine right now. **The big secret is to know one hotkey** which is **Ctrl + Shift + P**. Write 100 times: **Ctrl + Shift + P** is the solution to everything. **Ctrl + Shift + P** is the solution to everything. **Ctrl + Shift + P** is the solution to everything. **Ctrl + Shift + P** is the solution to everything. ... **Ctrl + Shift + P** opens a search bar, where you can type in what you want to do. Just search for it and you will find what you are looking for. Or even more! ## Very quick introduction to Julia In VS Code, you can always start the Julia terminal (called *REPL*, i.e. read-eval-print loop). **Exercise** How can you open the Julia REPL in VS Code. (Hint, I hope you read the previous section! **Ctrl + Shift + P** is the solution to everything.) ### Installing Julia packages (for the PDE session) Open the folder you want to work in (for example `/home/steffen/workspace/PDEs`). Open the Julia REPL in VS Code ``` julia> ``` and then press the `]` button. This will put the Julia REPL into the package mode. ``` (@v1.8) pkg> ``` The `(@v1.8)` indicates that we are working in the global `(@v1.8)` enviroment. You can install packages here, but sometimes it is better to keep things separate. So, let's do it the proper way and first initate a new project in the current folder, with the command ``` (@v1.8) pkg> activate . Activating new project at `~/workspace/PDEs` (PDEs) pkg> ``` Now everything we do, will be specific for this project and leave your other Julia projects untouched. Finally, let's install some packages. We will mainly use the finite element framework [Gridap.jl](https://github.com/gridap/Gridap.jl) You can install all packages we need for the session, with the command `add`, i.e. ``` (PDEs) pkg> add Gridap GridapGmsh GridapMakie GLMakie OrdinaryDiffEq ``` This will take some time, but afterwards we have a quite powerful set of tools for solving ODEs and PDEs!