Installation instruction

1. first install firedrake (https://www.firedrakeproject.org/install.html) and avfet module (https://doi.org/10.5281/zenodo.15302724)

2. There might be some incompatibilities between firedrake and avfet modules, if error shows 'dim = dim or mesh.ufl_cell().geometric_dimension()', this can be fixed 
by going the file avfet_modules/cheb_fet/__init__.py, and comment the line 49 dim = dim or mesh_ufl_cell().geometric_dimension(). Then reinstall by pip install .

3. If there are other issues about reproduction of our code, please email Mingdong.He@maths.ox.ac.uk 

Figures in the paper can be obtained by running the following 4 groups of numerical experiments first, the data will be 
saved as .csv files and .vtu files:

    bejh/: our structure-preserving scheme (B, E, j, H)

    periodic/: our structure-preserving scheme (B, E, j, H) with nontrivial topology, using generalized helicity
    
    hdiv/: Hdiv scheme (B, E, j) - without introducing the auxiliary variable H

    cg_hcurl_comparison/: H1 and Hcurl conforming method as comparison

    iso/: isoHelix as an initial configuration for zero helicity

then run data_filter.py, this will compute the error |Q-Q(0)| for structure-preservation test. Once the .csv data is obtained,
the figures can be generated by running corresponding .tex files.

e.g.:

Fig1:
    python bejh/bejh.py
    python periodic/periodic.py
    pdflatex fig1.tex

Fig2:
    python bejh/bejh.py
    python periodic/periodic.py
    python data_filter.py
    pdflatex fig2.tex

Fig3:
    python hdiv/hdiv.py
    pdflatex fig3.tex

Fig4: 
    python data_filter.py 
    pdflatex fig4.tex

Fig5: 
    python cg_hcurl_comparison/cg-avfet.py
    python cg_hcurl_comparison/hcurl-avfet.py
    pdflatex fig5.tex

Fig 6: 
    python iso/iso-bejh.py
    pdflatex fig6.tex

Thank you so much for your interests!
