How to use SplitElements_Alfeld() method for Scott-Vogelius elements?

I want to have Scott-Vogelius elements divided in the barycenter to have free divergence continuous velocity. However, when I write:

# Previously defined geo)
mesh = Mesh(geo.GenerateMesh())

I get the following error:

AttributeError: ‘ngsolve.comp.Mesh’ object has no attribute ‘SplitElements_Alfeld’;

I have ngsolve up to date, so I don’t understand how the attribute is not recognized. I thank you for your help in advance! :slight_smile:

Which version of NGSolve are you using ? This should be a pre-release feature.
I attach an example script that is working with the last ngsolve release.
You can also do Alfeld splitting in 2 and 3 dimension using ngsPETSc, here the example: PETSc DMPlex — ngsPETSc 0.0.1 documentation

Thank you very much for the answer! I have some issues installing PETSc in my Mac M1, so I installed the compiled version of NGSolve (without stubs, I had errors while installing with stubs also) and I was able to use SplitElements_Alfeld() functionality :slight_smile: