Can it possible to find L^2-error and order of convergence in Heat-3d PETSc code (parrallel computing)

Respected prj sir, i have run heat-3d petsc code in window commant promt.
But i wondering why plot command does not is giving plot in command promt.
heat-3d.edp (5.0 KB)

Blockquote
plotMPI(Th, u, Pk, def, real, cmm = “Global solution”);
This command does not creating plot. Can you help me pls??. It should give the plot.

One more important thing:
Can i find L^2-error and it corresponing order of convergence in PETSc code of Heat equation as we do in usual FreeFem++. Is there any demo example for that??. I am trying but getting problem.

Thanks in advance sir.

Yes, they are many ways to compute this, look at the examples.

Okay thank you sir. I will see the examples. But can you tell me why plot is not coming?. I have seen plot was coming when you have worked in the Tutorial 1 in windwos. But I am not getting any plot in command promt. I am using FreeFem v4.15 in window 11.

Thanks sir.

You are probably not using the -wg command line option.

Yes sir. I have not used that. Okay, i will try with that.

Can you tell me the examples name which computed L^2-errors and order of convergence sir.
This will help me to reach my goal.

Thanks in advance.

Sir, -wg command not working in my command promt. Programme not running if i write -wg-ns.
The following error comes :

But if it is without -wg-ns, then it is running fine.


(without -wg -ns)
Regarding error and order of convergence, i have seen the tutorial sir but i have not found any single example to compute that. Can you please tell me the specific example sir that can help me in this work.

Thanks in advance sir.

I need atleast one way to compute L2-error and order of convergence. Can you help me pls sir?. I am struggling with it.

Thanks in advance!.

Here PETSc example (heat-TS-2d-PETSc.edp) incorrectly imlpemented? - #11 by fb77
you can find the computation of L2 error (2d) as

//build partition of unity
fespace Vhpart(Th, P0);  // P0 elements for partition function
Vhpart part;  // Partition function
PartitionCreate(Th, part[], P0);  // Create partition using the mesh Th, part[] takes values 0 or 1

real localerr=int2d(Th)(part*(w-uexT)^2);
real globalerr;
mpiAllReduce(localerr, globalerr, mpiCommWorld, mpiSUM);
globalerr=sqrt(globalerr);
if (mpirank==0) cout << "t=" << t << " global L2 error " << globalerr << endl;

The order of convergence can be computed as in sequential codes.

1 Like

Thanks you so much sir :heart:
I have uploaded two more doubt in general discussion sir:
1) Modified Weak Galerkin for Heat equation.
2) Parabolic integro-differential equations.

You can check that sir when you will free. Thanks for your patience and time sir.


Sir, i don’t know why it taking time to run taking at least 6 min. Is it happening in your case also? . I am getting no plot also in command promt but it ran fine.

Thanks sir.