Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

give different inject modules distinctive names? #511

Open
rieder opened this issue Feb 21, 2024 · 2 comments
Open

give different inject modules distinctive names? #511

rieder opened this issue Feb 21, 2024 · 2 comments

Comments

@rieder
Copy link
Contributor

rieder commented Feb 21, 2024

Phantom has a number of modules that are called inject ("inject_asteroidwind", "inject_bondi.f90", etc.).
I guess this was done because they are never used together, and they are chosen with compile time options.

However, it becomes an issue when I want to build a single Phantom library for AMUSE, with the option to choose which inject module to use at runtime. This is currently not possible - I have to build different libraries for each option that I want to make available. This is impractical, especially since I can't use descriptive function names to point to the different inject modules (e.g. create_new_wind for inject_wind, etc.).

Would it be ok if I would change these modules so that they are given distinctive names, with the module to use chosen via a configuration option?
I could do this in a way that the module(s) built can still be selected via a Makefile option - but the different modules could then be combined in a single library.

Copy link
Owner

Yes in general I think this is a good idea, as it fits with the general move towards fewer compile-time options, instead the type of injection can be a runtime option. We could perhaps leave an inject_custom.f90 which could be replaceable at compile time but I think a few of the well supported ones should be included by default… that said they are often quite tied to the particular setup employed

@rieder
Copy link
Contributor Author

rieder commented Feb 22, 2024

I'll make a PR for this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants