Luca Heltai [email protected]
- You will need the following programs:
- Visual Studio Code with the
Remote Development
plugin installed - Paraview (ver > 5.4 would be better)
- Visual Studio Code with the
- Check that the
.devcontainer
directory contains a configuration that works foryou. When you open the root directory of the repository, it should prompt you toreopen in container. If not, try explictily with the commandF1 -> Reopen folder incontainer
- If opening in container worked, you should be able to run a terminal (
CTRL + ~
)and see something like
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
dealii@3f25621373bd:/workspaces/02_tria_dh_fem$
- The folder contains a
CMakeLists.txt
file. VSCode should detect this, and providecommands to configure and build your application, at the bottom of the terminal window
In this case you can copy the commands from the docker image that you can find here:
to install all the dependencies. After this, you can install the latest version of the library using the commands you find here:
- Read the documentation of step-1 at
- Compile and run
step-1
inside the VSCode container and look at the output. - Understand what happens if you now call
first_grid(triangulation)
andsecond_grid(triangulation)
one after the other. Fix the problem you get, without creating a second triangulation, or without going out of scope, and make sure your main function works correctly. - Create an image of an L-shape domain (add a function
third_grid
to step-1) with one global refinement, and output it asthird_grid.vtk
using theGridOut::write_vt()
function. - Refine the L-shaped mesh adaptively around the re-entrant corner three times (after the global refinement you already did), but with a twist: refine all cells with the distance between the center of the cell and re-entrant corner is smaller than 2/3.
- Create a helper function that takes a reference to a Triangulation and returns a tuple with the following information: number of levels, number of cells, number of active cells. Test this with all of your meshes.
- Un-comment the
triangulation.reset_manifold(0)
line insecond_grid()
. What happens now? Write your findings as a comment under the line in the file, and leave the command commented out after you experimented with it. - Bonus: Create a mesh that represents the surface of a torus and refine
it 2 times globally. Output to vtk format and check the output. Note
that your Triangulation needs to be of type
Triangulation<2,3>
, which we will discuss later this week. - Bonus: Take a look at step-49 and read the included .msh file in your modifiedstep-1 program.
-
Read the documentation of step-2 at
-
Run step-2. Look at the sparsity patterns in your browser.
-
How does the pattern change if you increase the polynomial degree from 1 to 2 orto 3?
-
How does the pattern change if you use a globally refined (say 3 times) unitsquare?
-
Are these patterns symmetric? Why/why not?
-
How many entries per row in the sparsity pattern do you expect for a Q1 element (assuming four cells are around each vertex)? Check that this is true for the mesh in b) (look for
row_length(i)
and output them for each row). Can you construct a 2d mesh (without hanging nodes) that has a row with more entries? -
How many entries per row in the sparsity pattern are there for Q2 and Q3 elements, again assuming four cells around each vertex?
-
Print all entries for row 42 for the original renumbered sparsity pattern.
-
Bonus: Compute and output statistics like the number of unknowns, bandwidth of the sparsity pattern, average number of entries per row, and fill ratio.