idefix icon indicating copy to clipboard operation
idefix copied to clipboard

[ENH] Customization feature to choose a directory for dumping of log files during runtime

Open dutta-alankar opened this issue 1 year ago • 1 comments

Customization feature to choose a directory for dumping of log files

Often having a custom directory for dumping of log files is very useful to have the code files and executable separated from the location of data dumps. In this PR, this can be achieved by specifying log_dir in the Output block of idefix.ini. I remember that PLUTO already has such an option and it was quite helpful to me, personally as it prevented me to from accidentally overwriting the log files. I hope the developers find this a useful feature to have.

I tested with the KHI HD problem. Also sharing the relevant .ini file and the cmake command used is: cmake $IDEFIX_DIR/ -DIdefix_MPI=ON -DIdefix_HDF5=ON -DCMAKE_CXX_FLAGS="-DXDMF_DOUBLE"

Contents of idefix.ini

[Grid]
X1-grid    1  0.0  1024  u  4.0
X2-grid    1  0.0  256   u  1.0
X3-grid    1  0.0  1     u  1.0

[TimeIntegrator]
CFL         0.2
tstop       5.0
first_dt    1.e-5
nstages     2

[Hydro]
solver    hllc
csiso     constant  10.0

[Boundary]
X1-beg    periodic
X1-end    periodic
X2-beg    outflow
X2-end    outflow
X3-beg    outflow
X3-end    outflow

[Output]
vtk    0.01
xdmf   0.01
vtk_dir     ./output
xdmf_dir    ./output
log_dir     ./output/Log_Files

dutta-alankar avatar Sep 27 '24 11:09 dutta-alankar

This has small changes in global.cpp and global.hpp. Let me know if that is acceptable. Otherwise, I'll think of a smarter way that would only change input.cpp and input.hpp.

dutta-alankar avatar Sep 27 '24 11:09 dutta-alankar