mfv2d documentation

mfv2d documentation#

MFV2D aims to be a 2D differential equation solver based on mimetic spectral element method (MSEM), as outlined by Gerritsma et al.. The solver is capable of working on semi-structured deformed quadrilateral meshes. These meshes can be locally refined hierarchically by dividing elements, polynomially by increasing order of any elements, or both combined.

In the future the goal is to incorporate variational multi-scale (VMS) theory based on work by Shrestha et al..

The package is written partially in C and partially in Python. The idea behind it is that only performance critical code ought to be written in C, as writing, testing, and debugging it is significantly harder than for Python. As such, make sure to first profile the code to determine if it should be rewritten to C, then introduce enough tests to be sure any errors that can happen are not the result of the newly added C code. Also make sure to run these tests with valgrind [val] to check for any memory corruption or leaks.

[val]

Valgrind Home. URL: https://valgrind.org/ (visited on 2025-06-15).

[GPJZ18]

Marc Gerritsma, Artur Palha, Varun Jain, and Yi Zhang. Mimetic Spectral Element Method for Anisotropic Diffusion. February 2018. URL: https://arxiv.org/abs/1802.04597v1 (visited on 2025-06-15).

[JZPG20]

Varun Jain, Yi Zhang, Artur Palha, and Marc Gerritsma. Construction and application of algebraic dual polynomial representations for finite element methods on quadrilateral and hexahedral meshes. September 2020. arXiv:1712.09472 [math]. URL: http://arxiv.org/abs/1712.09472 (visited on 2025-02-12), doi:10.48550/arXiv.1712.09472.

[SGR+25]

Suyash Shrestha, Marc Gerritsma, Gonzalo Rubio, Steven Hulshoff, and Esteban Ferrer. Optimal solutions employing an algebraic Variational Multiscale approach part I: Steady Linear Problems. Computer Methods in Applied Mechanics and Engineering, 438:117832, April 2025. URL: https://www.sciencedirect.com/science/article/pii/S0045782525001045 (visited on 2025-03-10), doi:10.1016/j.cma.2025.117832.