Sorry to bother you. If I want to modify the source code in a case, where can I find the correct .f file location of the variable I want to modify? For example, I want to add a new body force into the momentum equation.
Is there a relevant help manual to guide the usage of the code and the meaning of variables in the source code?
Hi ZhuHe.
Unfortunately there is no such search facility built into the MFiX GUI. There is the ability to search for file names, but not for variables. This might get added in a future MFiX version but for now the built-in IDE is pretty simple.
If you’re going to be modify the code, and need to find where symbols are defined, you have a few options.
The easiest thing to do is use the ‘grep’ command - this is standard on Linux and should be available on Windows if you have set up MFiX in a Conda environment.
Linux:
$ cd $conda_prefix/share/mfix/src
$ grep -ir SYMBOL
Windows
C:> cd %CONDA_PREFIX%\share\mfix\src
C:> grep -ir SYMBOL
where SYMBOL
is the variable you are interested in.
The -i
flag makes grep
ignore case, and -r
makes it search recursively through all files and subdirs.
You could also try using an external IDE for Fortran. I’m not sure what platform you are on so I don’t know what options you have.
I do my development work in Emacs but it has a pretty steep learning curve. Emacs has a facility called tags
which indexes all variable and function definitions. I believe this is also supported in the vi
editor.
Hope this helps,
– Charles
Thanks! It solved my problem.