phantom icon indicating copy to clipboard operation
phantom copied to clipboard

Disabling writing files for use of Phantom as a library

Open rieder opened this issue 5 months ago • 1 comments

I am reworking the AMUSE interface to Phantom, since Phantom has progressed since I wrote it initially.

The main change I need to make to Phantom for use with AMUSE is a way to prevent Phantom from writing any files (evfile, dumps, logs...). We would basically use it as a library, and any i/o would be handled through AMUSE. Output to screen is still fine.

Would it be ok to introduce a "dont_write_files" logical of some kind, e.g. in the options module, which is then checked wherever a file would be written?

The main difficulties without this are in functions/subroutines that don't just write files, but that also calculate things that are required later on. I would have to write largely-identical functions without the i/o part, which would be hard to maintain.

rieder avatar Feb 08 '24 11:02 rieder

we should really merge the AMUSE interface stuff into phantom, it's been hanging there for a while... an option in the options module sounds fine in principle, it should not appear in the phantom .in file though, just set to .true. if called via the library and .false. otherwise.

If you can send a pull request that is updated to the latest code I'd be happy to give a code review

danieljprice avatar Feb 09 '24 01:02 danieljprice