Wave protection comparison 2: square grid versus triangular grid
Channel: Nils Berglund
Date: 30/07/2021

This second simulation in our series of comparisons between different types of protections against waves compares the effect of a square grid and of a triangular grid of obstacles. The numbers in the four corners show the total energy in areas at the left and at the right of the obstacles, compared to the energy of the incoming wave. 
The colors show the energy density of the wave  (obtained by adding squares of the time-derivative of the wave height, and the wave speed times the norm of its spatial gradient). There are periodic boundary conditions on the top and bottom sides of the displayed domain, and absorbing boundary conditions on the sides, which however don't work perfectly, which is why you see some waves reflected from the boundary. 

Music: "Voices", by Patrick Patrikios@patrikiospatrick

See also https://images.math.cnrs.fr/Des-ondes-dans-mon-billard-partie-I.html for more explanations (in French) on  a few previous simulations of wave equations. 

The simulation solves the wave equation by discretization. The algorithm is adapted from the paper https://hplgit.github.io/fdm-book/doc/pub/wave/pdf/wave-4print.pdf 
C code: https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html 
Many thanks to my colleague Marco Mancini for helping me to accelerate my code!