# Output of the solution of a assigned point

**URL:** <https://community.freefem.org/t/output-of-the-solution-of-a-assigned-point/2012>\
**Category:** General Discussion\
**Created:** [September 18, 2022, 3:50am UTC](https://community.freefem.org/t/output-of-the-solution-of-a-assigned-point/2012 "2022-09-18T03:50:06Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![SHENG](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@SHENG](https://community.freefem.org/u/SHENG)\
**Post date:** [September 20, 2022, 12:56pm UTC](https://community.freefem.org/t/output-of-the-solution-of-a-assigned-point/2012/5 "2022-09-20T12:56:49Z")

</div>

Dear Professor,

According to your suggestion, I have added “-pc\_type lu” in the set of sparams. However, the solutions with time iteration is still wrong.  
The parallel computing code is as follows,  
"…  
…  
fespace Vh(Th,Pk);  
Vh [u,uB,uC], [v,vB,vC],[u1f,u2f,u3f]=[.0,.0,.0],[u1b,u2b,u3b]=[.0,.0,.0];  
…  
varf Lame([u,uB,uC],[v,vB,vC])  
=int3d(Th)(density_idt2_u_v)-int3d(Th)(density_2_idt2_u1f_v)+int3d(Th)(density_idt2_u1b_v)+  
int3d(Th)(density_idt2_uB_vB)-int3d(Th)(density_2_idt2_u2f_vB)+int3d(Th)(density_idt2_u2b_vB)+  
int3d(Th)(density_idt2_uC_vC)-int3d(Th)(density_2_idt2_u3f_vC)+int3d(Th)(density_idt2_u3b_vC)+  
int3d(Th)(lambda_div(u,uB,uC)div(v,vB,vC)+2.mu( epsilon(u,uB,uC)'epsilon(v,vB,vC)))  
+ on(1001,u=0.,uB=0.,uC=0.00001(1.-2.(pi_f\*(t-tt))^2)_exp(-(pi_f\*(t-tt))^2))  
+on(2001,2002,2003,2004,2005,2006,2007,u=0.,uB=0.,uC=0.);

[u1b,u2b,u3b]=[0.,0.,0.];  
[u1f,u2f,u3f]=[u1b,u2b,u3b];  
[u,uB,uC]=[u1f,u2f,u3f];

Mat A;  
createMat(Th, A, Pk)

for(int i=0;i\<100;++i) {   
t=t+dt;

matrix Loc = Lame(Vh, Vh,tgv=-1); //solve the problem  
real[int] rhs = Lame(0, Vh,tgv=-1);  
set(A, sparams = “-ksp\_view -ksp\_max\_it 100 -pc\_type lu”);  
Vh def(u); // local solution  
A = Loc;  
u = A^-1 \* rhs;

macro def1(u)u// EOM

//Time iteration of displacement  
[u1b,u2b,u3b]=[u1f,u2f,u3f];  
[u1f,u2f,u3f]=[u,uB,uC];

macro params()cmm = “Global solution time=”+t, fill = 1// EOM  
plotMPI(Th, def1(u), P1, def1, real, params)

int[int] Order=[1,1];  
savevtk(“uhydrate6\_y.vtu”, Th,[u,uB,uC], dataname=“[u,uB,uC]”, order=Order,append = true);  
}."  
The obtained solution significantly monotonically increases with number of iterations from (negative solution)^20 to (positive solution)^20. Such solution is apparently wrong. Because the solution should be fluctuating around 0, the solution has been obtained from serial calculation code using FreeFem++.

Please give me some advice. Thank you very much.

Best regards,  
Liu

---

_[View the full topic](https://community.freefem.org/t/output-of-the-solution-of-a-assigned-point/2012)._
