{"id":22668161,"url":"https://github.com/lanl/nubhlight","last_synced_at":"2025-04-12T11:04:01.402Z","repository":{"id":38185348,"uuid":"238533805","full_name":"lanl/nubhlight","owner":"lanl","description":"General Relativistic Neutrino Radiation Magnetohydrodynamics for Neutron Star Merger Disks","archived":false,"fork":false,"pushed_at":"2024-12-08T22:25:24.000Z","size":1209,"stargazers_count":31,"open_issues_count":10,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-08T22:28:29.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-05T19:42:48.000Z","updated_at":"2024-11-19T06:02:51.000Z","dependencies_parsed_at":"2024-07-10T16:01:52.988Z","dependency_job_id":"22024633-f535-41ed-9282-d03f8dcbae9f","html_url":"https://github.com/lanl/nubhlight","commit_stats":{"total_commits":160,"total_committers":11,"mean_commits":"14.545454545454545","dds":"0.22499999999999998","last_synced_commit":"59755b0d941aac1bcde40ddbf9cdd0b01500409e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fnubhlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fnubhlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fnubhlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fnubhlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanl","download_url":"https://codeload.github.com/lanl/nubhlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228911959,"owners_count":17990774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T15:13:57.994Z","updated_at":"2025-04-12T11:04:01.395Z","avatar_url":"https://github.com/lanl.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"nubhlight: General Relativistic Neutrino Radiation Magnetohydrodynamics with Monte Carlo Transport\n===\n\n![Build Status](https://github.com/LANL/nubhlight/actions/workflows/tests.yml/badge.svg)\n\n![divergence-rates](data/gw170817-sinh10-divergence-rates-tavg.png)\n\nThis software is approved for open-source release under LA-CC number C20019. Nubhlight was first presented in\n\n- [Miller, J. M., Ryan, B. R., Dolence, J. C. 2019, ApJS, 241:2](https://doi.org/10.3847/1538-4365/ab09fc)\n\nand is based on [ebhlight](https://github.com/AFD-Illinois/ebhlight), first presented in\n\n- [Ryan, B. R., Dolence, J. C., \u0026 Gammie, C. F. 2015, ApJ, 807:31](https://doi.org/10.1088/0004-637X/807/1/31)\n\nThe above picture is from nubhlight's first application, modeling the 2017 neutron star merger event:\n\n- [Miller, J. M. et al. 2019, PRD, 100:2](https://doi.org/10.1103/PhysRevD.100.023008)\n\nAll academic work derived from this software should reference these\npublications. Questions, comments, and bug reports should be filed as\ngithub issues. Pull requests are welcome.\n\n# NUMERICAL SCHEME\n\nnubhlight solves the equations of general relativistic radiation\nmagnetohydrodynamics in stationary spacetimes. Fluid integration is\nperformed with a second order shock-capturing scheme ([HARM; Gammie,\nMcKinney \u0026 Toth 2003](https://doi.org/10.1086/374594)).\nFrequency-dependent radiation transport is performed with a second\norder Monte Carlo scheme ([GRMONTY; Dolence et\nal. 2009](https://doi.org/10.1088/0067-0049/184/2/387)). Fluid and\nradiation exchange four- momentum in an explicit first-order\noperator-split fashion.\n\n# DEPENDENCIES\n\n## Software\n\nnubhlight is written in C99. It requires the following external libraries:\n  - GSL\n  - MPI\n  - Parallel HDF5\n  - gfortran (if Burrows opacities are used)\n\nConfiguration and analysis scripts are written in Python 3, and employ\nmatplotlib, numpy, and h5py.\n\nIf using gcc, version 4.9 or later is recommended.\n\n## Data\n\nFor realistic problems, nubhlight relies on tabulated nuclear\nequations of state and opacities and emissivities.\n- A native reader exists for the opacities released on\n[stellarcollapse.org](https://stellarcollapse.org/).\n- A FORTRAN reader exists for opacities developed by the Adam Burrows' group.\n- An HDF5 reader exists for opacities defined in `nubhlight`\n  format. See `core/opac_emis_hdf.c` for the reader and for\n  information for how to define your own such table.\n- The HDF5 opacity reader does not exactly support NuLib opacities,\n  however, [a fork of\n  NuLib](https://github.com/Yurlungur/NuLib/pull/1) exists that\n  contains the relevant modifications to run with nublhight.\n\n\n# CLANG FORMAT\n\nclang-format is used to format source files. It's part of the clang\ntoolchain and can be found and described [here](https://releases.llvm.org/3.8.0/tools/clang/docs/ClangFormat.html).\n\nYou can integrate clang-format into your editor. You can also add it\nas a git pre-commit hook so that all your changes are automatically\nformatted. To enable this, copy\n`script/dependencies/pre-commit.clang-format` into your git hook. e.g.,\n\n```bash\ncp script/dependencies/pre-commit.clang-format .git/hooks/pre-commit\n```\n\n# CONFIGURATION\n\nA custom build script is used for each problem to:\n  - Set compile-time code parameters\n  - Set machine-specific dependency locations\n  - Collect copies of all required source files\n  - Write a problem-specific makefile\n  - Call make to compile the source and create an executable\n  - Clean up temporary files\n\nTo run, for example, the Sod shocktube problem:\n```bash\ncd bhlight/prob/sod\npython build.py\n./bhlight -p param_template.dat\n```\n\n# I/O\n\nFile input and output are performed with HDF5. In the active output directory,\ndumps/ and restarts/ folders are created, holding dump and restart output,\nrespectively. Output directories may be specified at runtime by passing the flag\n\n```bash\n-o /path/to/output/directory/\n```\n\nto the executable.\n\n# AUTOMATIC TESTING\n\nScripts are provided for automatically running and analyzing certain test\nproblems.\n\nTo run, for example, the Sod shocktube test:\n```bash\ncd bhlight/test/\npython sod.py\n```\nwhich will produce `sod.png` in the current directory, showing the numerical and\nanalytic solutions.\n\nSeveral automatic tests are run through continuous integration on\ncommit. Tests must pass before a pull request will be merged.\n\n# RUNTIME PARAMETERS\n\nRuntime parameters are read in from a (required) parameters file passed to the \nexecutable as `-p path/to/parameter/file`. A default param.dat file is generated\nalongside the executable by the build routine. Note that this build routine \noverwrites param.dat each time it is called -- if you wish to preserve your \nruntime parameters, change the filename from param.dat. \n\nProblem-specific runtime parameters are also available. Each `problem.c` file \ncontains a routine void `set_problem_params()`. To include a problem parameter\n\"test\" (here a double, but 'int' and 'string' are also allowed) accessible from \nthe parameter file, there are three steps:\n\n- Define your variable in problem.c in file scope (internal linkage \nrecommended)\n\n- Call the parameter read function inside set_problem_params()\n\nAfter these steps you should have\n```C\nstatic double test;\nvoid set_problem_params()\n{\n  set_param(\"test\", \u0026test);\n}\n```\n\n- Use the problem's build.py script to request your new variable as a runtime\nparameter, with the line `bhl.config.set_rparm('test', 'double', default = 100)`\n\nThe 'default' parameter is optional.\n\n# Copyright\n\ncopyright 2020. Triad National Security, LLC. All rights reserved.\nThis program was produced under U.S. Government contract\n89233218CNA000001 for Los Alamos National Laboratory (LANL), which is\noperated by Triad National Security, LLC for the U.S.  Department of\nEnergy/National Nuclear Security Administration. All rights in the\nprogram are reserved by Triad National Security, LLC, and the\nU.S. Department of Energy/National Nuclear Security\nAdministration. The Government is granted for itself and others acting\non its behalf a nonexclusive, paid-up, irrevocable worldwide license\nin this material to reproduce, prepare derivative works, distribute\ncopies to the public, perform publicly and display publicly, and to\npermit others to do so.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fnubhlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanl%2Fnubhlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fnubhlight/lists"}