PETSc integration of the non linear schrodinger equation

Hoping that it can be helpful, I attach a code for parallel integration of the non-linear Schrodinger equation in a circular domain using PETSc/SLEPc.

fiber-circle-time-SLEPc.edp (9.0 KB)

The code uses an implicit midpoint integrator and initializes the wavefunction to an eigenvector of the linear Schrodinger equation (or their linear combination).

Best wishes,
Alexei

Nice example. Just FYI, you should consider ditching the build macro and use DmeshCreate()/MatCreate() instead.