Skip to content

Implement config file support for disk parameters #2

@husnedereli

Description

@husnedereli

Issue 2: Configurable Parameter Input via Files
Currently, parameters like black hole mass (M), accretion rate (M_rate), inclination angle (inc_angle), and disk radii are hardcoded. Add support for reading these from a JSON or plain-text config file (e.g., disk_config.txt) at runtime, allowing users to easily tweak simulations without recompiling. Extend this to output computed parameters (e.g., gravitational radius Rg) to a log file for reproducibility.

Benefits:
Improves usability for parameter sweeps or comparative studies, and makes the code more modular for integration with Python wrappers (like the existing AD_module.pyx).

Implementation Notes:
Use a simple parser (e.g., via fscanf or a lightweight JSON library like cJSON) in an initialization function. Validate inputs to prevent invalid states (e.g., negative radii). Relevant code sections: accretion_disk.c:150-170 (hardcoded parameters), and initialization in functions like make_computation or compute_LC.

Example Config Format:

M: 3.2e7
M_rate: 1.0
inc_angle: 45.0
r_in: 6.0
r_out: 10000.0

Add more as needed

Labels: enhancement, usability

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions