Hi FreeFem developers!
I use FreeFem to implement shape optimization for nonlinear mechanics and I am trying make the entire solver parallel. To begin with, I started with the example elasticity-3d_PETSc.edp from FreeFem examples. The first few lines read
macro dimension()3// EOM // 2D or 3D
macro vectorialfe()P1// EOM
include "macro_ddm.idp" // additional DDM functions
…
Mat A;
buildMat(Th, getARGV("-split", 1), A, Pk, mpiCommWorld, 3)
This works perfectly fine and I have the correct displacement solution. However, I want the store the global solution and in one of your previous posts, I read that I should call the restrict operator, for which I must use
buildDmesh(Th)
createMat(Th, A, Pk);
instead of buildmat.
When I do that, I get an error
build(Th, 1, intersection, privateDmeshThkhi[0], P1, ThComm)Error in macro expansion build, we wait for , and we get )
number of macro parameter in definition is 7
0 in elasticity-3d-PETSc.edp line : 21
2 in macro: buildDmesh in /usr/local/lib/ff++/4.7-1/idp/macro_ddm.idp line : 470
current line = 469 mpirank 0 / 4
Compile error : Wrong number of parameter in macro call
line number :469, )
error Compile error : Wrong number of parameter in macro call
However, if I declare
macro vectorialfe()P1// EOM
after including the macro_ddm.idp instead of declaring it before, buildDmesh and createmat work fine. But when I plot the displacement u, it seems erroneous.
Kindly help me troubleshoot this issue and to understand macro_ddm.idp.
If this query has been addressed earlier somewhere, I apologize.