Some problems with the Command line

Hi, I am running the mfix with command line (for windows 10 and mfix 23.3.1)
From the user guide book, i use the command line: mfixsolver -f tfm_2d_ug_045.mfx to solve the project.
the folder is shown below:
image
But the Prompt shown the errer message:
“mfixsolver” is not an internal or external command, nor is it a executable program or batch file

Then I try the command:
mfixsolver -f tfm_2d_ug_045.mfx
the error changed:
unrecongnized arguments:-f

Then i try to get the help document:


I change the commandline into:
mfixsolver project tfm_2d_ug_045.mfx
it report the error:
unrecongnized arguments: tfm_2d_ug_045.mfx
Could anyone help me how to deal with this problem?

Hi @yuxuan
I think you have confused the mfix and the mfixsolver commands.

The first command:

mfixsolver -f tfm_2d_ug_045.mfx

is correct. You would get an error “mfixsolver” is not an internal or external command if the current directory is not the project directory, or if you did not build a custom solver.

I think the next thing you tried must have been mfix -f tfm_2d_ug_045.mfx
not mfixsolver -f ... as you wrote above. (I can tell this is not a direct copy/paste from the terminal due to your misspelling of " unrecongnized") Please show exactly the commands you used, copying and pasting from the terminal is best.

The mfix command will start the main MFiX interface, while the mfixsolver just runs the modeling backend. For mfix, the project name is specified without the -f flag while for mfixsolver the -f flag is necessary. This slight inconsistency is possibly confusing for users.

The help text you pasted was from mfix -h, not mfixsolver -h. Here are the two outputs:

(mfix-23.3.1) c:\tmp>mfix -h
usage: mfix [-h] [-s STYLE] [-n] [-w] [-k] [-g] [-d] [-c] [-t] [-ct] [--save] [-v] [project]

MFiX GUI

positional arguments:
  project               open mfix.dat or <RUN_NAME>.mfx project file or search a specified directory for project files

options:
  -h, --help            show this help message and exit
  -s STYLE, --style STYLE
                        specify app style ['windowsvista', 'windows', 'fusion']
  -n, --noload          do not autoload previous project
  -w, --nonodeworks     do not load the nodeworks environment
  -k, --novtk           do not load vtk
  -g, --default_geo     use default geometry, don't restore previous state.
  -d, --developer       enable developer mode.
  -c, --clear           clear all saved settings.
  -t, --test            enable test mode.
  -ct, --thumbnails     create thumbnails in test mode.
  --save                save the project in test mode.
  -v, --version         show program's version number and exit

“Positional arguments” means they are just specified on the command line without any flag at all.

 mfix [-h] [-s STYLE] [-n] [-w] [-k] [-g] [-d] [-c] [-t] [-ct] [--save] [-v] [project]
positional arguments:
  project               open mfix.dat or <RUN_NAME>.mfx project file 

means that the name of the project file takes the place of [project] on the command line… you just say

mfix foo.mfx

For mfixsolver the flags are different:

(mfix-23.3.1) c:\tmp>mfixsolver -h
Welcome to PYMFiX

options:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  specify an input file (*.mfx or *.dat)
  -m MFIXSOLVER, --mfixsolver MFIXSOLVER
                        full path to mfixsolver module (mfixsolver.so, mfixsolver_dmp.so, etc.)
  -d DIRECTORY, --directory DIRECTORY
                        directory containing mfixsolver.so (deprecated, use -m)
  -p, --print-flags     display the solver configuration flags
  -l LOG, --log LOG     set logging level (ERROR, WARNING, STATUS, INFO)
  -c, --clean           clean output files before starting run
  -s, --server          start HTTP server

When you use the GUI to start/stop the simulation, mfixsolver is launched automatically with the correct options. If you are starting from the command line for whatever reason, you need mfixsolver -f myfile.mfx

so nice for this fully reply! i would try more to get deeper understanding of the commandlines from MFIX, thank you!

hi, i have tried again, but the situations of different version are different. I have cd to the directory of prpoject. When i use mfixsolver -f ###.mfx commands in version 20.2.1, the project can run with the defaut solver. but if i use this command in version 23.3.1, there would be error:
(mfix-23.3.1) F:>cd F:\MFIX\1
(mfix-23.3.1) F:\MFIX\1>mfixsolver -f tfm_2d_ug_2_us_05333.mfx
'mfixsolver 'is not an internal or external command, nor is it a executable program or batch file.

I will fix this in the next release. For now, build an mfixsolver executable in the project directory, either by clicking the “wrench” icon in the GUI, or running build_mfixsolver (in the project dir)

Or better yet build_mfixsolver -j which will be faster

This problem (mfixsolver: command not found) is fixed in MFiX version 23.3.2