Include "macro_ddm.idp"

How do I query these commands? Not quite understanding the meaning of these commands, the guide to FreeFEM Documentation
Release 4.8 did not find the meaning of these commands. For example ,

include “macro_ddm.idp”
or

getARGV(“-global”, 40) and so on.

include “macro_ddm.idp” loads the domain decomposition subroutines of FreeFEM, the source of which can be found in the GitHub repo or the “idp” directory in your local installation. It’s always crucial to call it after loading the PETSc module (load "PETSc") and defining the “dimension” macro (like macro dimension()3// EOM for 3D cases). you may have a look at the “macro_ddm.idp” file to check what else it can do and what parameters it brings to the code.

generally speaking, getARGV("-global", 40) does nothing but looking for the -global flag in the execution command of FF, returning the provided value if it exists or 40 otherwise. as an example, for a variable definition like int X = getARGV("-global", 40), executing FreeFem++ test.edp -global 10 results to X being 10, while executing ``FreeFem++ test.edp` initializes X to the provided default value, which is 40 in this case. seeing this in lots of HPDDM/PETSc examples in FF is to let the users define the number of mesh partitions via command line arguments, which can be controlled by changing the number of MPI processes as well.

1 Like

If I define a grid partition, do the following two commands yield the same partition?

mesh Th = square(4,4,[-8+16x,-8+16y]);
or

mesh Th = square(getARGV(“-global”, 4), getARGV(“-global”, 4),[-8+16x,-8+16y]);

this doesn’t create any partition, but the result of both scripts is the same mesh, yes, if no -global flag is passed to FF.

1 Like

Thanks for your answer. Is there reference book for this parallel version of FreeFem ++ -mpi ?

there are some explanations for ffddm in the documentation, but if you mean HPDDM, the best reference to refer to at this moment is Pierre’s tutorials on parallel FF, here and here.

buildMat(Th, getARGV(“-split”, 1), A, Pk, mpiCommWorld)

Hello, what do the second and last parameters mean? What is the purpose of this command?

Do not use this macro, it’s deprecated. Use createMat instead.

OK, thank you. In fact, I downloaded the latest version of freefem++4.11, and the examples it provides are still using this command.

Yes, but you should not use it.

Yes, thank you. What is the meaning of the createmat command? My understanding of it is not very clear. Could you please explain it?

I already told you to look at Pierre Jolivet introduction to parallel FreeFEM part 1 - YouTube which explains the command extensively.

OK, thanks. Maybe it’s because the video is in French. I’m not very clear. I suggest you write a guide to parallel versions. thank you very much indeed

The video is in English. This is proof that you didn’t even open it.

mesh Th = square(getARGV(“-global”, 30), getARGV(“-global”, 30));
bool adaptation = usedARGV(“-adaptation”) != -1;
macro Pk() [P2, P2, P1, P1];
real[int] D;
int[int][int] intersection;
mesh ThBackup;
{
if(adaptation)
ThBackup = Th;
int s = getARGV(“-split”, 1);
build(Th, s, intersection, D, Pk, mpiCommWorld)
}

Hello, is this command
build(Th, s, intersection, D, Pk, mpiCommWorld)
mainly for grid construction?