Output of the solution of a assigned point

Dear Professor,

I hope everything is fine with you.
Let me briefly describe the problems we have discussed. I want to obtain the displacement of the elastic system over time. My problem is that the sequential code could provide the correct resolution, while the parallel code with PETSc (even though only one single process) given me a different resolution with that of the sequential code. Obviously, for the trends and values of the resolution from the parallel code, it was wrong.
You suggested me to figure out the reason for the differences in the resolution between the sequential and parallel (one process) codes. I have carefully compared the two codes. The parallel code was transformed rigorously from the sequential code based on the examples of elastic_PETSc. I even converted the three-dimensional system into a simplest two-dimensional system, the similar problem still existed. Therefore, I think the reason for the differences between the two codes is not the compilation error of the parallel code, and may be the improper solver.

I searched the similar problems in the community of FreeFem++. There are several posts also show that the sequential code could give right resolution (about residual error), while the parallel with PETSc provide strange results. You suggested that the reason may be the improper solver. I have tried to change the solver in my code according to your suggestion, while the resolution also was wrong.

I really don’t know how to solve this problem, which is difficult for me. So, could you please help me to figure out this problem?
The simple sequential and parallel codes for 2D elasticity system are attached here.
Parallel with PETSc_2D.edp (3.3 KB)
Sequential_2D.edp (2.1 KB)
Please check them.

Give you my best wishes.
Liu

In one script, you are using a varf. In the other, you are using solve. Do you have a sequential script without any reference to PETSc that works with a varf instead of solve? Could you provide that code instead as the reference for Sequential_2D.edp?

Dear Professor,

Thank you very much for your reply.
I do not have a sequential script without any reference to PETSc that works with a varf.
I found that the problem may be caused by the unsuitable variational form in the parallel code.
The variational form should refer to “Tutorial to write a transient Stokes solver in matrix form” in the FreeFEM Documentation. Do you think so? If so, I will learn to change the variational form in the parallel code.
Thank you very much.

Best,
Liu

You need to first convert your sequential script with no PETSc with solve to a sequential script with no PETSc with varf. There is no point trying to parallelize an incorrect script.

OK, I will do that. Thank you so much for your help, professor.