Computing numerical solution with parallel version

Trying to write a parallel version, in fact, is it wrong?

load “PETSc-complex” // PETSc plugin
macro dimension()2// EOM // 2D or 3D
include “macro_ddm.idp”
real omega=1,lambda=0.5;//
real Tf=0.5;
real t0=0;
int m1=4,n1=4;
mesh Th=square(m1,n1,[x,y]);
fespace Xhf(Th,P2);
real dt=Tf/b(mm-1);
Xhf psai2,u,F,F1,F2;
Xhf psai0=(exp(-2x^2-2y^2))(x+1iy)/(x^2+y^2+1);
Xhf psait0=1ipsai0;
Xhfpsai1=psai0+dt
psait0;
real m=abs(psai1);
varf va(psai2, u)= int2d(Th)(2psai1u/(dt^2))
+int2d(Th)(0.5dx(psai2)dx(u)+0.5dy(psai2)dy(u))
+int2d(Th)(0.5
psai2
u)+on(1,2,3,4,psai2=0);
varf rhs(psai1,u)=int2d(Th)(2psai1u/(dt^2));
varf rhs1(psai0,u)=-int2d(Th)(psai0u/(dt^2))
-int2d(Th)(0.5
dx(psai0)dx(u)+0.5dy(psai0)dy(u));
Mat A;
createMat(Th, A, P2); //
A = va(Xhf, Xhf);
Mat B;
createMat(Th, B, P2); //
B = rhs1(Xhf, Xhf);
Mat C;
createMat(Th, C, P2); //
C= rhs(Xhf, Xhf);
for ( real t=0+2
dt; t<=Tf ; t+=dt)
{
F1= B * psai0;
F2=C * psai1;
F=F1+F2;
set(A, sparams ="-pc_factor_mat_solver_type mumps ");
psai2=A^-1 * F;
psai0=psai1;
psai1=psai2;
}

We cannot copy/paste your code. Try it and you’ll see it does not run.

Sorry, I uploaded the wrong code yesterday. This is the original code. It is a small program for calculating the convergence order of time written by

load “PETSc- complex”

, but it is different from the result I wrote by

load “mumps_mpi”

. Am I thinking because the former is wrong?
example.edp (2.2 KB)

Start with something simple, e.g., Poisson equation, instead of going directly for your full model. It’s near impossible to debug otherwise (at least I can’t help you).