-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ELBDM/UniformGranule test problem #135
base: psidm
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I left some comments here.
example/test_problem/ELBDM/UniformGranule/Input__UM_IC_RefineRegion
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Init_TestProb_ELBDM_UniformGranule.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Init_TestProb_ELBDM_UniformGranule.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Init_TestProb_ELBDM_UniformGranule.cpp
Outdated
Show resolved
Hide resolved
example/test_problem/ELBDM/UniformGranule/python_script/get_vel_dispersion.py
Outdated
Show resolved
Hide resolved
example/test_problem/ELBDM/UniformGranule/python_script/plot_correlation.py
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Init_TestProb_ELBDM_UniformGranule.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeProfile_with_Sigma.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeProfile_with_Sigma.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. I left some comment here.
Because I'm not familiar with the correlation function, could you please share the reference about how to calculate it? I confused why divided by std^2 or mean^2.
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeProfile_with_Sigma.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeCorrelation.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeCorrelation.cpp
Outdated
Show resolved
Hide resolved
src/TestProblem/ELBDM/UniformGranule/Aux_ComputeCorrelation.cpp
Outdated
Show resolved
Hide resolved
example/test_problem/ELBDM/UniformGranule/python_script/get_vel_dispersion.py
Show resolved
Hide resolved
example/test_problem/ELBDM/UniformGranule/python_script/plot_correlation.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have one minor comment.
src/TestProblem/ELBDM/UniformGranule/Init_TestProb_ELBDM_UniformGranule.cpp
Outdated
Show resolved
Hide resolved
@HsunYeong
An example of the download script: #!/bin/bash
LOCAL_FILENAME="uniform-granule"
FILE_ID="677cc1c3999605c485c8de80"
# 1. download
curl https://hub.yt/api/v1/item/${FILE_ID}/download -o "${LOCAL_FILENAME}.tar.gz"
# 2. unzip
tar -zxvf ${LOCAL_FILENAME}.tar.gz
rm ${LOCAL_FILENAME}.tar.gz See also gamer-project#408. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HsunYeong Thanks for the contribution! I've added some comments, mostly regarding wording and formatting.
The only major suggestion is to file a separate PR to add support for computing standard deviation in Aux_ComputeProfile.cpp
.
Additionally, please merge the latest psidm
branch.
NX0_TOT_X 128 # number of base-level cells along x | ||
NX0_TOT_Y 128 # number of base-level cells along y | ||
NX0_TOT_Z 128 # number of base-level cells along z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increase to 256
to match the updated default value in psidm-uniform-granule-ic/input_parameter
${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \ | ||
--model=ELBDM --gravity=true --passive=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge the latest psidm
branch, which supports a default --machine
.
${PYTHON} configure.py --machine=eureka_intel --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \ | |
--model=ELBDM --gravity=true --passive=1 | |
${PYTHON} configure.py --mpi=true --hdf5=true --fftw=FFTW3 --gpu=true \ | |
--model=ELBDM --gravity=true --passive=1 "$@" |
UNIT_L 3.0856800e+21 # length unit (<=0 -> set to UNIT_V*UNIT_T or (UNIT_M/UNIT_D)^(1/3)) [-1.0] | ||
UNIT_M -1.0 # mass unit (<=0 -> set to UNIT_D*UNIT_L^3) [-1.0] | ||
UNIT_T -1.0 # time unit (<=0 -> set to UNIT_L/UNIT_V) [-1.0] | ||
UNIT_V 1.0000000e+05 # velocity unit (<=0 -> set to UNIT_L/UNIT_T) [-1.0] | ||
UNIT_D 6.7698980e-22 # mass density unit (<=0 -> set to UNIT_M/UNIT_L^3) [-1.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To align with the default setup in psidm-uniform-granule-ic/input_parameter
UNIT_L 3.0856800e+21 # length unit (<=0 -> set to UNIT_V*UNIT_T or (UNIT_M/UNIT_D)^(1/3)) [-1.0] | |
UNIT_M -1.0 # mass unit (<=0 -> set to UNIT_D*UNIT_L^3) [-1.0] | |
UNIT_T -1.0 # time unit (<=0 -> set to UNIT_L/UNIT_V) [-1.0] | |
UNIT_V 1.0000000e+05 # velocity unit (<=0 -> set to UNIT_L/UNIT_T) [-1.0] | |
UNIT_D 6.7698980e-22 # mass density unit (<=0 -> set to UNIT_M/UNIT_L^3) [-1.0] | |
UNIT_L 3.0856800e+21 # length unit (<=0 -> set to UNIT_V*UNIT_T or (UNIT_M/UNIT_D)^(1/3)) [-1.0] | |
UNIT_M 1.9890000e+43 # mass unit (<=0 -> set to UNIT_D*UNIT_L^3) [-1.0] | |
UNIT_T -1.0 # time unit (<=0 -> set to UNIT_L/UNIT_V) [-1.0] | |
UNIT_V 1.0000000e+05 # velocity unit (<=0 -> set to UNIT_L/UNIT_T) [-1.0] | |
UNIT_D -1.0 # mass density unit (<=0 -> set to UNIT_M/UNIT_L^3) [-1.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support MPI parallelization by adding something like the following lines. Please refer to Plummer/plot_script/plot_gas.py
.
yt.enable_parallelism()
ts = yt.DatasetSeries( [ prefix+'/Data_%06d'%idx for idx in range(idx_start, idx_end+1, didx) ] )
for ds in ts.piter():
NX0_TOT_Y 128 # number of base-level cells along y | ||
NX0_TOT_Z 128 # number of base-level cells along z | ||
OMP_NTHREAD -1 # number of OpenMP threads (<=0=auto) [-1] ##OPENMP ONLY## | ||
END_T 1.00e0 # end physical time (<0=auto -> must be set by test problems or restart) [-1.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit too long for the default initial condition with a wavelength of 0.00669212 and a velocity of 6, corresponding to a characteristic timescale of roughly 0.00669212/6 ~ 1e-3
. I suggest END_T=2.0e-3
and OUTPUT_DT=4.0e-5
.
|
||
if ( MPI_Rank == 0 ) Aux_Message( stdout, "InitialTime = %13.6e \n", InitialTime ); | ||
|
||
// compute the enter position for passive field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// compute the enter position for passive field | |
// determine the central position for computing correlation function |
if ( MPI_Rank == 0 ) Aux_Message( stdout, "InitialTime = %13.6e \n", InitialTime ); | ||
|
||
// compute the enter position for passive field | ||
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate halo center for passive field:\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate halo center for passive field:\n"); | |
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate the initial center-of-mass position:\n"); |
} | ||
Aux_FindWeightedAverageCenter( Center, CoM_ref, COM_MAX_R, COM_MIN_RHO, _TOTAL_DENS, COM_TOLERR_R, COM_MAX_ITER, &FinaldR, &FinalNIter ); | ||
|
||
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Center of passive field is ( %14.11e,%14.11e,%14.11e )\n", Center[0], Center[1], Center[2] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Center of passive field is ( %14.11e,%14.11e,%14.11e )\n", Center[0], Center[1], Center[2] ); | |
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Initial center-of-mass position is ( %14.11e,%14.11e,%14.11e )\n", Center[0], Center[1], Center[2] ); |
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Center of passive field is ( %14.11e,%14.11e,%14.11e )\n", Center[0], Center[1], Center[2] ); | ||
|
||
// commpute density profile for passive field | ||
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate density profile for passive field:\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate density profile for passive field:\n"); | |
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Calculate initial density profile:\n"); |
} | ||
if ( OPT__BC_POT != BC_POT_PERIODIC ) | ||
Aux_Error( ERROR_INFO, "must set periodic BC for gravity --> reset OPT__BC_POT to 1 !!\n" ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a sanity check on OPT__RECORD_USER
when enabling ComputeCorrelation
.
OPT__RECORD_PERFORMANCE 1 # record the code performance [1] | ||
OPT__MANUAL_CONTROL 1 # support manually dump data, stop run, or pause run during the runtime | ||
# (by generating the file DUMP_GAMER_DUMP, STOP_GAMER_STOP, PAUSE_GAMER_PAUSE, respectively) [1] | ||
OPT__RECORD_CENTER 1 # record the position of maximum density, minimum potential, and center of mass [0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why enable this? Note that it's executed after Init_User_Ptr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about mentioning that one must turn on OPT__RECORD_USER
and set COM_*
properly for ComputeCorrelation
?
Add a test problem to simulate periodic box with homogeneous FDM granule initial condition.