A fast vectorized codes for assembly mixed finite element matrices for the generalized Navier–Stokes system in three space dimensions in the MATLAB language are proposed by the MINI element. Vectorization means that the loop over tetrahedra is avoided. Numerical experiments illustrate computational efficiency of the codes. An experimental superconvergence rate for the pressure component is established.

Numerical solution algorithms for the Navier Stokes equations is the rapidly developing field, in which various cost-effective methods are being proposed. This can be domain decomposition methods (Rønquist,

The paper focuses on the generalized Navier–Stokes system in three space dimensions (3D) approximated by the mixed finite element method using the MINI element called also the P1-bubble/P1 pair (Arnold

Numerical experiments with our codes show superconvergence rate of the finite element approximation of the pressure component that is close to

The rest of the paper is organized as follows. Section

To better understand our presentation we use different font styles. The mathematics bold symbols are used for the vector functions or their vector arguments, e.g.

Let

We will consider two iterative methods for solving (

The weak formulation of (

The weak formulations of (

We approximate (

We suppose that Ω is a polyhedral domain. Let

On

On

Recall that

The element matrices and vectors will be divided on the non-bubble and bubble components:

The tetrahedron

The constant values of the basis functions derivatives on

The linear systems (

The following formulas are adopted from Koko (

Using Green’s formula and

Comparing

The functions

Let us permute the system (

The local matrices and vectors

We assume that for

The same effect can be achieved by the following vectorized code:

Here, the dot-product “

The algebraic version of the iterative scheme (_{3}. We initialize (

Our implementation of (

Assembling

Computing LU-factorization of

Assembling

Solving (

Computing

Stop if the outer terminating criterion is sufficiently small:

We consider three test problems defined on the unit cube with known analytic solutions. They are 3D extensions of the well-known test problems of computational fluid dynamics in 2D. First, we examine time requirements of the assembly operations for different discretizations. Then we investigate convergence properties of the finite element approximation. All computations are done in

Structured (left) and unstructured (right) mesh for test problems.

We consider the functions

We consider the functions

We consider the functions

In Tables

In Table

Loop over tetrahedra versus vectorized code.

729 | 2197 | 4913 | 9261 | 15625 | 29791 | 50653 | 91125 | |

2560 | 8640 | 20480 | 40000 | 69120 | 135000 | 233280 | 425920 | |

8.1e−03 | 2.8e−02 | 5.9e−02 | 1.3e−01 | 2.4e−01 | 6.4e−01 | 1.2e+00 | 2.1e+00 | |

2.4e−01 | 1.9e+00 | 2.0e+01 | 1.4e+02 | 4.7e+02 | 1.9e+03 | 6.0e+03 | 2.0e+04 | |

29.6 | 66.8 | 333.6 | 1079.6 | 1952.3 | 3020.9 | 5079.3 | 9299.0 |

Loop over tetrahedra:

Oseen linearization | Newton linearization | |||

4913 | 15625 | 4913 | 15625 | |

20480 | 69120 | 20480 | 69120 | |

2.17e+01 | 3.22e+02 | 2.56e+01 | 5.05e+02 | |

1.57e−01 | 1.26e+00 | 4.28e−01 | 3.41e+00 | |

0.993 | 0.996 | 0.984 | 0.993 |

Tables

Table

Vectorized code:

Oseen linearization | Newton linearization | |||||

103823 | 166375 | 250047 | 103823 | 166375 | 250047 | |

486680 | 787320 | 1191640 | 486680 | 787320 | 1191640 | |

7.60e+00 | 1.52e+01 | 2.50e+01 | 6.77e+00 | 1.46e+01 | 2.18e+01 | |

3.45e+01 | 7.53e+01 | 1.58e+02 | 9.21e+01 | 2.30e+02 | 5.13e+02 | |

0.180 | 0.168 | 0.137 | 0.069 | 0.060 | 0.041 | |

7.66e+00 | 1.50e+01 | 2.19e+01 | 7.19e+00 | 1.52e+01 | 2.28e+01 | |

5.47e+01 | 1.12e+02 | 2.04e+02 | 1.21e+02 | 2.74e+02 | 6.78e+02 | |

0.123 | 0.118 | 0.097 | 0.056 | 0.052 | 0.032 |

In this example, we investigate experimentally convergence rates of finite element approximations computed by our vectorized codes on structured meshes. The following optimal convergence result is proved in Boffi

Convergence rates for the test problem #1 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 1.749e−2 | 2.846e−1 | 3.507e−1 | |||

5.774e−2‖30 | 9.410e−3 | 2.00 | 1.785e−1 | 1.50 | 2.469e−1 | 1.13 |

4.558e−2‖38 | 5.856e−3 | 2.01 | 1.254e−1 | 1.50 | 1.909e−1 | 1.09 |

3.608e−2‖46 | 3.990e−3 | 2.01 | 9.422e−2 | 1.44 | 1.559e−1 | 1.06 |

3.093e−2‖54 | 2.891e−3 | 2.01 | 7.414e−2 | 1.50 | 1.318e−1 | 1.05 |

2.794e−2‖62 | 2.190e−3 | 2.01 | 6.030e−2 | 1.50 | 1.142e−1 | 1.04 |

Convergence rates for the test problem #1 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 1.583e−2 | 6.059e−2 | 3.515e−1 | |||

5.774e−2‖30 | 8.452e−3 | 2.02 | 3.379e−2 | 1.88 | 2.467e−1 | 1.14 |

4.558e−2‖38 | 5.239e−3 | 2.02 | 2.180e−2 | 1.85 | 1.907e−1 | 1.09 |

3.608e−2‖46 | 3.560e−3 | 2.02 | 1.538e−2 | 1.83 | 1.557e−1 | 1.06 |

3.093e−2‖54 | 2.575e−3 | 2.02 | 1.151e−2 | 1.81 | 1.316e−1 | 1.05 |

2.794e−2‖62 | 1.949e−3 | 2.02 | 8.996e−3 | 1.79 | 1.141e−1 | 1.04 |

Convergence rates for the test problem #2 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 3.998e−2 | 7.449e−1 | 8.546e−1 | |||

5.774e−2‖30 | 2.184e−2 | 1.95 | 4.726e−1 | 1.47 | 5.974e−1 | 1.15 |

4.558e−2‖38 | 1.370e−2 | 1.97 | 3.336e−1 | 1.47 | 4.604e−1 | 1.10 |

3.608e−2‖46 | 9.383e−3 | 1.98 | 2.514e−1 | 1.48 | 3.751e−1 | 1.07 |

3.093e−2‖54 | 6.822e−3 | 1.99 | 1.981e−1 | 1.49 | 3.168e−1 | 1.05 |

2.794e−2‖62 | 5.182e−3 | 1.99 | 1.613e−1 | 1.49 | 2.743e−1 | 1.04 |

Convergence rates for the test problem #2 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 3.505e−2 | 1.826e−1 | 8.442e−1 | |||

5.774e−2‖30 | 1.898e−2 | 1.98 | 1.024e−1 | 1.87 | 5.927e−1 | 1.14 |

4.558e−2‖38 | 1.187e−2 | 1.99 | 6.576e−2 | 1.87 | 4.580e−1 | 1.09 |

3.608e−2‖46 | 8.117e−3 | 1.99 | 4.556e−2 | 1.92 | 3.738e−1 | 1.06 |

3.093e−2‖54 | 5.898e−3 | 1.99 | 3.435e−2 | 1.76 | 3.160e−1 | 1.05 |

2.794e−2‖62 | 4.481e−3 | 1.99 | 2.668e−2 | 1.83 | 2.738e−1 | 1.04 |

Convergence rates for the test problem #3 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 3.648e−5 | 1.386e−3 | 1.114e−3 | |||

5.774e−2‖30 | 1.990e−5 | 1.95 | 8.827e−4 | 1.45 | 7.985e−4 | 1.07 |

4.558e−2‖38 | 1.248e−5 | 1.98 | 6.257e−4 | 1.46 | 6.233e−4 | 1.15 |

3.608e−2‖46 | 8.539e−6 | 1.99 | 4.733e−4 | 1.46 | 5.115e−4 | 1.03 |

3.093e−2‖54 | 6.205e−6 | 1.99 | 3.740e−4 | 1.47 | 4.339e−4 | 1.03 |

2.794e−2‖62 | 4.711e−6 | 1.99 | 3.052e−4 | 1.47 | 3.769e−4 | 1.02 |

Convergence rates for the test problem #3 with

Rate | Rate | Rate | ||||

7.873e−2‖22 | 3.649e−5 | 1.409e−4 | 1.114e−3 | |||

5.774e−2‖30 | 1.990e−5 | 1.95 | 8.934e−5 | 1.47 | 7.986e−4 | 1.07 |

4.558e−2‖38 | 1.248e−5 | 1.98 | 6.309e−5 | 1.47 | 6.233e−4 | 1.05 |

3.608e−2‖46 | 8.539e−6 | 1.99 | 4.773e−5 | 1.46 | 5.115e−4 | 1.03 |

3.093e−2‖54 | 6.205e−6 | 1.99 | 3.769e−5 | 1.47 | 4.339e−4 | 1.03 |

2.794e−2‖62 | 4.711e−6 | 1.99 | 3.073e−5 | 1.48 | 3.769e−4 | 1.02 |

In Tables

Convergence rates for the test problem #2 with

Rate | Rate | Rate | ||||

9.4515e−2 | 2.275e−2 | 4.502e−1 | 3.572e−1 | |||

7.6129e−2 | 1.435e−2 | 2.13 | 3.044e−1 | 1.81 | 2.706e−1 | 1.28 |

6.2010e−2 | 8.915e−3 | 2.32 | 2.297e−1 | 1.37 | 2.060e−1 | 1.33 |

4.8458e−2 | 5.542e−3 | 1.93 | 1.677e−1 | 1.28 | 1.595e−1 | 1.04 |

3.8869e−2 | 3.481e−3 | 2.11 | 1.210e−1 | 1.48 | 1.242e−1 | 1.16 |

3.1102e−2 | 2.177e−3 | 2.11 | 9.098e−2 | 1.28 | 9.756e−2 | 1.08 |

– | 2.12 | – | 1.43 | – | 1.17 |

Convergence rates for the test problem #2 with

Rate | Rate | Rate | ||||

9.4515e−2 | 2.275e−2 | 4.502e−1 | 3.572e−1 | |||

7.6129e−2 | 1.435e−2 | 2.13 | 3.044e−1 | 1.81 | 2.706e−1 | 1.28 |

6.2010e−2 | 8.915e−3 | 2.32 | 2.297e−1 | 1.37 | 2.060e−1 | 1.33 |

4.8458e−2 | 5.542e−3 | 1.93 | 1.677e−1 | 1.28 | 1.595e−1 | 1.04 |

3.8869e−2 | 3.481e−3 | 2.11 | 1.210e−1 | 1.48 | 1.242e−1 | 1.14 |

3.1102e−2 | 2.177e−3 | 2.11 | 9.098e−2 | 1.28 | 9.756e−2 | 1.08 |

– | 2.11 | – | 1.43 | – | 1.17 |

In this paper, we present main ideas for vectorized coding of matrices and vectors describing mixed finite element approximation based on the MINI element for the Navier–Stokes system in 3D. It is shown that the vectorized operations are considerably faster than the loop over tetrahedra. This allows to experiment with this problem in the user-friendly Matlab environment. Note that our codes are freely available (Kučera

The dual implementation of the basic iterative schemes in Section

Finally, we should point out that the results of our experiments are in agreement with the theoretical convergence rates of the finite element approximation. Moreover, it extends observations of other authors on a superconvergence rate of the pressure component. It confirms, among others, correctness of our codes.

This work was supported by the Ministry of Education, Youth and Sports of the Czech Republic through the e-INFRA CZ (ID:90140) and the internal VSB-TUO SGS-project.