Vortex in Cell 3D ring with ringlets optimization
In this example we solve the Navier-Stokes equation in the vortex formulation in 3D for an incompressible fluid. This example has the following changes compared to Vortex in Cell 3D
- Constructing grid is expensive in particular with a lot of cores. For this reason we create the grid in the main function rather than in the comp_vel function and helmotz_hodge_projection
- Constructing also FDScheme is expensive so we construct it once in the main. We set the left hand side to the poisson operator, and inside the functions comp_vel and helmotz_hodge_projection just write the right hand side with impose_dit_b
grid_type g_vel(g_vort.getDecomposition(),szu,g);
grid_type g_dvort(g_vort.getDecomposition(),szu,g);
grid_type_s psi(g_vort.getDecomposition(),g_vort.getGridInfo().getSize(),g);
grid_type phi_v(g_vort.getDecomposition(),g_vort.getGridInfo().getSize(),g);
fd.template impose_dit<0>(poisson(),psi,psi.getDomainIterator());
Laplacian second order on h (spacing)
This is a distributed grid.
fd.new_b();
fd.template impose_dit_b<0>(psi,psi.getDomainIterator());
Another optimization that we do is to use a Hilbert space-filling curve as sub-sub-domain distribution strategy