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

Development #85

Open
wants to merge 179 commits into
base: release
Choose a base branch
from
Open

Development #85

wants to merge 179 commits into from

Conversation

srichers
Copy link
Collaborator

@srichers srichers commented Apr 2, 2023

No description provided.

nmford20 and others added 30 commits March 18, 2021 16:49
* Added descriptive amrex::Error messages in generate_code.py

Swtiched amrex::Abort to amrex::Error with descriptive error message

* added more to amrex::Error messages
…plifies the result without extraneous Is in real numbers
…agnitude and one that returns the magnitude squared. This will allow us to add the flux components without repeatedly square rooting and squaring.
…he minimum particle energy in initializing step to avoid doing a reduction over particles at every timestep under the assumption that particle energies do not change
…to limit timestep based on total lepton density
…s 0 because of equal numbers of neutrinos and antineutrinos by introducing a parameter (max_adaptive_speedup). When set to 0 it behaves exactly as before, except for the inclusion of the vacuum potential in the timestep calculation. When set towards infinity, it always allows the "optimized" timestep, which may itself become infinite if terms happen to cancel by chance, but otherwise is a much better estimate of the required timestep
…ding the ParticleContainer copy operator, fix mistake in conjugation of Hermitian matrices.
* added vscode and generated_files directories to the gitignore file

* added Minerbo closure initial conditions

* added references for the minerbo equations

* added a tad more explanatory text

* improved st5 code comments

* fixed coefficient in front of minerbo closure to make it have an expectation value of 1. Was getting results too small by a factor of 4pi before.

Co-authored-by: Sherwood Richers <srichers@caltech.edu>
* Copied Castro function for printing build information to screen

* Copy castro function for outputting information into plotfiles, simply deleting lines that don't work in emu

Co-authored-by: Sherwood Richers <srichers@caltech.edu>
* Revert "Added descriptive amrex::Error messages in generate_code.py (#53)"

This reverts commit 97499f2.

* add host tag to reduction lambda to allow code to compile on GPUs

* added input parameters for code comparison project

* fix code comparison initial conditions. Broadcast random nubers so all grids have the same set. Multiply perturbation amplitude by 0.5 to match convention with polarization vectors

* fix perturbation of antineutrinos to have correct sign relative to neutrinos

* added local perturbations initial conditions

Co-authored-by: Sherwood Richers <srichers@caltech.edu>
Co-authored-by: Sherwood Richers <srichers@berkeley.edu>
* first attempt at files to run Emu on Jenkins

* remove python package to allow python-is-python3 to install without conflicts

* add sympy python package

* fix capitalization

* tiny file rename

* use GPU-capable dockerfile, although GPU usage in dockerfile still has to be enabled somehow

* enable GPU usage

* enable GPU use in jenkins?

* remove debugging from compile and use proper name for compiled executable in jenkins script

* update dockerfile to version that includes nvidia development tools

* capitalization issue

Co-authored-by: Sherwood Richers <srichers@caltech.edu>
* Update Emu to use the latest AMReX with some modifications to the AMReX TimeIntegrator class.

* Update RNG API to use the new AMReX RNG interface (needed for DPC++ compiler).

* Compile with C++17 standard.

* Fixed compiler warnings when compiling with DEBUG=TRUE.

* Update RNG API for CPU-side RNG call.

* Update AMReX submodule hash to latest AMReX development branch.

* Until this line gets merged into AMReX for the Particle Saxpy function in the time integrator, this is a workaround.
shankar-1729 and others added 30 commits June 18, 2024 23:45
…U-arrays and sets them to corresponding MultiFabs
* Improving k_plot

* changed line endings to unix

---------

Co-authored-by: Sherwood Richers <richers@utk.edu>
Co-authored-by: Sherwood Richers <richers@utk.edu>
Co-authored-by: Sherwood Richers <richers@utk.edu>
The function does either outer_boundary or inner_boundary depending on which template parameter is true and which is false
We set (x,y,z) coordinates face-centered based on direction, and also set Vphase based on direction.
* Particles store the phase space volume they occupy

* set evolution equations for N and L to be zero in code generation script in anticipation of changing them based on opacities. Set Vphase to not evolve in time.

* whitespace

* infrastructure to set IMFPs and chemical potentials in the parameter file

* redefining f --> Nrho (before was f ---> Nrho)

* computing volume of phase space

* deleting lines that convert twice mu to erg

* adding delta E as an input parameter to compute phase space volume

* adding new input parameters to input files to run collitions

* adding collition term in QKE

* moving line that compute derivates, now it set the phase volume to zero meaning its time derivative its zero after it is used in collision term

* considering the particle that carry antineutrinos in the fast flavor test

* Fixing an error in the collision term

* including adaptative time step for absortion and emission

* creating vacuum paticles initial condition script

* adding attenuation parameter to the time derivative of N_Ab due to the hamiltonians

* solving mistake to compute time step due to collisions

* adding collision test input file

* testing if the particles converge to the expected equilibrium distribution

* solving issue to copy GNUmakefile_jenkins to Exec directory

* doing fast compilation in collision test

* clarifying better the collision time steps, now delta t collision is collision_CFL / ( c * max_IMFP )

* deletting renomarlization function. It will not be used anymore

* solving mistake in compilation comand to compile the code for 3 flavors

* Setting default collision time step to infinite. It will change if the code do collisions.

* setting right indentation

* including attenuation parameter to compute the time steps due to potentials

* computing minimum between time steps due to potentials and collision even if max_adaptive_speedup>1 is not satisfy

* solve mistake in chemical potential units in coment

* add coment on the energy units

* delete the individual parms arguments

* creating collisional flavor instability test

* delete print line

* now reads plt* files for time steps of more than 5 digits

* now reads plt files for time steps with more than 5 digits

* add function to initialize the background enviroment Ye, rho and T

* insert chemical potential for neutrinos and antineutrino independently

* set python script that generate initial condition for collisional instability test

* set input file for collisional instability test

* Create a Jenkins test for collisional flavor instability

* change cuda version to 7.0

* delete std cout line

* correct cuda version for jenkins

* change order of commands first reduce_data_fft.py then reduce_data.py

* delete function to initialize background quantities on this branch

* Solve mistake on collisional instability test. Now it read the right input file

* Solve mistake on collisional instability test. Now it read the right python script

* add python script for collision instability test

* solve problem of defining chemical potentials for antineutrinos in the input parameter file

* rename f -> N for particles

Beware: grid also has a Nij variable which is different

* finish renaming f -> N everywhere

* comment lines that assert if N and Nbar are negatives, this lines will be deleted since now N and Nbar will no longer be used

* change f for N in utility script to generate initial particles conditions

* modify initial condition script for msw test. now it gives N_ab instead of N and f_ab as input

* add comments to the function that read the initial conditions of the particles

* change msw test to include the change f_ab ---> N_ab

* reading N_ab for the particle initial condition file instead of N and f_ab independenly

* removing f_ab variables for N_ab when setting perturbation

* delete no needed lines

* repare coll_equi_test.py test to consider N_ab instead of f_ab

* making bypolar test work with the changes f_ab ---> N_ab

* making fast flavor test work for f_ab ---> N_ab

* making fast_flavor_k_test works for f_ab ---> N_ab

* delete print line

* delete print lines

* make attenuation parameter symbolic in code generation scripts

* move f-->N in a few more places

* change f to N in test scripts

* change Trf to TrN

* remove unused line

* setting right initial conditions for collisional instability test

* inteporlate T, Ye, rho from grid to particles, but return right value multiplied by 4

* solve mistake in interpolating rho, Ye and T from grid to particles posision, now the generation code script does not repeate the code 4 times

* delete print lines

* using the interpolated value of T for the calculation of the equlibrium distribution

* collisional instability test do not include a random perturbation on the off diagonal component of the density matrix. Not it use vacuum potentials.

* upload julien nsm input script

* solve mistake in energy average

* set right initial conditions for julien nsm simulation

* Modify collision instability test

The collision instaiblity test now includes the LSA in equation 14 of L. Johns [2104.11369]
Julien Frousley script to solve isotropic QKE is used to compare EMU solution
Plots are included all over the test but were commented

* Add collisions directory to store usefull script for simulations containing collisions

The script compute_dE.py is used to compute the energy bin size base on the expected equilibrium number of neutrinos

* Comments added to compute_dE.py script

* reordered scripts in jenkinsfile to clean up PR

* added line in data reduction scripts to prevent glob from picking up generated hdf5 files

* Deleting unnecessary variables in the script that generates initial conditions for the collision to equilibrium test (coll_equi_test.py).

This commit reduces code size by removing redundant variables in the st7_empty_particles.py script (Scripts/tests/coll_equi_test.py), which generates a set of particles with zero neutrinos and antineutrinos.

* Delete Julien's NSM input file from the initial conditions script directory.

* Removed opacities and chemical potential entries from input files that do not include collision simulations.

To avoid future confusion, I deleted the collision-related input options (opacities, chemical potential, and energy bin size) from input files used for tests without collisions.

* Added a more accurate description of the assert error for opacity methods.

The assert error now clearly indicates that the only available opacity methods are 0 (no collisions) and 1 (with collisions).

* Change variable type from double to Real to keep consistency

* Adding more comments to the script that computes the energy bin size for collision tests.

* Delete commented lines that are under development.

I deleted commented lines containing Julien's script that computes the collisional flavor instability evolution. This could potentially be included in the future to solidify the collisional instability test.

* Delete Python script of a previous test that will no longer be used.

* Delete Python script that generates the initial conditions of particles in Julien's NSM simulation.

* Delete old script used for testing convergence. It will no longer be used.

* Change N_eq to f_eq since this better represents the collision term.

f_eq is the Fermi-Dirac neutrino distribution for a given particle energy.

* Include option to multiply the inverse mean free paths by the Pauli blocking term.

A new input parameter was created (Do_Pauli_blocking). If set to 1, it will multiply the inverse mean free path by 1 / (1 - f_eq); if set to 0, it will do nothing.

* Adding a semicolon

* Adding the input parameter Do_Pauli_blocking to all input files.

I added the input parameter Do_Pauli_blocking to all input files to avoid errors caused by not reading this parameter during execution. If this parameter is set to 1, it will multiply the inverse mean free path by 1 / (1 - f_eq); if set to 0, it will do nothing. In the tests that don't involve collisions, it will not have any effect.

* Correction in the collision term of QKE

The collision term implemented in this commit is C = { gamma , N_eq - N }. Here Gamma = diag( k*_e , k*_x ) / 2 . k*_a is the inverse mean free path for flavor a, including Pauli blocking term. * means that Pauli blocking term is already in the inverse mean free path values. Equilibrium neutrino number matrix N_eq equals the integral of f_eq, where the integral is over the phase space that the particle represents.

* Modify the script to compute the energy bin size and antineutrino chemical potential for the collision instability test.

This change emerged from the correction made to the collision term and the necessity of obtaining the antineutrino chemical potential to ensure the test runs properly.

* Setting up the collisional instability test

Set the appropriate input parameters for the collisional instability test, generate plots to visualize the results, and add comments to the Python script that generates the initial conditions for this test.

---------

Co-authored-by: Sherwood Richers <richers@utk.edu>
Co-authored-by: erickurquilla1999 <erickurquillla1999@gmail.com>
Co-authored-by: Sherwood Richers <5142652+srichers@users.noreply.github.com>
* Particles store the phase space volume they occupy

* set evolution equations for N and L to be zero in code generation script in anticipation of changing them based on opacities. Set Vphase to not evolve in time.

* whitespace

* infrastructure to set IMFPs and chemical potentials in the parameter file

* redefining f --> Nrho (before was f ---> Nrho)

* computing volume of phase space

* deleting lines that convert twice mu to erg

* adding delta E as an input parameter to compute phase space volume

* adding new input parameters to input files to run collitions

* adding collition term in QKE

* moving line that compute derivates, now it set the phase volume to zero meaning its time derivative its zero after it is used in collision term

* considering the particle that carry antineutrinos in the fast flavor test

* Fixing an error in the collision term

* including adaptative time step for absortion and emission

* creating vacuum paticles initial condition script

* adding attenuation parameter to the time derivative of N_Ab due to the hamiltonians

* solving mistake to compute time step due to collisions

* adding collision test input file

* testing if the particles converge to the expected equilibrium distribution

* solving issue to copy GNUmakefile_jenkins to Exec directory

* doing fast compilation in collision test

* clarifying better the collision time steps, now delta t collision is collision_CFL / ( c * max_IMFP )

* deletting renomarlization function. It will not be used anymore

* solving mistake in compilation comand to compile the code for 3 flavors

* Setting default collision time step to infinite. It will change if the code do collisions.

* setting right indentation

* including attenuation parameter to compute the time steps due to potentials

* computing minimum between time steps due to potentials and collision even if max_adaptive_speedup>1 is not satisfy

* solve mistake in chemical potential units in coment

* add coment on the energy units

* delete the individual parms arguments

* creating collisional flavor instability test

* delete print line

* now reads plt* files for time steps of more than 5 digits

* now reads plt files for time steps with more than 5 digits

* add function to initialize the background enviroment Ye, rho and T

* insert chemical potential for neutrinos and antineutrino independently

* set python script that generate initial condition for collisional instability test

* set input file for collisional instability test

* Create a Jenkins test for collisional flavor instability

* change cuda version to 7.0

* delete std cout line

* correct cuda version for jenkins

* change order of commands first reduce_data_fft.py then reduce_data.py

* delete function to initialize background quantities on this branch

* Solve mistake on collisional instability test. Now it read the right input file

* Solve mistake on collisional instability test. Now it read the right python script

* add python script for collision instability test

* solve problem of defining chemical potentials for antineutrinos in the input parameter file

* rename f -> N for particles

Beware: grid also has a Nij variable which is different

* finish renaming f -> N everywhere

* comment lines that assert if N and Nbar are negatives, this lines will be deleted since now N and Nbar will no longer be used

* change f for N in utility script to generate initial particles conditions

* modify initial condition script for msw test. now it gives N_ab instead of N and f_ab as input

* add comments to the function that read the initial conditions of the particles

* change msw test to include the change f_ab ---> N_ab

* reading N_ab for the particle initial condition file instead of N and f_ab independenly

* removing f_ab variables for N_ab when setting perturbation

* delete no needed lines

* repare coll_equi_test.py test to consider N_ab instead of f_ab

* making bypolar test work with the changes f_ab ---> N_ab

* making fast flavor test work for f_ab ---> N_ab

* making fast_flavor_k_test works for f_ab ---> N_ab

* delete print line

* delete print lines

* make attenuation parameter symbolic in code generation scripts

* move f-->N in a few more places

* change f to N in test scripts

* change Trf to TrN

* remove unused line

* setting right initial conditions for collisional instability test

* inteporlate T, Ye, rho from grid to particles, but return right value multiplied by 4

* solve mistake in interpolating rho, Ye and T from grid to particles posision, now the generation code script does not repeate the code 4 times

* delete print lines

* using the interpolated value of T for the calculation of the equlibrium distribution

* collisional instability test do not include a random perturbation on the off diagonal component of the density matrix. Not it use vacuum potentials.

* upload julien nsm input script

* solve mistake in energy average

* set right initial conditions for julien nsm simulation

* Modify collision instability test

The collision instaiblity test now includes the LSA in equation 14 of L. Johns [2104.11369]
Julien Frousley script to solve isotropic QKE is used to compare EMU solution
Plots are included all over the test but were commented

* Add collisions directory to store usefull script for simulations containing collisions

The script compute_dE.py is used to compute the energy bin size base on the expected equilibrium number of neutrinos

* Comments added to compute_dE.py script

* reordered scripts in jenkinsfile to clean up PR

* added line in data reduction scripts to prevent glob from picking up generated hdf5 files

* Deleting unnecessary variables in the script that generates initial conditions for the collision to equilibrium test (coll_equi_test.py).

This commit reduces code size by removing redundant variables in the st7_empty_particles.py script (Scripts/tests/coll_equi_test.py), which generates a set of particles with zero neutrinos and antineutrinos.

* Delete Julien's NSM input file from the initial conditions script directory.

* Removed opacities and chemical potential entries from input files that do not include collision simulations.

To avoid future confusion, I deleted the collision-related input options (opacities, chemical potential, and energy bin size) from input files used for tests without collisions.

* Added a more accurate description of the assert error for opacity methods.

The assert error now clearly indicates that the only available opacity methods are 0 (no collisions) and 1 (with collisions).

* Change variable type from double to Real to keep consistency

* Adding more comments to the script that computes the energy bin size for collision tests.

* Delete commented lines that are under development.

I deleted commented lines containing Julien's script that computes the collisional flavor instability evolution. This could potentially be included in the future to solidify the collisional instability test.

* Delete Python script of a previous test that will no longer be used.

* Delete Python script that generates the initial conditions of particles in Julien's NSM simulation.

* Delete old script used for testing convergence. It will no longer be used.

* Change N_eq to f_eq since this better represents the collision term.

f_eq is the Fermi-Dirac neutrino distribution for a given particle energy.

* Include option to multiply the inverse mean free paths by the Pauli blocking term.

A new input parameter was created (Do_Pauli_blocking). If set to 1, it will multiply the inverse mean free path by 1 / (1 - f_eq); if set to 0, it will do nothing.

* Adding a semicolon

* Adding the input parameter Do_Pauli_blocking to all input files.

I added the input parameter Do_Pauli_blocking to all input files to avoid errors caused by not reading this parameter during execution. If this parameter is set to 1, it will multiply the inverse mean free path by 1 / (1 - f_eq); if set to 0, it will do nothing. In the tests that don't involve collisions, it will not have any effect.

* Correction in the collision term of QKE

The collision term implemented in this commit is C = { gamma , N_eq - N }. Here Gamma = diag( k*_e , k*_x ) / 2 . k*_a is the inverse mean free path for flavor a, including Pauli blocking term. * means that Pauli blocking term is already in the inverse mean free path values. Equilibrium neutrino number matrix N_eq equals the integral of f_eq, where the integral is over the phase space that the particle represents.

* Modify the script to compute the energy bin size and antineutrino chemical potential for the collision instability test.

This change emerged from the correction made to the collision term and the necessity of obtaining the antineutrino chemical potential to ensure the test runs properly.

* Setting up the collisional instability test

Set the appropriate input parameters for the collisional instability test, generate plots to visualize the results, and add comments to the Python script that generates the initial conditions for this test.

* convert f variables in new commits to development to N

* Deleting input parameter Do_Pauli_blocking in tests that do not use it

This change simplifies the input parameters file for simulations that do not run collisions. Now, the input parameter Do_Pauli_blocking only appears in the input files for collision-to-equilibrium and collisional instability tests.

* Creating two separate scripts to compute the energy bin size for collision tests:

Now, instead of a single script to compute the energy bin size, I have included two separate scripts—one for the collisional instability test and another for the particles-to-equilibrium test.

* Setting script for particles to equilibrium test

Unnecessary lines were deleted, the correct energy bin size was set in the input parameter file. Added comments to the code.

* Changing input parameters for collisional instability test to speed up the test

Reducing the number of time steps and the written files in the collisional instability test to improve performance in Jenkins.

---------

Co-authored-by: Sherwood Richers <richers@utk.edu>
Co-authored-by: erickurquilla1999 <erickurquillla1999@gmail.com>
Co-authored-by: erickurquilla1999 <erickurquilla1999@gmail.com>
…conflicts resolution

The merge conflict for Source/Evolve.cpp needs to be fixed. WARNING: code won't compile in the current state.
The conflict occurred in the assignment of opacities into the opacity matrices.
…on with the electron neutrino and antineutrino values interpolated from the equation of state table.
…5_CUDA

Use of NUM_FLAVORS = 3 currently fails
…stability and Collisions to equilibrium test

Resolve merge conflict in sample_inputs/inputs_coll_equi_test
* Cleanup

* more cleanup, enable compiling Emu with and without MPI

* Just use AMREX_USE_MPI instead of creating another precompiler definition

* cleanup
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

Successfully merging this pull request may close these issues.

7 participants