How to run FreeFEM++ code in MATLAB with minimum message shown in MATLAB command windows?

I’m running MATLAB to execute a FreeFEM++ file. Currently everything is fine, except that I do not want the FreeFEM++ code to be shown in the Matlab command window. Here is an example to explain my question. I execute a FreeFEM++ file titled “FF1.edp” through the following matlab code:

system(['FreeFem++ ',‘FF1.edp’]);

There is only one line of code in FF1.edp file, which is as follows:

cout << “This is my FF+ file!” << endl;

While in the command window of MATLAB, a lot of message appears, as shown in the following screen caption.

These messages generated from FreeFEM++ are pretty messy, especially in the case if I’m running a file with many lines of code. I wonder if there is a way to minimize the amount of these message, so that I can have a clean command window in MATLAB? Thank you.

FreeFrem++ -v 0 should help I think. You can also redirect the output into a file.

1 Like

Very neat solution, it works perfect, thank you!

and add FreeFrem++ -v 0 -ns to remove the dump of the script.

the list of freefem parameters

	-f:     [filename]  script file name
	-v:     [verbosity] level of FreeFEM output (0 - 1000000)
	-nw:                no graphics
	-wg:                with graphics
	-ne:                no edp script output
	-cd:                change directory to script directory
	-cdtmp:             change directory to /tmp
	-jc:                just compile
	-ns:                same as -ne
	-nowait:            do not wait graphics at the end
	-nc:                without console (MS Windows only)
	-log:               with console (MS Windows only)
	-wait:              wait graphics at the end
	-fglut: [filename]  redirect graphics in file
	-glut:  [command]   use custom glut
	-gff:   [command]   use custom glut (with space quoting)
	-check_plugin [plugin1,plugin2,...]        just try if this plugins are correct
	-?:                 show help

1 Like

Hello I have a follow up question. I’m using Mshdist as an external package in FreeFEM++ by using the following command:

exec(mshdist filename)

Although it works, a lot of output information appears in the command window as well. I wonder how to decrease the level of verbosity for Mshdist as well.

I know that FreeFEM++ has its own function, distance, for similar purpose with Mshdist, but it seems that Mshdist is more accurate than distance in some cases.

To suppress FreeFem output, use the argument -v 0 when calling FreeFem++ or FreeFem++-mpi. You will have to look into the documentation of other packages to learn how to suppress outputs from them.