From 12e84db4f0ae64436bbc8e022f90700b8ed49b6c Mon Sep 17 00:00:00 2001 From: ChunYen-Chen Date: Thu, 12 Dec 2024 13:42:55 +0800 Subject: [PATCH] Add ELBDM test problems --- .../Test-Problems:-AGORA_IsolatedGalaxy.md | 2 +- .../Test-Problems:-DiskHeating.md | 143 ++++++++++++++++++ .../Test-Problems:-GaussianWavePacket.md | 26 ++++ .../Test-Problems:-HaloMerger.md | 90 +++++++++++ .../Test-Problems:-IsolatedHalo.md | 105 +++++++++++++ ...Test-Problems:-JeansInstabilityComoving.md | 55 +++++++ .../Test-Problems:-LSS.md | 54 +++++++ .../Test-Problems:-LSS_Hybrid.md | 93 ++++++++++++ .../Test-Problems:-Perturbation.md | 31 ++++ .../Test-Problems:-PlaneWave.md | 28 ++++ .../Test-Problems:-RestrictionMismatch.md | 34 +++++ .../Test-Problems:-SelfSimilarHalo.md | 24 +++ .../Test-Problems:-Soliton.md | 33 ++++ .../Test-Problems:-VortexPairLinear.md | 35 +++++ .../Test-Problems:-VortexPairLinear_Hybrid.md | 36 +++++ .../Test-Problems:-VortexPairRotating.md | 31 ++++ ...est-Problems:-VortexPairRotating_Hybrid.md | 31 ++++ doc/wiki/Test-Problems.md | 32 ++++ example/test_problem/ELBDM/DiskHeating/README | 117 -------------- .../test_problem/ELBDM/DiskHeating/README.md | 135 +++++++++++++++++ .../ELBDM/GaussianWavePacket/README | 16 -- .../ELBDM/GaussianWavePacket/README.md | 18 +++ .../ELBDM/HaloMerger/{README => README.md} | 54 ++++--- .../test_problem/ELBDM/IsolatedHalo/README | 69 --------- .../test_problem/ELBDM/IsolatedHalo/README.md | 97 ++++++++++++ .../ELBDM/JeansInstabilityComoving/README | 40 ----- .../ELBDM/JeansInstabilityComoving/README.md | 47 ++++++ example/test_problem/ELBDM/LSS/README | 32 ---- example/test_problem/ELBDM/LSS/README.md | 46 ++++++ example/test_problem/ELBDM/LSS_Hybrid/README | 66 -------- .../test_problem/ELBDM/LSS_Hybrid/README.md | 85 +++++++++++ .../test_problem/ELBDM/Perturbation/README | 18 --- .../test_problem/ELBDM/Perturbation/README.md | 23 +++ example/test_problem/ELBDM/PlaneWave/README | 16 -- .../test_problem/ELBDM/PlaneWave/README.md | 20 +++ .../test_problem/ELBDM/SelfSimilarHalo/README | 14 -- .../ELBDM/SelfSimilarHalo/README.md | 16 ++ example/test_problem/ELBDM/Soliton/README | 20 --- example/test_problem/ELBDM/Soliton/README.md | 25 +++ .../ELBDM/VortexPairLinear/README | 24 --- .../ELBDM/VortexPairLinear/README.md | 27 ++++ .../ELBDM/VortexPairLinear_Hybrid/README | 25 --- .../ELBDM/VortexPairLinear_Hybrid/README.md | 28 ++++ .../ELBDM/VortexPairRotating/README | 20 --- .../ELBDM/VortexPairRotating/README.md | 23 +++ .../ELBDM/VortexPairRotating_Hybrid/README | 20 --- .../ELBDM/VortexPairRotating_Hybrid/README.md | 23 +++ 47 files changed, 1521 insertions(+), 526 deletions(-) create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-DiskHeating.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-GaussianWavePacket.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-HaloMerger.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-IsolatedHalo.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-JeansInstabilityComoving.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-LSS.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-LSS_Hybrid.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-Perturbation.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-PlaneWave.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-RestrictionMismatch.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-SelfSimilarHalo.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-Soliton.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear_Hybrid.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating.md create mode 100644 doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating_Hybrid.md delete mode 100644 example/test_problem/ELBDM/DiskHeating/README create mode 100644 example/test_problem/ELBDM/DiskHeating/README.md delete mode 100644 example/test_problem/ELBDM/GaussianWavePacket/README create mode 100644 example/test_problem/ELBDM/GaussianWavePacket/README.md rename example/test_problem/ELBDM/HaloMerger/{README => README.md} (58%) delete mode 100644 example/test_problem/ELBDM/IsolatedHalo/README create mode 100644 example/test_problem/ELBDM/IsolatedHalo/README.md delete mode 100644 example/test_problem/ELBDM/JeansInstabilityComoving/README create mode 100644 example/test_problem/ELBDM/JeansInstabilityComoving/README.md delete mode 100644 example/test_problem/ELBDM/LSS/README create mode 100644 example/test_problem/ELBDM/LSS/README.md delete mode 100644 example/test_problem/ELBDM/LSS_Hybrid/README create mode 100644 example/test_problem/ELBDM/LSS_Hybrid/README.md delete mode 100644 example/test_problem/ELBDM/Perturbation/README create mode 100644 example/test_problem/ELBDM/Perturbation/README.md delete mode 100644 example/test_problem/ELBDM/PlaneWave/README create mode 100644 example/test_problem/ELBDM/PlaneWave/README.md delete mode 100644 example/test_problem/ELBDM/SelfSimilarHalo/README create mode 100644 example/test_problem/ELBDM/SelfSimilarHalo/README.md delete mode 100644 example/test_problem/ELBDM/Soliton/README create mode 100644 example/test_problem/ELBDM/Soliton/README.md delete mode 100644 example/test_problem/ELBDM/VortexPairLinear/README create mode 100644 example/test_problem/ELBDM/VortexPairLinear/README.md delete mode 100644 example/test_problem/ELBDM/VortexPairLinear_Hybrid/README create mode 100644 example/test_problem/ELBDM/VortexPairLinear_Hybrid/README.md delete mode 100644 example/test_problem/ELBDM/VortexPairRotating/README create mode 100644 example/test_problem/ELBDM/VortexPairRotating/README.md delete mode 100644 example/test_problem/ELBDM/VortexPairRotating_Hybrid/README create mode 100644 example/test_problem/ELBDM/VortexPairRotating_Hybrid/README.md diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-AGORA_IsolatedGalaxy.md b/doc/wiki/Test-Problem-related/Test-Problems:-AGORA_IsolatedGalaxy.md index 78e3e3cb3c..3785284cbc 100644 --- a/doc/wiki/Test-Problem-related/Test-Problems:-AGORA_IsolatedGalaxy.md +++ b/doc/wiki/Test-Problem-related/Test-Problems:-AGORA_IsolatedGalaxy.md @@ -40,7 +40,7 @@ [Ji-hoon Kim, et al., 2016, ApJ, 833, 202](https://dx.doi.org/10.3847/1538-4357/833/2/202) [(arXiv: 1610.03066)](https://dx.doi.org/10.3847/1538-4357/833/2/202) 2. Other references - [AGORA website](https://sites.google.com/site/santacruzcomparisonproject/) - - [AGORA initial condition](http://goo.gl/8JzbIJ) + - [AGORA initial condition](https://goo.gl/8JzbIJ) - [Enzo setup](https://bitbucket.org/enzo/enzo-dev/src/19f4a44e06f1c386573dc77b3608ba66b64d93bc/run/Hydro/Hydro-3D/AgoraGalaxy/?at=week-of-code) - [Goldbaum et al. 2016](https://arxiv.org/abs/1605.00646) - [yt hub](https://girder.hub.yt/#collection/5736481ddd9119000164acf1) diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-DiskHeating.md b/doc/wiki/Test-Problem-related/Test-Problems:-DiskHeating.md new file mode 100644 index 0000000000..f1caa3bcf9 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-DiskHeating.md @@ -0,0 +1,143 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[STORE_PAR_ACC | Installation: Simulation-Options#STORE_PAR_ACC]] + - [[SUPPORT_HDF5 | Installation: Simulation-Options#SUPPORT_HDF5]] + - [[SUPPORT_GSL | Installation: Simulation-Options#SUPPORT_GSL]] (optional, only useful for thin disk) +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Quick start +0. Generate `gamer` + 1. Copy `generate_make.sh` to the directory `src` + 2. Generate `Makefile` + ```bash + sh generate_make.sh + ``` + 3. Compile `gamer` + ```bash + make clean + make -j 4 + ``` + +1. Download initial conditions of `m_22=0.4`, `M_h=7e10` Msun halo and stellar disk with + ```bash + sh download_ic.sh + ``` + +2. Ensure [[PAR_INIT | #PAR_INIT]] = 1 and [[OPT__INIT]] = 3 in `Input__Parameter` + +3. Default [[END_T | ]] is 2.5e-1 (about 3.5 Gyr) as in [Yang et al. 2023](https://doi.org/10.1093/mnras/stae793) and [[OUTPUT_DT | ]] is 1.0e-2 (about 0.14 Gyr) + +4. To switch to a high-resolution run, command `ln -sf ic_files/PAR_IC_0.4_M7 PAR_IC` + Set [[PAR_NPAR | ]]=80000000, [[MAX_LEVEL | Runtime-Parameters:-Refinement#MAX_LEVEL]]=3, and change all values in `Input__Flag_NParPatch` to `800` + + +# General initial condition setup +1. Disk + + a. Generate the disk via modified [GALIC](https://github.com/HsunYeong/GALIC.git) + The snapshots have the filenames `snap_XXX.hdf5` + + b. Set the filename, units in `get_par_ic.py` to match the GALIC set-up + + c. Set center to be location of the soliton in `get_par_ic.py` + + d. Execute `get_par_ic.py`, it will generate `PAR_IC` + +2. Halo + + a. If the data is binary file `UM_IC` + + * Set [[OPT__INIT | ]] = 3 and [[PAR_INIT | ]] = 1 + * `Input__UM_IC_RefineRegion` is required + + b. If the data is GAMER snapshot + + * Command `ln -s Data_XXXXXX RESTART` to create a soft link + * Set [[OPT__INIT | ]] = 2 and [[PAR_INIT | ]] = 2 in `Input__Parameter` + * Turn on `AddParWhenRestart` and `AddParWhenRestartByFile` in `Input__TestProb` + * Set `AddParWhenRestartNPar` in `Input__TestProb` + * Turn on [[OPT__RESTART_RESET | ]] in `Input__Parameter` + # Recommand to turn off `AddParWhenRestart`, `AddParWhenRestartByFile`, [[OPT__RESTART_RESET | ]] right after the simulation starts + + c. The code for [FDM halo reconstruction](https://github.com/calab-ntu/psidm-halo-reconstruction) + +3. Thin disk (optional) + + a. Create a soft link for restart + ```bash + ln -s Data_XXXXXX RESTART + ``` + + b. Set [[OPT__INIT | ]] = 2 and [[PAR_INIT | ]] = 2 and turn on [[OPT__RESTART_RESET | ]] in Input__Parameter + + c. Turn on `AddParWhenRestart` in `Input__TestProb` + + d. Set `AddParWhenRestartNPar`, `Disk_Mass`, `Disk_R`, and `DispTableFile` in `Input__TestProb` + + +# Analysis scripts +1. `particle_proj.py`, `plot_halo_slice.py` + + * Plot the projection of disk particles or halo density slice + * Output files: `particle_proj_*.png`, `Data_*_Slice_x_Dens.png` + +2. `plot_halo_density.py`, `plot_halo_potential.py` + + * Compute and plot shell-averaged halo density or gravitational potential profiles + * Output files: `Data_*_1d-Profile_radius_Dens.png`, `Halo_Dens_Data_*.npy`, + `Data_*_1d-Profile_radius_Pote.png`, `Halo_Pote_Data_*.npy` + +3. `data_disk.py` + + * Compute the disk information (rotation speed, velocity dispersion, surface density, scale height, etc.) + * Output files: `Data_Disk_*.npy` + +4. `data_halo.py` + + * Compute the halo information (enclosed mass, velocity dispersion, etc.) + * Required files: `Halo_Dens_*.npy` (generated by `plot_halo_density.py`) and `Halo_Pote_*.npy` (by `plot_halo_potential.py`) + * Output files: `Data_Halo_*.npy` + +5. `vel_distribution.py` + + * Compute the velocity distribution in 2-kpc-wide radial bins centered on R = 4, 6, 8, 10 kpc + * Output files: `Vel_data_*.npz`, `vel_*.png` + +6. `get_heating.py` + + * Compute the theoretical heating rate of the stellar disk as a function of radius + * Required files: `Data_Disk_*.npy` (generated by `data_disk.py`), `Data_Halo_*.npy` (by `data_halo.py`) + * Output files: `Heating_*.npz` + +7. `get_heating_rate_theory.py` + + * Get the time-averaged theoretical heating rate + * Required files: `Heating_*.npz` (generated by `get_heating.py`) + * Output files: printed plain text + +8. `get_heating_rate_simulation.py` + + * Compute ensemble- and time-averaged disk heating rates measured from simulation data + * Required files: `Vel_data_*.npz` (generated by `vel_distribution.py`) + * Output files: `sigma_z_sqr.png` and printed plain text + +9. `plot_data_example.py` + + * An example script to plot the angle-averaged disk rotation curve and shell-averaged density profile + * Required files: `Data_Disk_*.npy` (generated by `data_disk.py`) and/or `Data_Halo_*.npy` (by `data_halo.py`) + * Output files: `Rotation_Curve.png`, `Halo_Density_Profile.png` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-GaussianWavePacket.md b/doc/wiki/Test-Problem-related/Test-Problems:-GaussianWavePacket.md new file mode 100644 index 0000000000..93d2961408 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-GaussianWavePacket.md @@ -0,0 +1,26 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve the Gaussian wave packet for half of box +2. Apply the analytical solution as user-defined BC + --> Set [[OPT__BC_FLU_* | ]] = 4 + + +# Note +1. Only support 1D --> Use `Gau_XYZ` to control the propagation direction diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-HaloMerger.md b/doc/wiki/Test-Problem-related/Test-Problems:-HaloMerger.md new file mode 100644 index 0000000000..bbe7e384d0 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-HaloMerger.md @@ -0,0 +1,90 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +Compilation flags: +======================================== +Enable : MODEL=ELBDM, GRAVITY (, PARTICLE, SUPPORT_GSL) +Disable: COMOVING + + +# Default setup +1. Code units + (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter + = 1437.814521231748 kpc + (2) UNIT_V = 100 km/s + (3) UNIT_D = rho_bg (background matter density at z=0) + = 38.06 Msun/kpc^3 + --> Mass density and wavefunction are normalized to rho_bg + (4) UNIT_T = 14068.4678922741 Myr + (5) UNIT_M = 1.131e+11 Msun + +2. ELBDM_MASS 1.0e-22 + ELBDM_REMOVE_MOTION_CM 0 + ELBDM_TAYLOR3_AUTO 0 + +3. OPT__BC_FLU_* 1 (periodic) + OPT__BC_POT 2 (isolated) + +4. MAX_LEVEL 3 + OPT__FLAG_RHO 1 + +5. END_T 0.25 + +# Note +1. Simulate the merger of halos and solitons in an external potential + +2. Edit `Input_TestProb_Halo` to specify the parameters for the halos + a. Add new parameters with increasing indexes if the number of halos is more than 2 + b. For `HaloMerger_Halo_InitMode` == 1 + - The initial condition of halos is constructed by reading the `HALO_IC` file as a table and performing linear interpolation + - Note that this `HALO_IC` has nothing to do with the built-in option [[OPT__INIT | ]] = 3 + - The `HALO_IC` must be single AMR level + - If there is a halo `UM_IC` (for [[OPT__INIT | ]] = 3) that has multiple AMR levels (and there is `Input__UM_IC_RefineRegion`), + the Python script `Make_UM_IC_uniform.py` is provided to convert it to + a single-level `UM_IC` with the specified level, which can be used as the `HALO_IC` + (However, those levels higher than Target_lv+log_2( 2*PatchSize ) cannot be handled and will be ignored) + - If converting the halo UM_IC to be single-level is not feasible, + switching to the initialization option [[OPT__INIT | ]] = 3 to load a multi-level `UM_IC` is also an alternative + (However, only one `UM_IC` can be loaded and all the parameters in `Input_TestProb_Halo` will not be used) + - Note that `HaloMerger_Halo_*_CenCoord*` in `Input__TestProb_Halo` is the `HALO_IC` box center rather than the exact halo center + +3. Edit `Input_TestProb_Soliton` to specify the parameters for the solitons + a. Add new parameters with increasing indexes if the number of solitons is more than 2 + b. For `HaloMerger_Soliton_InitMode` == 1 + - The initial condition of solitons is constructed by reading the table of soliton density profile + (the density profile will be rescaled to the given core radius or core density if `HaloMerger_Soliton_*_DensProf_Rescale` == 1) + c. For `HaloMerger_Soliton_InitMode` == 2 + - The initial condition of solitons is constructed by using the analytical formula of soliton density profile + +4. Edit `Input_TestProb_ParCloud` to specify the parameters for the particle clouds + a. Add new parameters with increasing indexes if the number of particle clouds is more than 2 + b. For `HaloMerger_ParCloud_InitMode` == 1 + - The initial condition of particle clouds is constructed by reading the table of density profile and using `Par_EquilibriumIC()` + - The default particle clouds use the HaloDensityProfile (see Note 7. below) to represent the CDM halos + - Enable compilation options: [[PARTICLE | ]], [[SUPPORT_GSL | ]] + - Set the parameter [[OPT__FREEZE_FLUID | ]] to 1 in `Input__Parameter` for particle-only simulations + +5. Turn on [[OPT__EXT_POT | ]] == 1 to add external potential + a. The external potential of a uniform-density sphere, which is proportional to r^2 inside and proportional to 1/r outside + +6. Download the default `HALO_IC` file: `sh download_ic.sh` + a. Halo mass = 4.0960e+09 Msun + b. Without soliton + c. N = 640, L = 0.0646921095 Mpc/h, single-precision + +7. Generate the default HaloDensityProfile and SolitonDensityProfile: `python Make_DensityProfile.py` + a. The parameters for the halo density profile are used to fit the ELBDM halo + +8. Some examples of yt visualization scripts are put in `plot_script` + +9. The corresponding wavelength is 0.00083778702 Mpc/h when ELBDM_MASS = 1.0e-22 and velocity = 1.0*100 km/s + -> Make sure the resolution is high enough to resolve the wavelength + +10. The input halos and solitons may overlap with each other initially + -> Their wavefunctions, instead of densities, are added directly + -> Note that the interference will cause the density distribution to be different from the sum of individual density diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-IsolatedHalo.md b/doc/wiki/Test-Problem-related/Test-Problems:-IsolatedHalo.md new file mode 100644 index 0000000000..6b15559748 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-IsolatedHalo.md @@ -0,0 +1,105 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Code units + (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter + (2) UNIT_V = 100 km/s + (3) UNIT_D = rho_bg (background matter density at z=0) + --> Mass density and wavefunction are normalized to rho_bg + +2. ELBDM + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | ELBDM_REMOVE_MOTION_CM | 1 | + | ELBDM_TAYLOR3_AUTO | 0 | + +3. Boundary conditions + | Parameter name | value | + |--- |--- | + | OPT__BC_FLU_* | 1 | + | OPT__BC_POT | 2 | + +4. AMR + | Parameter name | value | + |--- |--- | + | MAX_LEVEL | 0 | + + +# Libyt covering_grid setup +1. Code units + (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter + (2) UNIT_V = 100 km/s + (3) UNIT_D = rho_bg (background matter density at z=0) + --> Mass density and wavefunction are normalized to rho_bg + +2. ELBDM + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | ELBDM_REMOVE_MOTION_CM | 1 | + | ELBDM_TAYLOR3_AUTO | 0 | + +3. Boundary conditions + | Parameter name | value | + |--- |--- | + | OPT__BC_FLU_* | 1 | + | OPT__BC_POT | 2 | + +4. AMR + | Parameter name | value | + |--- |--- | + | MAX_LEVEL | 0 | + | OPT__FLAG_RHO | 1 | + +5. End simulation condition + | Parameter name | value | + |--- |--- | + | END_T | 5.7116620e-03 | + | END_STEP | 32 | + +6. libyt + | Parameter name | value | + |--- |--- | + | YT_SCRIPT | libyt_script/inline_script_covering_grid | + | YT_VERBOSE | 1 | + + +# Note +1. Download the IC file + ```bash + sh download_ic.sh + ``` + +2. Some examples of yt visualization scripts are put in `yt_script` + +3. Simulate a single isolated halo extracted from a cosmological simulation + +4. About libyt covering_grid test + a. Use submit script `./libyt_script/submit_gamer.job` for job submission + + b. Put `./libyt_script/inline_script_covering_grid.py` under the same folder as gamer + + c. For determining the `left_edge` and `dims` in function `ds.covering_grid`: + `left_edge`: LV1 resolution is 0.175/512/2 ; region covered by LV1 box (by `ds.covering_grid`) is 0.175/512/2*512; 0.04375 = (0.175 - 0.175/512/2*512)/2 + `dims`: Plan to cover region with half of the simulation box length, i.e. will have 256X256X256 base level cells -> refine to MAX_LEVEL=1 -> LV1 cells is 512X512X512 + + d. Use `plot_slice-dens_covering_grid.py` to extract density slices from `.npz` files + + e. Use `make_movie.sh` to convert `.png` pictures into `.mp4` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-JeansInstabilityComoving.md b/doc/wiki/Test-Problem-related/Test-Problems:-JeansInstabilityComoving.md new file mode 100644 index 0000000000..968fae1829 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-JeansInstabilityComoving.md @@ -0,0 +1,55 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[UNSPLIT_GRAVITY | Installation: Simulation-Options#UNSPLIT_GRAVITY]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. 32^3 uniform resolution + --> No grid refinement is adopted in this test + +2. [[DT__MAX_DELTA_A | ]] is set an extremely large number so that the time-step will + be controlled by the fluid solver + +3. The default setup in `Input__Parameter` and `Input__TestProb` gives an UNSTABLE + solution, in which the solution grows exponentially. To test a STABLE solution, + one can try the following parameters: + + * `Input__Parameter`: + - BOX_SIZE = 0.5 + - A_INIT = 1.0e-5 + - OUTPUT_DT = 2.0e-6 + + * `Input__TestProb`: + - Jeans_RealAmp0 = 4.0e-8 + +> [!CAUTION] +> This setup requires further verification + + +# Note +1. Analytical solution reference: Woo, T. & Chiueh, T. 2009, ApJ, 697, 850 + +> [!NOTE] +> The imaginary part `I` grows much faster than the real part `R`. + Consequently, the accuracy of linear prediction will be deteriorated + when the assumption (2R >> I^2) starts to break down, especially in the + higher-resolution tests, and hence the 2nd-order accuracy may no longer + hold. + +> [!CAUTION] +> 2nd-order accuracy has NOT been verified for the UNSTABLE solution diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-LSS.md b/doc/wiki/Test-Problem-related/Test-Problems:-LSS.md new file mode 100644 index 0000000000..16c606d8d3 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-LSS.md @@ -0,0 +1,54 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Cosmological constants + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | A_INIT | 3.124024e-4 | + | OMEGA_M0 | 0.2835 | + | HUBBLE0 | 0.6955 | + +2. Simulation + | Parameter name | value | + |--- |--- | + | BOX_SIZE | 1.4 | + | MAX_LEVEL | 3 | + | OPT__FLAG_RHO | 1 | + | OPT__FLAG_LOHNER_DENS | 1 | + +3. Flag tables + * `Input__Flag_Rho`: `example/input/Input__Flag_Rho8` + * `Input__Flag_Lohner`: `example/input/Input__Flag_Lohner__FLASH1_LSS_DH3.0` + + +# Note +1. Cosmological large-scale structure simulations + +2. Download the IC file + ```bash + sh download_ic.sh + ``` + +3. Default maximum resolution is low + * Only 1.4/(256*2^3) ~ 0.7 kpc/h (comoving) + * Can only marginally resolve a central soliton + +4. Some yt visualization scripts are put in `plot_script` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-LSS_Hybrid.md b/doc/wiki/Test-Problem-related/Test-Problems:-LSS_Hybrid.md new file mode 100644 index 0000000000..d8aa632a7e --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-LSS_Hybrid.md @@ -0,0 +1,93 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Cosmological constants + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 2.0e-23 | + | A_INIT | 9.900990099e-3 | + | OMEGA_M0 | 0.3158230904284232 | + | HUBBLE0 | 0.6732117 | + +2. Simulation + | Parameter name | value | + |--- |--- | + | BOX_SIZE` | 2.8 | + | MAX_LEVEL | 6 | + | OPT__FLAG_SPECTRAL | 1 | + | OPT__FLAG_INTERFERENCE | 1 | + +3. Flag tables + * `Input__Flag_Rho`: example/input/Input__Flag_Rho8 + * `Input__Flag_Spectral`: example/input/Input__Flag_Spectral + * `Input__Flag_Interference`: example/input/Input__Flag_Interference + + +Note: +======================================== +1. Cosmological large-scale structure simulations using hybrid scheme + +2. Quickstart: + 1. Download the IC file: `sh download_light_halo_ic.sh` or `sh download_heavy_halo_ic.sh` + 2. For spectral interpolation: + - Download spectral interpolation tables with `sh download_spectral_interpolation_tables.sh` + - Set `OPT__FLU_INT_SCHEME` and `OPT__REF_FLU_INT_SCHEME` to 8 + 3. Compile GAMER and run simulation to redshift 0 with default settings. + +3. Explanation: + 1. IC + + The wave IC consisting of two blocks of real and imaginary parts are converted to hybrid IC + consisting of two blocks with the density and phase fields using the Python script `elbdm_wave_to_hybrid_IC.py` + + It can be used as follows: + ```bash + python elbdm_wave_to_hybrid_IC.py -resolution 256 -input UM_IC_wave -output UM_IC_hybrid + ``` + to convert the input file `UM_IC_wave` with a resolution of 256 points in each dimension to the output hybrid IC `UM_IC_hybrid`. Optionally, it accepts the keyword -float8 for double precision input data. + The conversion is only well-defined if the IC do not contain vortices, i.e. at high redshift for cosmological IC. + + In a second step, the initial conditions can be rescaled using the Python script `elbdm_rescale_periodic_ic.py`. + It can be used as follows: + ```bash + python elbdm_rescale_periodic_ic.py -n_in 256 -n_out 64 -input UM_IC_high_resolution -output UM_IC_low_resolution + ``` + and supports up- and downscaling periodic wave and hybrid IC. Optionally, it accepts the keyword -float8 for double precision input data. + 2. Interpolation tables + + The tables can be recreated by calling `mpirun -n 16 python3 tool/table_maker/GramFE/compute_interpolation_tables.py`. `INT_SPEC_TABLE_PATH` (default = "./") must be set to a folder containing the folders `interpolation_tables` and `boundary2extension_tables` + +3. The simulation uses a low base-level resolution of 2.8 Mpc/h / 64 ~ 44 kpc/h (comoving). + This corresponds to a maximum wave vector k ~ 72 h/Mpc well above the cutoff power in the initial conditions for m = 2.0e-23 eV. This initial resolution has shown very good agreement with higher resolution wave initial conditions. + +4. The simulation uses the fluid solver on levels 0 - 3 and switches to the wave solver in regions of interference on level 4. + The corresponding runtime parameter `ELBDM_FIRST_WAVE_LEVEL` is set to 4. + + The resolution for the first level using the wave solver is 2.8 Mpc/h /(64*2^4) ~ 2.75 kpc/h (comoving) with these settings. + This resolution has shown to be a good compromise for the starting resolution of the wave solver. + Note that increasing [[ELBDM_FIRST_WAVE_LEVEL | ]] will affect performance since it will likely lead to overrefinement. However, it should increase the accuracy of the hybrid scheme. + On the contrary, decreasing [[ELBDM_FIRST_WAVE_LEVEL | ]] will lead to a lower-resolution at the wave-fluid boundary (regardless of [[MAX_LEVEL | ]] and [[REFINE_NLEVEL | ]]) and will negatively affect the accuracy of the solver. + +3. Default maximum resolution is low + --> Only 2.8/(64*2^6) ~ 0.7 kpc/h (comoving) + --> Can only marginally resolve a central soliton + +4. Some yt visualization scripts are put in `plot_script` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-Perturbation.md b/doc/wiki/Test-Problem-related/Test-Problems:-Perturbation.md new file mode 100644 index 0000000000..e6669bfcdb --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-Perturbation.md @@ -0,0 +1,31 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Study gravitational collapse in one, two and three dimensions (2D by default) +2. Use periodic boundary conditions +3. Demonstrate refinement in hybrid scheme by using `Input__Flag_Interference` +4. Compared to JeansInstabilityComoving, this test also supports 1D, 2D and 3D collapse + +# Note +1. Evolve small-amplitude plane waves on homogeneous background density +2. `Perturbation_Amplitude` is maximum amplitude of individual perturbations, `Perturbation_BgAmplitude` is amplitude of background density, `Perturbation_N` is number of Fourier modes in perturbation (maximum is 4) +3. Dimensionality of the problem can be set via `Perturbation_NDim` (set amplitude of plane waves in other dimensions to zero) +3. For reference simulation using base-level spectral method, use `MODEL = WAVE` and `Input__Parameter_BaseSpectral` and `generate_make_BaseSpectral.sh` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-PlaneWave.md b/doc/wiki/Test-Problem-related/Test-Problems:-PlaneWave.md new file mode 100644 index 0000000000..5fc2c4dc63 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-PlaneWave.md @@ -0,0 +1,28 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[FLOAT8 | Installation: Simulation-Options#FLOAT8]] + - [[NCOMP_PASSIVE_USER=1 | Installation: Simulation-Options#NCOMP_PASSIVE_USER]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve the plane wave for six periods +2. Apply the periodic BC + --> Set [[OPT__BC_FLU_* | ]] = 1 + + +# Note +1. Only support 1D --> Use `PWave_XYZ` to control the propagation direction diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-RestrictionMismatch.md b/doc/wiki/Test-Problem-related/Test-Problems:-RestrictionMismatch.md new file mode 100644 index 0000000000..03e33ab8fd --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-RestrictionMismatch.md @@ -0,0 +1,34 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Demonstration of phase mismatch after refinement and restriction + +## Explanation +This test problem demonstrates that refining and restricting the wave function in ELBDM leads to a mismatch of the phase on the coarse levels when the option `OPT__INT_PHASE` is on. +Further, it shows that the new option `OPT__RES_PHASE` remedies the mismatch immediately after restriction, but does not prevent the formation of artifacts at the coarse-fine boundary. +It uses the `GaussianWavePacket` test with suitable initial parameters and refines a region at the center of the Gaussian wave packet. + +## Execution +To run it, compile a version of GAMER with `MODEL = ELBDM` in `SERIAL` mode and put the executable in the test problem directory. +Execute `sh ./compare_restriction.sh`. + +## Output +The script first executes `4` runs in total: `3` runs for `2` time steps that contrast the cases without restriction, the old restriction and the new restriction option; +`1` run that underscores that the artifacts still appear at later times. In total, the script generates `6` plots. +The plot named `ComparisonOfRestrictionMethodsBeforeEvolution.png` compares the phase fields on level `0` immediately after refinement and restriction. +The refined fields are not evolved before creating this plot. +The plots show the phase field on level `0`, their laplacian and the mismatch between the fields from a run with refinement and a run without refinement. +The phase field after restriction with the standard restriction method in GAMER exhibits a significant mismatch with the run without refinement. +In other words, refinement and restriction alter the values of the phase field on level `0`. +The new restriction method does not cause a mismatch of the phase field on level `0`. +However, as the plot named `ComparisonOfRestrictionMethodsAfterEvolution.png` shows, the phase fields on levels `0` and `1` still evolve differently. +The resulting mismatch is bigger than the one caused by the old restriction method. +This is also shown in a series of four plots titled `Data_%06d_Slice_z_density.png` that are created from a run with the new option `OPT__RES_PHASE` turned on. +The grid is unrefined in timestep `0`, refinement and restriction are performed at the end of timestep `1` and the refined fields are evolved during timestep `2`. +Plot `3` that is created later during the run highlights that the artifacts are not remedied by the new restriction option. + diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-SelfSimilarHalo.md b/doc/wiki/Test-Problem-related/Test-Problems:-SelfSimilarHalo.md new file mode 100644 index 0000000000..d90ecfc9e1 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-SelfSimilarHalo.md @@ -0,0 +1,24 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup + + +# Note +1. Test the evolution of the self-similar solution of halos in the comoving frame diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-Soliton.md b/doc/wiki/Test-Problem-related/Test-Problems:-Soliton.md new file mode 100644 index 0000000000..845238a453 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-Soliton.md @@ -0,0 +1,33 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[UNSPLIT_GRAVITY | Installation: Simulation-Options#UNSPLIT_GRAVITY]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. [[NX0_TOT_X/Y/Z | ]] = 96 +2. [[MAX_LEVEL | Runtime-Parameters:-Refinement#MAX_LEVEL]] = 2 + + +# Note +1. `Soliton_N` = 1: test a single soliton + * Set `Soliton_RSeed` < 0 + * Set `Soliton_EmptyRegion` = 0.0 + +2. `Soliton_N` > 1: soliton merger + * Set `Soliton_RSeed` >= 0 + * Set `Soliton_EmptyRegion` > 0.0 (e.g., 1.0e2) diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear.md b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear.md new file mode 100644 index 0000000000..6aa2085278 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear.md @@ -0,0 +1,35 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the periodic boundary conditions +3. Wavelengths along x and y can be adjusted to multiples of the box size +4. Wave in z-direction is turned off by default + + +# Note +1. Evolve vortex pair with linear motion along x in a 2D simulation + --> Wave function `psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) )` + where `A` is a constant on the order of background, `kx` and `ky` are wavenumbers, + `Omega=0.5/ELBDM_ETA*(kx^2+ky^2)`, and `Phase0` is a phase constant +2. Optionally: Add wave in `z` direction + --> `psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) )` + where `background_z` is a constant on the order of background, `kz` is a wavenumber and + `Omega=0.5/ELBDM_ETA*(kz^2)` diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear_Hybrid.md b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear_Hybrid.md new file mode 100644 index 0000000000..da5179ae89 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairLinear_Hybrid.md @@ -0,0 +1,36 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the periodic boundary conditions +3. Wavelengths along x and y can be adjusted to multiples of the box size +4. Wave in z-direction is turned off by default + + +# Note +1. Evolve vortex pair with linear motion along x in a 2D simulation + --> Wave function `psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) )` + where `A` is a constant on the order of background, `kx` and `ky` are wavenumbers, + `Omega=0.5/ELBDM_ETA*(kx^2+ky^2)`, and `Phase0` is a phase constant +2. Optionally: Add wave in `z` direction + --> `psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) )` + where `background_z` is a constant on the order of background, `kz` is a wavenumber and + `Omega=0.5/ELBDM_ETA*(kz^2)` +3. If [[CONSERVE_MASS | ]] is enabled, mass ought to be conserved in this test because of periodic boundary conditions diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating.md b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating.md new file mode 100644 index 0000000000..739edb4db3 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating.md @@ -0,0 +1,31 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the analytical solution as the boundary conditions + + +# Note +1. Evolve a rotating vortex pair in 2D + --> Wave function `psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) )`, + where `A` is a constant on the order of background, `Eta=ELBDM_MASS/PLANCK_CONSTANT`, + `phi` is azimuthal angle, `R` is radius, `Omega` is angular frequency, and `Phase0` is a phase constant +2. Ref: [Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101](https://doi.org/10.1088/0953-4075/44/11/115101), + Vortex turbulence in linear Schrödinger wave mechanics diff --git a/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating_Hybrid.md b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating_Hybrid.md new file mode 100644 index 0000000000..739edb4db3 --- /dev/null +++ b/doc/wiki/Test-Problem-related/Test-Problems:-VortexPairRotating_Hybrid.md @@ -0,0 +1,31 @@ +> [!CAUTION] +> Please do not edit this file(page) manually since the workflow will overwrite your changes. +> +> This file(page) is automatically generated by the workflow `Update test problem wiki page` using the script `tool/wiki/sync_test_problem_pages.py`. +> +> The workflow is triggered by push changes to any of `example/test_problem/*/*/README.md` and `tool/wiki/sync_test_problem_pages.py`. + + +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the analytical solution as the boundary conditions + + +# Note +1. Evolve a rotating vortex pair in 2D + --> Wave function `psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) )`, + where `A` is a constant on the order of background, `Eta=ELBDM_MASS/PLANCK_CONSTANT`, + `phi` is azimuthal angle, `R` is radius, `Omega` is angular frequency, and `Phase0` is a phase constant +2. Ref: [Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101](https://doi.org/10.1088/0953-4075/44/11/115101), + Vortex turbulence in linear Schrödinger wave mechanics diff --git a/doc/wiki/Test-Problems.md b/doc/wiki/Test-Problems.md index d71afa5489..1460af1717 100644 --- a/doc/wiki/Test-Problems.md +++ b/doc/wiki/Test-Problems.md @@ -8,8 +8,40 @@ Before going to the test problem, please check out the demos in [[Quick Start]]. # ELBDM tests +[[ DiskHeating \| Test-Problems:-DiskHeating ]] + [[ ExtPot \| Test-Problems:-ExtPot ]] +[[ GaussianWavePacket \| Test-Problems:-GaussianWavePacket ]] + +[[ HaloMerger \| Test-Problems:-HaloMerger ]] + +[[ IsolatedHalo \| Test-Problems:-IsolatedHalo ]] + +[[ JeansInstabilityComoving \| Test-Problems:-JeansInstabilityComoving ]] + +[[ LSS \| Test-Problems:-LSS ]] + +[[ LSS_Hybrid \| Test-Problems:-LSS_Hybrid ]] + +[[ Perturbation \| Test-Problems:-Perturbation ]] + +[[ PlaneWave \| Test-Problems:-PlaneWave ]] + +[[ RestrictionMismatch \| Test-Problems:-RestrictionMismatch ]] + +[[ SelfSimilarHalo \| Test-Problems:-SelfSimilarHalo ]] + +[[ Soliton \| Test-Problems:-Soliton ]] + +[[ VortexPairLinear \| Test-Problems:-VortexPairLinear ]] + +[[ VortexPairLinear_Hybrid \| Test-Problems:-VortexPairLinear_Hybrid ]] + +[[ VortexPairRotating \| Test-Problems:-VortexPairRotating ]] + +[[ VortexPairRotating_Hybrid \| Test-Problems:-VortexPairRotating_Hybrid ]] + # Hydro tests [[ AGORA_IsolatedGalaxy \| Test-Problems:-AGORA_IsolatedGalaxy ]] diff --git a/example/test_problem/ELBDM/DiskHeating/README b/example/test_problem/ELBDM/DiskHeating/README deleted file mode 100644 index 4d19908d9c..0000000000 --- a/example/test_problem/ELBDM/DiskHeating/README +++ /dev/null @@ -1,117 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY, PARTICLE, STORE_PAR_ACC, SUPPORT_HDF5, - SUPPORT_GSL (optional, only useful for thin disk) - -Disable : COMOVING - - -Quick start: -======================================= -0. Copy "generate_make.sh" to the directory "src", execute "sh generate_make.sh" to generate "Makefile", - and then execute "make clean" and "make -j 4" to generate the executable "gamer" - -1. Download initial conditions of m_22=0.4, M_h=7e10 Msun halo and stellar disk with "sh download_ic.sh" - -2. Ensure PAR_INIT = 1 and OPT__INIT = 3 in Input__Parameter - -3. Default END_T is 2.5e-1 (about 3.5 Gyr) as in Yang et al. 2023 and OUTPUT_DT is 1.0e-2 (about 0.14 Gyr) - -4. To switch to a high-resolution run, command "ln -sf ic_files/PAR_IC_0.4_M7 PAR_IC" - Set PAR_NPAR=80000000, MAX_LEVEL=3, and change all values in Input__Flag_NParPatch to 800 - - -General initial condition setup: -======================================== -1. Disk - - a. Generate the disk via modified GALIC (https://github.com/HsunYeong/GALIC.git) - The snapshots have the filenames snap_XXX.hdf5 - - b. Set the filename, units in get_par_ic.py to match the GALIC set-up - - c. Set center to be location of the soliton in get_par_ic.py - - d. Execute get_par_ic.py, it will generate PAR_IC - -2. Halo - - a. If the data is binary file UM_IC - - * Set OPT__INIT = 3 and PAR_INIT = 1 - * Input__UM_IC_RefineRegion is required - - b. If the data is GAMER snapshot - - * Command "ln -s Data_XXXXXX RESTART" to create a soft link - * Set OPT__INIT = 2 and PAR_INIT = 2 in Input__Parameter - * Turn on AddParWhenRestart and AddParWhenRestartByFile in Input__TestProb - * Set AddParWhenRestartNPar in Input__TestProb - * Turn on OPT__RESTART_RESET in Input__Parameter - # Recommand to turn off AddParWhenRestart, AddParWhenRestartByFile, OPT__RESTART_RESET right after the simulation starts - - c. The code for FDM halo reconstruction (https://github.com/calab-ntu/psidm-halo-reconstruction) - -3. Thin disk (optional) - - a. Command "ln -s Data_XXXXXX RESTART" to create a soft link for restart - - b. Set Set OPT__INIT = 2 and PAR_INIT = 2 and turn on OPT__RESTART_RESET in Input__Parameter - - c. Turn on AddParWhenRestart in Input__TestProb - - d. Set AddParWhenRestartNPar, Disk_Mass, Disk_R, and DispTableFile in Input__TestProb - - -Analysis scripts: -======================================== -1. particle_proj.py, plot_halo_slice.py: - - * Plot the projection of disk particles or halo density slice - * Output files: particle_proj_*.png, Data_*_Slice_x_Dens.png - -2. plot_halo_density.py, plot_halo_potential.py: - - * Compute and plot shell-averaged halo density or gravitational potential profiles - * Output files: Data_*_1d-Profile_radius_Dens.png, Halo_Dens_Data_*.npy, - Data_*_1d-Profile_radius_Pote.png, Halo_Pote_Data_*.npy - -3. data_disk.py: - - * Compute the disk information (rotation speed, velocity dispersion, surface density, scale height, etc.) - * Output files: Data_Disk_*.npy - -4. data_halo.py: - - * Compute the halo information (enclosed mass, velocity dispersion, etc.) - * Required files: Halo_Dens_*.npy (generated by "plot_halo_density.py") and Halo_Pote_*.npy (by "plot_halo_potential.py") - * Output files: Data_Halo_*.npy - -5. vel_distribution.py - - * Compute the velocity distribution in 2-kpc-wide radial bins centered on R = 4, 6, 8, 10 kpc - * Output files: Vel_data_*.npz, vel_*.png - -6. get_heating.py - - * Compute the theoretical heating rate of the stellar disk as a function of radius - * Required files: Data_Disk_*.npy (generated by "data_disk.py"), Data_Halo_*.npy (by "data_halo.py") - * Output files: Heating_*.npz - -7. get_heating_rate_theory.py - - * Get the time-averaged theoretical heating rate - * Required files: Heating_*.npz (generated by "get_heating.py") - * Output files: printed plain text - -8. get_heating_rate_simulation.py - - * Compute ensemble- and time-averaged disk heating rates measured from simulation data - * Required files: Vel_data_*.npz (generated by "vel_distribution.py") - * Output files: sigma_z_sqr.png and printed plain text - -9. plot_data_example.py - - * An example script to plot the angle-averaged disk rotation curve and shell-averaged density profile - * Required files: Data_Disk_*.npy (generated by "data_disk.py") and/or Data_Halo_*.npy (by "data_halo.py") - * Output files: Rotation_Curve.png, Halo_Density_Profile.png diff --git a/example/test_problem/ELBDM/DiskHeating/README.md b/example/test_problem/ELBDM/DiskHeating/README.md new file mode 100644 index 0000000000..4fd8ced508 --- /dev/null +++ b/example/test_problem/ELBDM/DiskHeating/README.md @@ -0,0 +1,135 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[STORE_PAR_ACC | Installation: Simulation-Options#STORE_PAR_ACC]] + - [[SUPPORT_HDF5 | Installation: Simulation-Options#SUPPORT_HDF5]] + - [[SUPPORT_GSL | Installation: Simulation-Options#SUPPORT_GSL]] (optional, only useful for thin disk) +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Quick start +0. Generate `gamer` + 1. Copy `generate_make.sh` to the directory `src` + 2. Generate `Makefile` + ```bash + sh generate_make.sh + ``` + 3. Compile `gamer` + ```bash + make clean + make -j 4 + ``` + +1. Download initial conditions of `m_22=0.4`, `M_h=7e10` Msun halo and stellar disk with + ```bash + sh download_ic.sh + ``` + +2. Ensure [[PAR_INIT | #PAR_INIT]] = 1 and [[OPT__INIT]] = 3 in `Input__Parameter` + +3. Default [[END_T | ]] is 2.5e-1 (about 3.5 Gyr) as in [Yang et al. 2023](https://doi.org/10.1093/mnras/stae793) and [[OUTPUT_DT | ]] is 1.0e-2 (about 0.14 Gyr) + +4. To switch to a high-resolution run, command `ln -sf ic_files/PAR_IC_0.4_M7 PAR_IC` + Set [[PAR_NPAR | ]]=80000000, [[MAX_LEVEL | Runtime-Parameters:-Refinement#MAX_LEVEL]]=3, and change all values in `Input__Flag_NParPatch` to `800` + + +# General initial condition setup +1. Disk + + a. Generate the disk via modified [GALIC](https://github.com/HsunYeong/GALIC.git) + The snapshots have the filenames `snap_XXX.hdf5` + + b. Set the filename, units in `get_par_ic.py` to match the GALIC set-up + + c. Set center to be location of the soliton in `get_par_ic.py` + + d. Execute `get_par_ic.py`, it will generate `PAR_IC` + +2. Halo + + a. If the data is binary file `UM_IC` + + * Set [[OPT__INIT | ]] = 3 and [[PAR_INIT | ]] = 1 + * `Input__UM_IC_RefineRegion` is required + + b. If the data is GAMER snapshot + + * Command `ln -s Data_XXXXXX RESTART` to create a soft link + * Set [[OPT__INIT | ]] = 2 and [[PAR_INIT | ]] = 2 in `Input__Parameter` + * Turn on `AddParWhenRestart` and `AddParWhenRestartByFile` in `Input__TestProb` + * Set `AddParWhenRestartNPar` in `Input__TestProb` + * Turn on [[OPT__RESTART_RESET | ]] in `Input__Parameter` + # Recommand to turn off `AddParWhenRestart`, `AddParWhenRestartByFile`, [[OPT__RESTART_RESET | ]] right after the simulation starts + + c. The code for [FDM halo reconstruction](https://github.com/calab-ntu/psidm-halo-reconstruction) + +3. Thin disk (optional) + + a. Create a soft link for restart + ```bash + ln -s Data_XXXXXX RESTART + ``` + + b. Set [[OPT__INIT | ]] = 2 and [[PAR_INIT | ]] = 2 and turn on [[OPT__RESTART_RESET | ]] in Input__Parameter + + c. Turn on `AddParWhenRestart` in `Input__TestProb` + + d. Set `AddParWhenRestartNPar`, `Disk_Mass`, `Disk_R`, and `DispTableFile` in `Input__TestProb` + + +# Analysis scripts +1. `particle_proj.py`, `plot_halo_slice.py` + + * Plot the projection of disk particles or halo density slice + * Output files: `particle_proj_*.png`, `Data_*_Slice_x_Dens.png` + +2. `plot_halo_density.py`, `plot_halo_potential.py` + + * Compute and plot shell-averaged halo density or gravitational potential profiles + * Output files: `Data_*_1d-Profile_radius_Dens.png`, `Halo_Dens_Data_*.npy`, + `Data_*_1d-Profile_radius_Pote.png`, `Halo_Pote_Data_*.npy` + +3. `data_disk.py` + + * Compute the disk information (rotation speed, velocity dispersion, surface density, scale height, etc.) + * Output files: `Data_Disk_*.npy` + +4. `data_halo.py` + + * Compute the halo information (enclosed mass, velocity dispersion, etc.) + * Required files: `Halo_Dens_*.npy` (generated by `plot_halo_density.py`) and `Halo_Pote_*.npy` (by `plot_halo_potential.py`) + * Output files: `Data_Halo_*.npy` + +5. `vel_distribution.py` + + * Compute the velocity distribution in 2-kpc-wide radial bins centered on R = 4, 6, 8, 10 kpc + * Output files: `Vel_data_*.npz`, `vel_*.png` + +6. `get_heating.py` + + * Compute the theoretical heating rate of the stellar disk as a function of radius + * Required files: `Data_Disk_*.npy` (generated by `data_disk.py`), `Data_Halo_*.npy` (by `data_halo.py`) + * Output files: `Heating_*.npz` + +7. `get_heating_rate_theory.py` + + * Get the time-averaged theoretical heating rate + * Required files: `Heating_*.npz` (generated by `get_heating.py`) + * Output files: printed plain text + +8. `get_heating_rate_simulation.py` + + * Compute ensemble- and time-averaged disk heating rates measured from simulation data + * Required files: `Vel_data_*.npz` (generated by `vel_distribution.py`) + * Output files: `sigma_z_sqr.png` and printed plain text + +9. `plot_data_example.py` + + * An example script to plot the angle-averaged disk rotation curve and shell-averaged density profile + * Required files: `Data_Disk_*.npy` (generated by `data_disk.py`) and/or `Data_Halo_*.npy` (by `data_halo.py`) + * Output files: `Rotation_Curve.png`, `Halo_Density_Profile.png` diff --git a/example/test_problem/ELBDM/GaussianWavePacket/README b/example/test_problem/ELBDM/GaussianWavePacket/README deleted file mode 100644 index 99dea00dd8..0000000000 --- a/example/test_problem/ELBDM/GaussianWavePacket/README +++ /dev/null @@ -1,16 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve the Gaussian wave packet for half of box -2. Apply the analytical solution as user-defined BC - --> Set OPT__BC_FLU_* = 4 - - -Note: -======================================== -1. Only support 1D --> Use "Gau_XYZ" to control the propagation direction diff --git a/example/test_problem/ELBDM/GaussianWavePacket/README.md b/example/test_problem/ELBDM/GaussianWavePacket/README.md new file mode 100644 index 0000000000..699a742d15 --- /dev/null +++ b/example/test_problem/ELBDM/GaussianWavePacket/README.md @@ -0,0 +1,18 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve the Gaussian wave packet for half of box +2. Apply the analytical solution as user-defined BC + --> Set [[OPT__BC_FLU_* | ]] = 4 + + +# Note +1. Only support 1D --> Use `Gau_XYZ` to control the propagation direction diff --git a/example/test_problem/ELBDM/HaloMerger/README b/example/test_problem/ELBDM/HaloMerger/README.md similarity index 58% rename from example/test_problem/ELBDM/HaloMerger/README rename to example/test_problem/ELBDM/HaloMerger/README.md index 68661238f7..f5d75dc7b6 100644 --- a/example/test_problem/ELBDM/HaloMerger/README +++ b/example/test_problem/ELBDM/HaloMerger/README.md @@ -4,8 +4,7 @@ Enable : MODEL=ELBDM, GRAVITY (, PARTICLE, SUPPORT_GSL) Disable: COMOVING -Default setup: -======================================== +# Default setup 1. Code units (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter = 1437.814521231748 kpc @@ -28,53 +27,52 @@ Default setup: 5. END_T 0.25 -Note: -======================================== +# Note 1. Simulate the merger of halos and solitons in an external potential -2. Edit Input_TestProb_Halo to specify the parameters for the halos +2. Edit `Input_TestProb_Halo` to specify the parameters for the halos a. Add new parameters with increasing indexes if the number of halos is more than 2 - b. For HaloMerger_Halo_InitMode == 1 - - The initial condition of halos is constructed by reading the HALO_IC file as a table and performing linear interpolation - - Note that this HALO_IC has nothing to do with the built-in option OPT__INIT = 3 - - The HALO_IC must be single AMR level - - If there is a halo UM_IC (for OPT__INIT = 3) that has multiple AMR levels (and there is Input__UM_IC_RefineRegion), - the Python script Make_UM_IC_uniform.py is provided to convert it to - a single-level UM_IC with the specified level, which can be used as the HALO_IC + b. For `HaloMerger_Halo_InitMode` == 1 + - The initial condition of halos is constructed by reading the `HALO_IC` file as a table and performing linear interpolation + - Note that this `HALO_IC` has nothing to do with the built-in option [[OPT__INIT | ]] = 3 + - The `HALO_IC` must be single AMR level + - If there is a halo `UM_IC` (for [[OPT__INIT | ]] = 3) that has multiple AMR levels (and there is `Input__UM_IC_RefineRegion`), + the Python script `Make_UM_IC_uniform.py` is provided to convert it to + a single-level `UM_IC` with the specified level, which can be used as the `HALO_IC` (However, those levels higher than Target_lv+log_2( 2*PatchSize ) cannot be handled and will be ignored) - If converting the halo UM_IC to be single-level is not feasible, - switching to the initialization option OPT__INIT = 3 to load a multi-level UM_IC is also an alternative - (However, only one UM_IC can be loaded and all the parameters in Input_TestProb_Halo will not be used) - - Note that HaloMerger_Halo_*_CenCoord* in Input__TestProb_Halo is the HALO_IC box center rather than the exact halo center + switching to the initialization option [[OPT__INIT | ]] = 3 to load a multi-level `UM_IC` is also an alternative + (However, only one `UM_IC` can be loaded and all the parameters in `Input_TestProb_Halo` will not be used) + - Note that `HaloMerger_Halo_*_CenCoord*` in `Input__TestProb_Halo` is the `HALO_IC` box center rather than the exact halo center -3. Edit Input_TestProb_Soliton to specify the parameters for the solitons +3. Edit `Input_TestProb_Soliton` to specify the parameters for the solitons a. Add new parameters with increasing indexes if the number of solitons is more than 2 - b. For HaloMerger_Soliton_InitMode == 1 + b. For `HaloMerger_Soliton_InitMode` == 1 - The initial condition of solitons is constructed by reading the table of soliton density profile - (the density profile will be rescaled to the given core radius or core density if HaloMerger_Soliton_*_DensProf_Rescale == 1) - c. For HaloMerger_Soliton_InitMode == 2 + (the density profile will be rescaled to the given core radius or core density if `HaloMerger_Soliton_*_DensProf_Rescale` == 1) + c. For `HaloMerger_Soliton_InitMode` == 2 - The initial condition of solitons is constructed by using the analytical formula of soliton density profile -4. Edit Input_TestProb_ParCloud to specify the parameters for the particle clouds +4. Edit `Input_TestProb_ParCloud` to specify the parameters for the particle clouds a. Add new parameters with increasing indexes if the number of particle clouds is more than 2 - b. For HaloMerger_ParCloud_InitMode == 1 - - The initial condition of particle clouds is constructed by reading the table of density profile and using Par_EquilibriumIC() + b. For `HaloMerger_ParCloud_InitMode` == 1 + - The initial condition of particle clouds is constructed by reading the table of density profile and using `Par_EquilibriumIC()` - The default particle clouds use the HaloDensityProfile (see Note 7. below) to represent the CDM halos - - Enable compilation options: PARTICLE, SUPPORT_GSL - - Set the parameter OPT__FREEZE_FLUID to 1 in Input__Parameter for particle-only simulations + - Enable compilation options: [[PARTICLE | ]], [[SUPPORT_GSL | ]] + - Set the parameter [[OPT__FREEZE_FLUID | ]] to 1 in `Input__Parameter` for particle-only simulations -5. Turn on OPT__EXT_POT == 1 to add external potential +5. Turn on [[OPT__EXT_POT | ]] == 1 to add external potential a. The external potential of a uniform-density sphere, which is proportional to r^2 inside and proportional to 1/r outside -6. Download the default HALO_IC file: sh download_ic.sh +6. Download the default `HALO_IC` file: `sh download_ic.sh` a. Halo mass = 4.0960e+09 Msun b. Without soliton c. N = 640, L = 0.0646921095 Mpc/h, single-precision -7. Generate the default HaloDensityProfile and SolitonDensityProfile: python Make_DensityProfile.py +7. Generate the default HaloDensityProfile and SolitonDensityProfile: `python Make_DensityProfile.py` a. The parameters for the halo density profile are used to fit the ELBDM halo -8. Some examples of yt visualization scripts are put in "plot_script" +8. Some examples of yt visualization scripts are put in `plot_script` 9. The corresponding wavelength is 0.00083778702 Mpc/h when ELBDM_MASS = 1.0e-22 and velocity = 1.0*100 km/s -> Make sure the resolution is high enough to resolve the wavelength diff --git a/example/test_problem/ELBDM/IsolatedHalo/README b/example/test_problem/ELBDM/IsolatedHalo/README deleted file mode 100644 index feb7c65c4b..0000000000 --- a/example/test_problem/ELBDM/IsolatedHalo/README +++ /dev/null @@ -1,69 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY -Disable: COMOVING - - -Default setup: -======================================== -1. Code units - (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter - (2) UNIT_V = 100 km/s - (3) UNIT_D = rho_bg (background matter density at z=0) - --> Mass density and wavefunction are normalized to rho_bg - -2. ELBDM_MASS 8.0e-23 - ELBDM_REMOVE_MOTION_CM 1 - ELBDM_TAYLOR3_AUTO 0 - -3. OPT__BC_FLU_* 1 (periodic) - OPT__BC_POT 2 (isolated) - -4. MAX_LEVEL 0 - - -Libyt covering_grid setup: -======================================== -1. Code units - (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter - (2) UNIT_V = 100 km/s - (3) UNIT_D = rho_bg (background matter density at z=0) - --> Mass density and wavefunction are normalized to rho_bg - -2. ELBDM_MASS 8.0e-23 - ELBDM_REMOVE_MOTION_CM 1 - ELBDM_TAYLOR3_AUTO 0 - -3. OPT__BC_FLU_* 1 (periodic) - OPT__BC_POT 2 (isolated) - -4. MAX_LEVEL 1 - OPT__FLAG_RHO 1 - -5. END_T 5.7116620e-03 - END_STEP 32 - -6. YT_SCRIPT libyt_script/inline_script_covering_grid - YT_VERBOSE 1 - - -Note: -======================================== -1. Download the IC file: sh download_ic.sh - -2. Some examples of yt visualization scripts are put in "yt_script" - -3. Simulate a single isolated halo extracted from a cosmological simulation - -4. About libyt covering_grid test - a. Use submit script "./libyt_script/submit_gamer.job" for job submission - - b. Put "./libyt_script/inline_script_covering_grid.py" under the same folder as gamer - - c. For determining the "left_edge" and "dims" in function "ds.covering_grid": - left_edge: LV1 resolution is 0.175/512/2 ; region covered by LV1 box (by "ds.covering_grid") is 0.175/512/2*512; 0.04375 = (0.175 - 0.175/512/2*512)/2 - dims: Plan to cover region with half of the simulation box length, i.e. will have 256X256X256 base level cells -> refine to MAX_LEVEL=1 -> LV1 cells is 512X512X512 - - d. Use "plot_slice-dens_covering_grid.py" to extract density slices from .npz files - - e. Use "make_movie.sh" to convert .png pictures into .mp4 diff --git a/example/test_problem/ELBDM/IsolatedHalo/README.md b/example/test_problem/ELBDM/IsolatedHalo/README.md new file mode 100644 index 0000000000..4d708eb893 --- /dev/null +++ b/example/test_problem/ELBDM/IsolatedHalo/README.md @@ -0,0 +1,97 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Code units + (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter + (2) UNIT_V = 100 km/s + (3) UNIT_D = rho_bg (background matter density at z=0) + --> Mass density and wavefunction are normalized to rho_bg + +2. ELBDM + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | ELBDM_REMOVE_MOTION_CM | 1 | + | ELBDM_TAYLOR3_AUTO | 0 | + +3. Boundary conditions + | Parameter name | value | + |--- |--- | + | OPT__BC_FLU_* | 1 | + | OPT__BC_POT | 2 | + +4. AMR + | Parameter name | value | + |--- |--- | + | MAX_LEVEL | 0 | + + +# Libyt covering_grid setup +1. Code units + (1) UNIT_L = Mpc/h, where h=0.6955 is the present dimensionless Hubble parameter + (2) UNIT_V = 100 km/s + (3) UNIT_D = rho_bg (background matter density at z=0) + --> Mass density and wavefunction are normalized to rho_bg + +2. ELBDM + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | ELBDM_REMOVE_MOTION_CM | 1 | + | ELBDM_TAYLOR3_AUTO | 0 | + +3. Boundary conditions + | Parameter name | value | + |--- |--- | + | OPT__BC_FLU_* | 1 | + | OPT__BC_POT | 2 | + +4. AMR + | Parameter name | value | + |--- |--- | + | MAX_LEVEL | 0 | + | OPT__FLAG_RHO | 1 | + +5. End simulation condition + | Parameter name | value | + |--- |--- | + | END_T | 5.7116620e-03 | + | END_STEP | 32 | + +6. libyt + | Parameter name | value | + |--- |--- | + | YT_SCRIPT | libyt_script/inline_script_covering_grid | + | YT_VERBOSE | 1 | + + +# Note +1. Download the IC file + ```bash + sh download_ic.sh + ``` + +2. Some examples of yt visualization scripts are put in `yt_script` + +3. Simulate a single isolated halo extracted from a cosmological simulation + +4. About libyt covering_grid test + a. Use submit script `./libyt_script/submit_gamer.job` for job submission + + b. Put `./libyt_script/inline_script_covering_grid.py` under the same folder as gamer + + c. For determining the `left_edge` and `dims` in function `ds.covering_grid`: + `left_edge`: LV1 resolution is 0.175/512/2 ; region covered by LV1 box (by `ds.covering_grid`) is 0.175/512/2*512; 0.04375 = (0.175 - 0.175/512/2*512)/2 + `dims`: Plan to cover region with half of the simulation box length, i.e. will have 256X256X256 base level cells -> refine to MAX_LEVEL=1 -> LV1 cells is 512X512X512 + + d. Use `plot_slice-dens_covering_grid.py` to extract density slices from `.npz` files + + e. Use `make_movie.sh` to convert `.png` pictures into `.mp4` diff --git a/example/test_problem/ELBDM/JeansInstabilityComoving/README b/example/test_problem/ELBDM/JeansInstabilityComoving/README deleted file mode 100644 index b11b3e0fab..0000000000 --- a/example/test_problem/ELBDM/JeansInstabilityComoving/README +++ /dev/null @@ -1,40 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY, COMOVING -Disable: PARTICLE, UNSPLIT_GRAVITY - - -Default setup: -======================================== -1. 32^3 uniform resolution - --> No grid refinement is adopted in this test - -2. DT__MAX_DELTA_A is set an extremely large number so that the time-step will - be controlled by the fluid solver - -3. The default setup in Input__Parameter and Input__TestProb gives an UNSTABLE - solution, in which the solution grows exponentially. To test a STABLE solution, - one can try the following parameters: - - Input__Parameter: - BOX_SIZE = 0.5 - A_INIT = 1.0e-5 - OUTPUT_DT = 2.0e-6 - - Input__TestProb: - Jeans_RealAmp0 = 4.0e-8 - -** This setup requires further verification - - -Note: -======================================== -1. Analytical solution reference: Woo, T. & Chiueh, T. 2009, ApJ, 697, 850 - -** Note that the imaginary part (I) grows much faster than the real part - (R). Consequently, the accuracy of linear prediction will be deteriorated - when the assumption (2R >> I^2) starts to break down, especially in the - higher-resolution tests, and hence the 2nd-order accuracy may no longer - hold. - -** 2nd-order accuracy has NOT been verified for the UNSTABLE solution diff --git a/example/test_problem/ELBDM/JeansInstabilityComoving/README.md b/example/test_problem/ELBDM/JeansInstabilityComoving/README.md new file mode 100644 index 0000000000..92a8834a6e --- /dev/null +++ b/example/test_problem/ELBDM/JeansInstabilityComoving/README.md @@ -0,0 +1,47 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[UNSPLIT_GRAVITY | Installation: Simulation-Options#UNSPLIT_GRAVITY]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. 32^3 uniform resolution + --> No grid refinement is adopted in this test + +2. [[DT__MAX_DELTA_A | ]] is set an extremely large number so that the time-step will + be controlled by the fluid solver + +3. The default setup in `Input__Parameter` and `Input__TestProb` gives an UNSTABLE + solution, in which the solution grows exponentially. To test a STABLE solution, + one can try the following parameters: + + * `Input__Parameter`: + - BOX_SIZE = 0.5 + - A_INIT = 1.0e-5 + - OUTPUT_DT = 2.0e-6 + + * `Input__TestProb`: + - Jeans_RealAmp0 = 4.0e-8 + +> [!CAUTION] +> This setup requires further verification + + +# Note +1. Analytical solution reference: Woo, T. & Chiueh, T. 2009, ApJ, 697, 850 + +> [!NOTE] +> The imaginary part `I` grows much faster than the real part `R`. + Consequently, the accuracy of linear prediction will be deteriorated + when the assumption (2R >> I^2) starts to break down, especially in the + higher-resolution tests, and hence the 2nd-order accuracy may no longer + hold. + +> [!CAUTION] +> 2nd-order accuracy has NOT been verified for the UNSTABLE solution diff --git a/example/test_problem/ELBDM/LSS/README b/example/test_problem/ELBDM/LSS/README deleted file mode 100644 index b103b45e74..0000000000 --- a/example/test_problem/ELBDM/LSS/README +++ /dev/null @@ -1,32 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY, COMOVING -Disable: PARTICLE - - -Default setup: -======================================== -1. ELBDM_MASS 8.0e-23 (eV/c^2) - A_INIT 3.124024e-4 - OMEGA_M0 0.2835 - HUBBLE0 0.6955 - BOX_SIZE 1.4 (Mpc/h) - -2. MAX_LEVEL 3 - OPT__FLAG_RHO 1 - OPT__FLAG_LOHNER_DENS 1 - --> Input__Flag_Rho = example/input/Input__Flag_Rho8 - Input__Flag_Lohner = example/input/Input__Flag_Lohner__FLASH1_LSS_DH3.0 - - -Note: -======================================== -1. Cosmological large-scale structure simulations - -2. Download the IC file: sh download_ic.sh - -3. Default maximum resolution is low - --> Only 1.4/(256*2^3) ~ 0.7 kpc/h (comoving) - --> Can only marginally resolve a central soliton - -4. Some yt visualization scripts are put in "plot_script" diff --git a/example/test_problem/ELBDM/LSS/README.md b/example/test_problem/ELBDM/LSS/README.md new file mode 100644 index 0000000000..05c9204f0c --- /dev/null +++ b/example/test_problem/ELBDM/LSS/README.md @@ -0,0 +1,46 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Cosmological constants + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 8.0e-23 | + | A_INIT | 3.124024e-4 | + | OMEGA_M0 | 0.2835 | + | HUBBLE0 | 0.6955 | + +2. Simulation + | Parameter name | value | + |--- |--- | + | BOX_SIZE | 1.4 | + | MAX_LEVEL | 3 | + | OPT__FLAG_RHO | 1 | + | OPT__FLAG_LOHNER_DENS | 1 | + +3. Flag tables + * `Input__Flag_Rho`: `example/input/Input__Flag_Rho8` + * `Input__Flag_Lohner`: `example/input/Input__Flag_Lohner__FLASH1_LSS_DH3.0` + + +# Note +1. Cosmological large-scale structure simulations + +2. Download the IC file + ```bash + sh download_ic.sh + ``` + +3. Default maximum resolution is low + * Only 1.4/(256*2^3) ~ 0.7 kpc/h (comoving) + * Can only marginally resolve a central soliton + +4. Some yt visualization scripts are put in `plot_script` diff --git a/example/test_problem/ELBDM/LSS_Hybrid/README b/example/test_problem/ELBDM/LSS_Hybrid/README deleted file mode 100644 index e39786c0d6..0000000000 --- a/example/test_problem/ELBDM/LSS_Hybrid/README +++ /dev/null @@ -1,66 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, ELBDM_SCHEME=ELBDM_HYBRID, GRAVITY, COMOVING -Disable: PARTICLE - - -Default setup: -======================================== -1. ELBDM_MASS 2.0e-23 (eV/c^2) - A_INIT 9.900990099e-3 # initial scale factor - OMEGA_M0 0.3158230904284232 # omega matter at the present time - HUBBLE0 0.6732117 # dimensionless Hubble parameter (currently only for converting ELBDM_MASS to code units) - BOX_SIZE 2.8 (Mpc/h) - -2. MAX_LEVEL 6 - OPT__FLAG_SPECTRAL 1 - OPT__FLAG_INTERFERENCE 1 - --> Input__Flag_Rho = example/input/Input__Flag_Rho8 - Input__Flag_Spectral = example/input/Input__Flag_Spectral - Input__Flag_Interference = example/input/Input__Flag_Interference - - -Note: -======================================== -1. Cosmological large-scale structure simulations using hybrid scheme - -2. Quickstart: - 1. Download the IC file: "sh download_light_halo_ic.sh" or "sh download_heavy_halo_ic.sh" - 2. For spectral interpolation: - - Download spectral interpolation tables with "sh download_spectral_interpolation_tables.sh" - - Set OPT__FLU_INT_SCHEME and OPT__REF_FLU_INT_SCHEME to 8 - 3. Compile GAMER and run simulation to redshift 0 with default settings. - -3. Explanation: - 1. IC - The wave IC consisting of two blocks of real and imaginary parts are converted to hybrid IC - consisting of two blocks with the density and phase fields using the Python script "elbdm_wave_to_hybrid_IC.py" - - It can be used as follows: - ```python elbdm_wave_to_hybrid_IC.py -resolution 256 -input UM_IC_wave -output UM_IC_hybrid``` - to convert the input file "UM_IC_wave" with a resolution of 256 points in each dimension to the output hybrid IC "UM_IC_hybrid". Optionally, it accepts the keyword -float8 for double precision input data. - The conversion is only well-defined if the IC do not contain vortices, i.e. at high redshift for cosmological IC. - - In a second step, the initial conditions can be rescaled using the Python script "elbdm_rescale_periodic_ic.py". - It can be used as follows: - ```python elbdm_rescale_periodic_ic.py -n_in 256 -n_out 64 -input UM_IC_high_resolution -output UM_IC_low_resolution``` - and supports up- and downscaling periodic wave and hybrid IC. Optionally, it accepts the keyword -float8 for double precision input data. - 2. Interpolation tables - The tables can be recreated by calling "mpirun -n 16 python3 tool/table_maker/GramFE/compute_interpolation_tables.py". INT_SPEC_TABLE_PATH (default = "./") must be set to a folder containing the folders "interpolation_tables" and "boundary2extension_tables" - -3. The simulation uses a low base-level resolution of 2.8 Mpc/h / 64 ~ 44 kpc/h (comoving). - This corresponds to a maximum wave vector k ~ 72 h/Mpc well above the cutoff power in the initial conditions for m = 2.0e-23 eV. This initial resolution has shown very good agreement with higher resolution wave initial conditions. - -4. The simulation uses the fluid solver on levels 0 - 3 and switches to the wave solver in regions of interference on level 4. - The corresponding runtime parameter "ELBDM_FIRST_WAVE_LEVEL" is set to 4. - - The resolution for the first level using the wave solver is 2.8 Mpc/h /(64*2^4) ~ 2.75 kpc/h (comoving) with these settings. - This resolution has shown to be a good compromise for the starting resolution of the wave solver. - Note that increasing "ELBDM_FIRST_WAVE_LEVEL" will affect performance since it will likely lead to overrefinement. However, it should increase the accuracy of the hybrid scheme. - On the contrary, decreasing "ELBDM_FIRST_WAVE_LEVEL" will lead to a lower-resolution at the wave-fluid boundary (regardless of MAX_LEVEL and REFINE_NLEVEL) and will negatively affect the accuracy of the solver. - -3. Default maximum resolution is low - --> Only 2.8/(64*2^6) ~ 0.7 kpc/h (comoving) - --> Can only marginally resolve a central soliton - -4. Some yt visualization scripts are put in "plot_script" \ No newline at end of file diff --git a/example/test_problem/ELBDM/LSS_Hybrid/README.md b/example/test_problem/ELBDM/LSS_Hybrid/README.md new file mode 100644 index 0000000000..a3c3d4a45f --- /dev/null +++ b/example/test_problem/ELBDM/LSS_Hybrid/README.md @@ -0,0 +1,85 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Cosmological constants + | Parameter name | value | + |--- |--- | + | ELBDM_MASS | 2.0e-23 | + | A_INIT | 9.900990099e-3 | + | OMEGA_M0 | 0.3158230904284232 | + | HUBBLE0 | 0.6732117 | + +2. Simulation + | Parameter name | value | + |--- |--- | + | BOX_SIZE` | 2.8 | + | MAX_LEVEL | 6 | + | OPT__FLAG_SPECTRAL | 1 | + | OPT__FLAG_INTERFERENCE | 1 | + +3. Flag tables + * `Input__Flag_Rho`: example/input/Input__Flag_Rho8 + * `Input__Flag_Spectral`: example/input/Input__Flag_Spectral + * `Input__Flag_Interference`: example/input/Input__Flag_Interference + + +Note: +======================================== +1. Cosmological large-scale structure simulations using hybrid scheme + +2. Quickstart: + 1. Download the IC file: `sh download_light_halo_ic.sh` or `sh download_heavy_halo_ic.sh` + 2. For spectral interpolation: + - Download spectral interpolation tables with `sh download_spectral_interpolation_tables.sh` + - Set `OPT__FLU_INT_SCHEME` and `OPT__REF_FLU_INT_SCHEME` to 8 + 3. Compile GAMER and run simulation to redshift 0 with default settings. + +3. Explanation: + 1. IC + + The wave IC consisting of two blocks of real and imaginary parts are converted to hybrid IC + consisting of two blocks with the density and phase fields using the Python script `elbdm_wave_to_hybrid_IC.py` + + It can be used as follows: + ```bash + python elbdm_wave_to_hybrid_IC.py -resolution 256 -input UM_IC_wave -output UM_IC_hybrid + ``` + to convert the input file `UM_IC_wave` with a resolution of 256 points in each dimension to the output hybrid IC `UM_IC_hybrid`. Optionally, it accepts the keyword -float8 for double precision input data. + The conversion is only well-defined if the IC do not contain vortices, i.e. at high redshift for cosmological IC. + + In a second step, the initial conditions can be rescaled using the Python script `elbdm_rescale_periodic_ic.py`. + It can be used as follows: + ```bash + python elbdm_rescale_periodic_ic.py -n_in 256 -n_out 64 -input UM_IC_high_resolution -output UM_IC_low_resolution + ``` + and supports up- and downscaling periodic wave and hybrid IC. Optionally, it accepts the keyword -float8 for double precision input data. + 2. Interpolation tables + + The tables can be recreated by calling `mpirun -n 16 python3 tool/table_maker/GramFE/compute_interpolation_tables.py`. `INT_SPEC_TABLE_PATH` (default = "./") must be set to a folder containing the folders `interpolation_tables` and `boundary2extension_tables` + +3. The simulation uses a low base-level resolution of 2.8 Mpc/h / 64 ~ 44 kpc/h (comoving). + This corresponds to a maximum wave vector k ~ 72 h/Mpc well above the cutoff power in the initial conditions for m = 2.0e-23 eV. This initial resolution has shown very good agreement with higher resolution wave initial conditions. + +4. The simulation uses the fluid solver on levels 0 - 3 and switches to the wave solver in regions of interference on level 4. + The corresponding runtime parameter `ELBDM_FIRST_WAVE_LEVEL` is set to 4. + + The resolution for the first level using the wave solver is 2.8 Mpc/h /(64*2^4) ~ 2.75 kpc/h (comoving) with these settings. + This resolution has shown to be a good compromise for the starting resolution of the wave solver. + Note that increasing [[ELBDM_FIRST_WAVE_LEVEL | ]] will affect performance since it will likely lead to overrefinement. However, it should increase the accuracy of the hybrid scheme. + On the contrary, decreasing [[ELBDM_FIRST_WAVE_LEVEL | ]] will lead to a lower-resolution at the wave-fluid boundary (regardless of [[MAX_LEVEL | ]] and [[REFINE_NLEVEL | ]]) and will negatively affect the accuracy of the solver. + +3. Default maximum resolution is low + --> Only 2.8/(64*2^6) ~ 0.7 kpc/h (comoving) + --> Can only marginally resolve a central soliton + +4. Some yt visualization scripts are put in `plot_script` diff --git a/example/test_problem/ELBDM/Perturbation/README b/example/test_problem/ELBDM/Perturbation/README deleted file mode 100644 index 4bf36e984c..0000000000 --- a/example/test_problem/ELBDM/Perturbation/README +++ /dev/null @@ -1,18 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, HYBRID, GRAVITY -Disable: PARTICLE, COMOVING - -Default setup: -======================================== -1. Study gravitational collapse in one, two and three dimensions (2D by default) -2. Use periodic boundary conditions -3. Demonstrate refinement in hybrid scheme by using Input__Flag_Interference -4. Compared to JeansInstabilityComoving, this test also supports 1D, 2D and 3D collapse - -Note: -======================================== -1. Evolve small-amplitude plane waves on homogeneous background density -2. Perturbation_Amplitude is maximum amplitude of individual perturbations, Perturbation_BgAmplitude is amplitude of background density, Perturbation_N is number of Fourier modes in perturbation (maximum is 4) -3. Dimensionality of the problem can be set via Perturbation_NDim (set amplitude of plane waves in other dimensions to zero) -3. For reference simulation using base-level spectral method, use MODEL = WAVE and Input__Parameter_BaseSpectral and generate_make_BaseSpectral.sh diff --git a/example/test_problem/ELBDM/Perturbation/README.md b/example/test_problem/ELBDM/Perturbation/README.md new file mode 100644 index 0000000000..03e78a1187 --- /dev/null +++ b/example/test_problem/ELBDM/Perturbation/README.md @@ -0,0 +1,23 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Study gravitational collapse in one, two and three dimensions (2D by default) +2. Use periodic boundary conditions +3. Demonstrate refinement in hybrid scheme by using `Input__Flag_Interference` +4. Compared to JeansInstabilityComoving, this test also supports 1D, 2D and 3D collapse + +# Note +1. Evolve small-amplitude plane waves on homogeneous background density +2. `Perturbation_Amplitude` is maximum amplitude of individual perturbations, `Perturbation_BgAmplitude` is amplitude of background density, `Perturbation_N` is number of Fourier modes in perturbation (maximum is 4) +3. Dimensionality of the problem can be set via `Perturbation_NDim` (set amplitude of plane waves in other dimensions to zero) +3. For reference simulation using base-level spectral method, use `MODEL = WAVE` and `Input__Parameter_BaseSpectral` and `generate_make_BaseSpectral.sh` diff --git a/example/test_problem/ELBDM/PlaneWave/README b/example/test_problem/ELBDM/PlaneWave/README deleted file mode 100644 index 086d1d4dcc..0000000000 --- a/example/test_problem/ELBDM/PlaneWave/README +++ /dev/null @@ -1,16 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, FLOAT8, NCOMP_PASSIVE_USER=1 -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve the plane wave for six periods -2. Apply the periodic BC - --> Set OPT__BC_FLU_* = 1 - - -Note: -======================================== -1. Only support 1D --> Use "PWave_XYZ" to control the propagation direction diff --git a/example/test_problem/ELBDM/PlaneWave/README.md b/example/test_problem/ELBDM/PlaneWave/README.md new file mode 100644 index 0000000000..0d204e8804 --- /dev/null +++ b/example/test_problem/ELBDM/PlaneWave/README.md @@ -0,0 +1,20 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[FLOAT8 | Installation: Simulation-Options#FLOAT8]] + - [[NCOMP_PASSIVE_USER=1 | Installation: Simulation-Options#NCOMP_PASSIVE_USER]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve the plane wave for six periods +2. Apply the periodic BC + --> Set [[OPT__BC_FLU_* | ]] = 1 + + +# Note +1. Only support 1D --> Use `PWave_XYZ` to control the propagation direction diff --git a/example/test_problem/ELBDM/SelfSimilarHalo/README b/example/test_problem/ELBDM/SelfSimilarHalo/README deleted file mode 100644 index 92c1b60c94..0000000000 --- a/example/test_problem/ELBDM/SelfSimilarHalo/README +++ /dev/null @@ -1,14 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY, COMOVING -Disable: PARTICLE - - -Default setup: -======================================== - - -Note: -======================================== -1. Test the evolution of the self-similar solution of halos in the comoving frame - diff --git a/example/test_problem/ELBDM/SelfSimilarHalo/README.md b/example/test_problem/ELBDM/SelfSimilarHalo/README.md new file mode 100644 index 0000000000..6fd5ddb5fd --- /dev/null +++ b/example/test_problem/ELBDM/SelfSimilarHalo/README.md @@ -0,0 +1,16 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[COMOVING | Installation: Simulation-Options#COMOVING]] +- Must disable + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup + + +# Note +1. Test the evolution of the self-similar solution of halos in the comoving frame diff --git a/example/test_problem/ELBDM/Soliton/README b/example/test_problem/ELBDM/Soliton/README deleted file mode 100644 index 74960f341b..0000000000 --- a/example/test_problem/ELBDM/Soliton/README +++ /dev/null @@ -1,20 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, GRAVITY -Disable: PARTICLE, UNSPLIT_GRAVITY, COMOVING - - -Default setup: -======================================== -1. NX0_TOT_X/Y/Z = 96 -2. MAX_LEVEL = 2 - - -Note: -======================================== -1. Soliton_N = 1: test a single soliton - --> Set Soliton_RSeed < 0 - Set Soliton_EmptyRegion = 0.0 - Soliton_N > 1: soliton merger - --> Set Soliton_RSeed >= 0 - Set Soliton_EmptyRegion > 0.0 (e.g., 1.0e2) diff --git a/example/test_problem/ELBDM/Soliton/README.md b/example/test_problem/ELBDM/Soliton/README.md new file mode 100644 index 0000000000..de22381f72 --- /dev/null +++ b/example/test_problem/ELBDM/Soliton/README.md @@ -0,0 +1,25 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] +- Must disable + - [[COMOVING | Installation: Simulation-Options#COMOVING]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] + - [[UNSPLIT_GRAVITY | Installation: Simulation-Options#UNSPLIT_GRAVITY]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. [[NX0_TOT_X/Y/Z | ]] = 96 +2. [[MAX_LEVEL | Runtime-Parameters:-Refinement#MAX_LEVEL]] = 2 + + +# Note +1. `Soliton_N` = 1: test a single soliton + * Set `Soliton_RSeed` < 0 + * Set `Soliton_EmptyRegion` = 0.0 + +2. `Soliton_N` > 1: soliton merger + * Set `Soliton_RSeed` >= 0 + * Set `Soliton_EmptyRegion` > 0.0 (e.g., 1.0e2) diff --git a/example/test_problem/ELBDM/VortexPairLinear/README b/example/test_problem/ELBDM/VortexPairLinear/README deleted file mode 100644 index 9df1157b27..0000000000 --- a/example/test_problem/ELBDM/VortexPairLinear/README +++ /dev/null @@ -1,24 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve vortex pair for one period -2. Use the periodic boundary conditions -3. Wavelengths along x and y can be adjusted to multiples of the box size -4. Wave in z-direction is turned off by default - - -Note: -======================================== -1. Evolve vortex pair with linear motion along x in a 2D simulation - --> Wave function psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) ) - where A is a constant on the order of background, kx and ky are wavenumbers, - Omega=0.5/ELBDM_ETA*(kx^2+ky^2), and Phase0 is a phase constant -2. Optionally: Add wave in z direction - --> psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) ) - where background_z is a constant on the order of background, kz is a wavenumber and - Omega=0.5/ELBDM_ETA*(kz^2) \ No newline at end of file diff --git a/example/test_problem/ELBDM/VortexPairLinear/README.md b/example/test_problem/ELBDM/VortexPairLinear/README.md new file mode 100644 index 0000000000..4a15cc4cea --- /dev/null +++ b/example/test_problem/ELBDM/VortexPairLinear/README.md @@ -0,0 +1,27 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the periodic boundary conditions +3. Wavelengths along x and y can be adjusted to multiples of the box size +4. Wave in z-direction is turned off by default + + +# Note +1. Evolve vortex pair with linear motion along x in a 2D simulation + --> Wave function `psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) )` + where `A` is a constant on the order of background, `kx` and `ky` are wavenumbers, + `Omega=0.5/ELBDM_ETA*(kx^2+ky^2)`, and `Phase0` is a phase constant +2. Optionally: Add wave in `z` direction + --> `psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) )` + where `background_z` is a constant on the order of background, `kz` is a wavenumber and + `Omega=0.5/ELBDM_ETA*(kz^2)` diff --git a/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README b/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README deleted file mode 100644 index b46ee019db..0000000000 --- a/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README +++ /dev/null @@ -1,25 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, ELBDM_SCHEME=ELBDM_HYBRID -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve vortex pair for one period -2. Use the periodic boundary conditions -3. Wavelengths along x and y can be adjusted to multiples of the box size -4. Wave in z-direction is turned off by default - - -Note: -======================================== -1. Evolve vortex pair with linear motion along x in a 2D simulation - --> Wave function psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) ) - where A is a constant on the order of background, kx and ky are wavenumbers, - Omega=0.5/ELBDM_ETA*(kx^2+ky^2), and Phase0 is a phase constant -2. Optionally: Add wave in z direction - --> psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) ) - where background_z is a constant on the order of background, kz is a wavenumber and - Omega=0.5/ELBDM_ETA*(kz^2) -3. If CONSERVE_MASS is enabled, mass ought to be conserved in this test because of periodic boundary conditions \ No newline at end of file diff --git a/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README.md b/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README.md new file mode 100644 index 0000000000..1657298a52 --- /dev/null +++ b/example/test_problem/ELBDM/VortexPairLinear_Hybrid/README.md @@ -0,0 +1,28 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the periodic boundary conditions +3. Wavelengths along x and y can be adjusted to multiples of the box size +4. Wave in z-direction is turned off by default + + +# Note +1. Evolve vortex pair with linear motion along x in a 2D simulation + --> Wave function `psi_vorpair(x,y) = background + A*cos(ky*y)*exp( i*(kx*x-Omega*t+Phase0) )` + where `A` is a constant on the order of background, `kx` and `ky` are wavenumbers, + `Omega=0.5/ELBDM_ETA*(kx^2+ky^2)`, and `Phase0` is a phase constant +2. Optionally: Add wave in `z` direction + --> `psi(x, y, z) = psi_vorpair(x,y) + background_z * exp( i*(kz*z-ZWaveOmega*t) )` + where `background_z` is a constant on the order of background, `kz` is a wavenumber and + `Omega=0.5/ELBDM_ETA*(kz^2)` +3. If [[CONSERVE_MASS | ]] is enabled, mass ought to be conserved in this test because of periodic boundary conditions diff --git a/example/test_problem/ELBDM/VortexPairRotating/README b/example/test_problem/ELBDM/VortexPairRotating/README deleted file mode 100644 index f7be93ba0e..0000000000 --- a/example/test_problem/ELBDM/VortexPairRotating/README +++ /dev/null @@ -1,20 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve vortex pair for one period -2. Use the analytical solution as the boundary conditions - - -Note: -======================================== -1. Evolve a rotating vortex pair in 2D - --> Wave function psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) ), - where A is a constant on the order of background, Eta=ELBDM_MASS/PLANCK_CONSTANT, - phi is azimuthal angle, R is radius, Omega is angular frequency, and Phase0 is a phase constant -2. Ref: Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101, - Vortex turbulence in linear Schrödinger wave mechanics diff --git a/example/test_problem/ELBDM/VortexPairRotating/README.md b/example/test_problem/ELBDM/VortexPairRotating/README.md new file mode 100644 index 0000000000..f971c43c4d --- /dev/null +++ b/example/test_problem/ELBDM/VortexPairRotating/README.md @@ -0,0 +1,23 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the analytical solution as the boundary conditions + + +# Note +1. Evolve a rotating vortex pair in 2D + --> Wave function `psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) )`, + where `A` is a constant on the order of background, `Eta=ELBDM_MASS/PLANCK_CONSTANT`, + `phi` is azimuthal angle, `R` is radius, `Omega` is angular frequency, and `Phase0` is a phase constant +2. Ref: [Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101](https://doi.org/10.1088/0953-4075/44/11/115101), + Vortex turbulence in linear Schrödinger wave mechanics diff --git a/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README b/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README deleted file mode 100644 index ec14cd4f27..0000000000 --- a/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README +++ /dev/null @@ -1,20 +0,0 @@ -Compilation flags: -======================================== -Enable : MODEL=ELBDM, ELBDM_SCHEME=HYBRID -Disable: GRAVITY, PARTICLE - - -Default setup: -======================================== -1. Evolve vortex pair for one period -2. Use the analytical solution as the boundary conditions - - -Note: -======================================== -1. Evolve a rotating vortex pair in 2D - --> Wave function psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) ), - where A is a constant on the order of background, Eta=ELBDM_MASS/PLANCK_CONSTANT, - phi is azimuthal angle, R is radius, Omega is angular frequency, and Phase0 is a phase constant -2. Ref: Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101, - Vortex turbulence in linear Schrödinger wave mechanics diff --git a/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README.md b/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README.md new file mode 100644 index 0000000000..f971c43c4d --- /dev/null +++ b/example/test_problem/ELBDM/VortexPairRotating_Hybrid/README.md @@ -0,0 +1,23 @@ +# Compilation flags +- Must enable + - [[MODEL=ELBDM | Installation: Simulation-Options#MODEL]] + - [[ELBDM_SCHEME=ELBDM_HYBRID | Installation: Simulation-Options#ELBDM_SCHEME]] +- Must disable + - [[GRAVITY | Installation: Simulation-Options#GRAVITY]] + - [[PARTICLE | Installation: Simulation-Options#PARTICLE]] +- Available options + - [[Miscellaneous Options | Installation: Simulation-Options#miscellaneous-options]] + + +# Default setup +1. Evolve vortex pair for one period +2. Use the analytical solution as the boundary conditions + + +# Note +1. Evolve a rotating vortex pair in 2D + --> Wave function `psi(R,phi) = background - A*J1( sqrt(2*Eta*Omega)*R )*exp( i*(phi-Omega*t+Phase0) )`, + where `A` is a constant on the order of background, `Eta=ELBDM_MASS/PLANCK_CONSTANT`, + `phi` is azimuthal angle, `R` is radius, `Omega` is angular frequency, and `Phase0` is a phase constant +2. Ref: [Tzihong Chiueh et al 2011 J. Phys. B: At. Mol. Opt. Phys. 44 115101](https://doi.org/10.1088/0953-4075/44/11/115101), + Vortex turbulence in linear Schrödinger wave mechanics