Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ For variables with `Default/Min/Max` labeled as `Depend`, click the parameter na
| [[ OPT__OUTPUT_USER_FIELD \| Runtime-Parameters:-Outputs#OPT__OUTPUT_USER_FIELD ]] | 0 | None | None | output user-defined derived fields [0] -> edit "Flu_DerivedField_User.cpp" |
| OPT__OVERLAP_MPI | 0 | None | None | overlap MPI communication with CPU/GPU computations [0] ##NOT SUPPORTED YET## |
| [[ OPT__PARTICLE_COUNT \| Runtime-Parameters:-Refinement#OPT__PARTICLE_COUNT ]] | 1 | 0 | 2 | record the # of particles at each level: (0=off, 1=every step, 2=every sub-step) [1] |
| [[ OPT__PAR_INIT_CHECK \| Runtime-Parameters:-Particles#OPT__PAR_INIT_CHECK ]] | 1 | None | None | check particle initialization (only works for PAR_INIT != 2) [1] |
| [[ OPT__PATCH_COUNT \| Runtime-Parameters:-Refinement#OPT__PATCH_COUNT ]] | 1 | 0 | 2 | record the # of patches at each level: (0=off, 1=every step, 2=every sub-step) [1] |
| [[ OPT__POT_INT_SCHEME \| Runtime-Parameters:-Interpolation#OPT__POT_INT_SCHEME ]] | INT_CQUAD | 4 | 5 | ghost-zone potential for the Poisson solver (only supports 4 & 5) [4] |
| [[ OPT__RECORD_CENTER \| Runtime-Parameters:-Miscellaneous#OPT__RECORD_CENTER ]] | 0 | None | None | record the position of maximum density, minimum potential, and center of mass [0] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Parameters described on this page:
[PAR_IMPROVE_ACC](#PAR_IMPROVE_ACC),  
[PAR_PREDICT_POS](#PAR_PREDICT_POS),  
[PAR_REMOVE_CELL](#PAR_REMOVE_CELL),  
[OPT__FREEZE_PAR](#OPT__FREEZE_PAR)  
[OPT__FREEZE_PAR](#OPT__FREEZE_PAR),  
[OPT__PAR_INIT_CHECK](#OPT__PAR_INIT_CHECK)  


Parameters below are shown in the format:   **`Name`   (Valid Values)   [Default Value]**
Expand Down Expand Up @@ -150,6 +151,13 @@ Do not update particle position and velocity (except for tracer particles).
It can be useful for evolving fluid in a static gravitational potential of particles.
* **Restriction:**

<a name="OPT__PAR_INIT_CHECK"></a>
* #### `OPT__PAR_INIT_CHECK` &ensp; (0=off, 1=on) &ensp; [1]
* **Description:**
Check particle initialization by calling `Par_Aux_InitCheck()` function after particle initialization (only works for [PAR_INIT](#PAR_INIT)!=`2`).
Disable this check when particles are initialized _after_ setting grid fields, such as by `Init_User_Ptr()`.
* **Restriction:**


## Remarks

Expand Down
1 change: 1 addition & 0 deletions example/test_problem/Template/Input__Parameter
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ PAR_PREDICT_POS 1 # predict particle position during mas
PAR_REMOVE_CELL -1.0 # remove particles X-root-cells from the boundaries (non-periodic BC only; <0=auto) [-1.0]
OPT__FREEZE_PAR 0 # do not update particles (except for tracers) [0]
PAR_TR_VEL_CORR 0 # correct tracer particle velocities in regions of discontinuous flow [0]
OPT__PAR_INIT_CHECK 1 # check particle initialization (only works for PAR_INIT != 2) [1]

# cosmology (COMOVING only)
A_INIT 0.01 # initial scale factor
Expand Down
2 changes: 1 addition & 1 deletion include/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ extern bool FFTW3_Double_OMP_Enabled, FFTW3_Single_OMP_Enabled;
// ============================================================================================================
#ifdef PARTICLE
extern double DT__PARVEL, DT__PARVEL_MAX, DT__PARACC;
extern bool OPT__CK_PARTICLE, OPT__FLAG_NPAR_CELL, OPT__FLAG_PAR_MASS_CELL, OPT__FREEZE_PAR, OPT__OUTPUT_PAR_MESH;
extern bool OPT__CK_PARTICLE, OPT__FLAG_NPAR_CELL, OPT__FLAG_PAR_MASS_CELL, OPT__FREEZE_PAR, OPT__OUTPUT_PAR_MESH, OPT__PAR_INIT_CHECK;
extern int OPT__OUTPUT_PAR_MODE, OPT__PARTICLE_COUNT, OPT__FLAG_NPAR_PATCH, FlagTable_NParPatch[NLEVEL-1], FlagTable_NParCell[NLEVEL-1];
extern double FlagTable_ParMassCell[NLEVEL-1];
extern ParOutputDens_t OPT__OUTPUT_PAR_DENS;
Expand Down
1 change: 1 addition & 0 deletions include/HDF5_Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ struct InputPara_t
int Par_GhostSize;
int Par_GhostSizeTracer;
int Par_TracerVelCorr;
int Opt__ParInitCheck;
char *ParAttFltLabel[PAR_NATT_FLT_TOTAL];
char *ParAttIntLabel[PAR_NATT_INT_TOTAL];
# endif
Expand Down
3 changes: 3 additions & 0 deletions src/Auxiliary/Aux_TakeNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,9 @@ void Aux_TakeNote()
default: fprintf( Note, "UNKNOWN\n" );
} // switch ( OPT__FFTW_STARTUP )
# endif // # ifdef SUPPORT_FFTW
# ifdef PARTICLE
fprintf( Note, "OPT__PAR_INIT_CHECK % d\n", OPT__PAR_INIT_CHECK );
# endif

// refinement region for OPT__UM_IC_NLEVEL>1
if ( OPT__INIT == INIT_BY_FILE && OPT__UM_IC_NLEVEL > 1 ) {
Expand Down
1 change: 1 addition & 0 deletions src/Init/Init_ByRestart_HDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,7 @@ void Check_InputPara( const char *FileName, const int FormatVersion )
LoadField( "Par_GhostSize", &RS.Par_GhostSize, SID, TID, NonFatal, &RT.Par_GhostSize, 1, NonFatal );
LoadField( "Par_GhostSizeTracer", &RS.Par_GhostSizeTracer, SID, TID, NonFatal, &RT.Par_GhostSizeTracer, 1, NonFatal );
LoadField( "Par_TracerVelCorr", &RS.Par_TracerVelCorr, SID, TID, NonFatal, &RT.Par_TracerVelCorr, 1, NonFatal );
LoadField( "Opt__ParInitCheck", &RS.Opt__ParInitCheck, SID, TID, NonFatal, &RT.Opt__ParInitCheck, 1, NonFatal );
# endif

// cosmology
Expand Down
2 changes: 1 addition & 1 deletion src/Init/Init_GAMER.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void Init_GAMER( int *argc, char ***argv )
"PAR_INIT", (int)amr->Par->Init );
}

if ( amr->Par->Init != PAR_INIT_BY_RESTART ) Par_Aux_InitCheck();
if ( amr->Par->Init != PAR_INIT_BY_RESTART && OPT__PAR_INIT_CHECK ) Par_Aux_InitCheck();
# endif // #ifdef PARTICLE


Expand Down
1 change: 1 addition & 0 deletions src/Init/Init_Load_Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void Init_Load_Parameter()
ReadPara->Add( "PAR_REMOVE_CELL", &amr->Par->RemoveCell, -1.0, NoMin_double, NoMax_double );
ReadPara->Add( "OPT__FREEZE_PAR", &OPT__FREEZE_PAR, false, Useless_bool, Useless_bool );
ReadPara->Add( "PAR_TR_VEL_CORR", &amr->Par->TracerVelCorr, false, Useless_bool, Useless_bool );
ReadPara->Add( "OPT__PAR_INIT_CHECK", &OPT__PAR_INIT_CHECK, true, Useless_bool, Useless_bool );
# endif // #ifdef PARTICLE


Expand Down
2 changes: 1 addition & 1 deletion src/Main/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ bool FFTW3_Double_OMP_Enabled, FFTW3_Single_OMP_Enabled;
// (2-5) particle
#ifdef PARTICLE
double DT__PARVEL, DT__PARVEL_MAX, DT__PARACC;
bool OPT__CK_PARTICLE, OPT__FLAG_NPAR_CELL, OPT__FLAG_PAR_MASS_CELL, OPT__FREEZE_PAR, OPT__OUTPUT_PAR_MESH;
bool OPT__CK_PARTICLE, OPT__FLAG_NPAR_CELL, OPT__FLAG_PAR_MASS_CELL, OPT__FREEZE_PAR, OPT__OUTPUT_PAR_MESH, OPT__PAR_INIT_CHECK;
int OPT__OUTPUT_PAR_MODE, OPT__PARTICLE_COUNT, OPT__FLAG_NPAR_PATCH, PAR_IC_FLOAT8, PAR_IC_INT8, FlagTable_NParPatch[NLEVEL-1], FlagTable_NParCell[NLEVEL-1];
double FlagTable_ParMassCell[NLEVEL-1];
ParOutputDens_t OPT__OUTPUT_PAR_DENS;
Expand Down
11 changes: 7 additions & 4 deletions src/Output/Output_DumpData_Total_HDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Procedure for outputting new variables:


//-------------------------------------------------------------------------------------------------------
// Function : Output_DumpData_Total_HDF5 (FormatVersion = 2503)
// Function : Output_DumpData_Total_HDF5 (FormatVersion = 2504)
// Description : Output all simulation data in the HDF5 format, which can be used as a restart file
// or loaded by YT
//
Expand Down Expand Up @@ -277,6 +277,7 @@ Procedure for outputting new variables:
// 2502 : 2025/01/16 --> output ConRef[]
// 2503 : 2025/01/17 --> output user-defined parameters in "User/UserPara" and
// Input__TestProb parameters in "Info/InputTest"
// 2504 : 2025/04/29 --> output OPT__PAR_INIT_CHECK
//-------------------------------------------------------------------------------------------------------
void Output_DumpData_Total_HDF5( const char *FileName )
{
Expand Down Expand Up @@ -1665,7 +1666,7 @@ void FillIn_KeyInfo( KeyInfo_t &KeyInfo, const int NFieldStored )

const time_t CalTime = time( NULL ); // calendar time

KeyInfo.FormatVersion = 2503;
KeyInfo.FormatVersion = 2504;
KeyInfo.Model = MODEL;
KeyInfo.NLevel = NLEVEL;
KeyInfo.NCompFluid = NCOMP_FLUID;
Expand Down Expand Up @@ -2410,11 +2411,12 @@ void FillIn_InputPara( InputPara_t &InputPara, const int NFieldStored, char Fiel
InputPara.Par_IntegTracer = amr->Par->IntegTracer;
InputPara.Par_ImproveAcc = amr->Par->ImproveAcc;
InputPara.Par_PredictPos = amr->Par->PredictPos;
InputPara.Par_TracerVelCorr = amr->Par->TracerVelCorr;
InputPara.Par_RemoveCell = amr->Par->RemoveCell;
InputPara.Opt__FreezePar = OPT__FREEZE_PAR;
InputPara.Par_GhostSize = amr->Par->GhostSize;
InputPara.Par_GhostSizeTracer = amr->Par->GhostSizeTracer;
InputPara.Par_TracerVelCorr = amr->Par->TracerVelCorr;
InputPara.Opt__ParInitCheck = OPT__PAR_INIT_CHECK;
for (int v=0; v<PAR_NATT_FLT_TOTAL; v++)
InputPara.ParAttFltLabel[v] = ParAttFltLabel[v];
for (int v=0; v<PAR_NATT_INT_TOTAL; v++)
Expand Down Expand Up @@ -3449,11 +3451,12 @@ void GetCompound_InputPara( hid_t &H5_TypeID, const int NFieldStored )
H5Tinsert( H5_TypeID, "Par_IntegTracer", HOFFSET(InputPara_t,Par_IntegTracer ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_ImproveAcc", HOFFSET(InputPara_t,Par_ImproveAcc ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_PredictPos", HOFFSET(InputPara_t,Par_PredictPos ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_TracerVelCorr", HOFFSET(InputPara_t,Par_TracerVelCorr ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_RemoveCell", HOFFSET(InputPara_t,Par_RemoveCell ), H5T_NATIVE_DOUBLE );
H5Tinsert( H5_TypeID, "Opt__FreezePar", HOFFSET(InputPara_t,Opt__FreezePar ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_GhostSize", HOFFSET(InputPara_t,Par_GhostSize ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_GhostSizeTracer", HOFFSET(InputPara_t,Par_GhostSizeTracer ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Par_TracerVelCorr", HOFFSET(InputPara_t,Par_TracerVelCorr ), H5T_NATIVE_INT );
H5Tinsert( H5_TypeID, "Opt__ParInitCheck", HOFFSET(InputPara_t,Opt__ParInitCheck ), H5T_NATIVE_INT );

// store the name of all particle attributes
for (int v=0; v<PAR_NATT_FLT_TOTAL; v++)
Expand Down