Hello to all of you FreeFem users,
Thank you for your help in advance.
Acoording to the documentation, in a problem, the keyword init controls the reconstruction of the internal problem matrix. If init is set to false or 0, the matrix is reconstructed at each problem calls (or after a mesh modification), else the previously constructed matrix is used.
Typically, I set the value of init to be1 to reduce the reconstruction cost. However, if the matrix depends on a parameter that needs to be changed at some steps, the matrix must also be modified to solve the problem correctly. With the init set to 1, the only method I know to update the matrix is to remesh the domain, which is inefficient. I am wondering if there is another method to update the matrix in this problem.
Below is the code that shows the matrix doesn’t change unless I remesh the domain.
mesh Th = square(10,10);
fespace Vh(Th, P2);
Vh w,u=1.0;
real dl=1., dr=1.;
problem pbU (u,w, init=1, solver=LU)
= int2d(Th)(
(dx(u)*dx(w)+dy(u)*dy(w))*dl)
-int2d(Th)(1*w*dr)
+ on(1, 2, 3, 4, u=0);
pbU;
plot(u,wait=0, fill=1, value=1,aspectratio=0, WindowIndex=0 );
dr=10.;
pbU;
plot(u,wait=0, fill=1, value=1,aspectratio=0,WindowIndex=1 );
dl=10.;
pbU;
plot(u,wait=0, fill=1, value=1,aspectratio=0, WindowIndex=2);
Th = square(10,10);
pbU;
plot(u,wait=0, fill=1, value=1,aspectratio=0, WindowIndex=3);