Repository navigation
[Runtime Parameters] Particles
Parameters described on this page: PAR_NPAR, PAR_INIT, PAR_FLAG_INIT, PAR_IC_FORMAT, PAR_IC_FLOAT8, PAR_IC_INT8, PAR_IC_MASS, PAR_IC_TYPE, PAR_IC_PUID, PAR_INTERP, PAR_INTEG, PAR_TR_INTERP, PAR_TR_INTEG, PAR_TR_VEL_CORR, PAR_IMPROVE_ACC, PAR_PREDICT_POS, PAR_REMOVE_CELL, OPT__FREEZE_PAR, OPT__PAR_INIT_CHECK
Parameters below are shown in the format: Name (Valid Values) [Default Value]
-
- Description: Total number of particles.
- Restriction: Must be set when PAR_INIT=1/3; must be consistent with the number of particles loaded from an initial condition file (e.g., for PAR_INIT=3 and test problems with their own particle initializers); useless when restarting from a snapshot (i.e., PAR_INIT=2); must be an integer.
-
-
Description:
Initialization methods for particles.
PAR_INIT=1: using a particle initialization function; see Setting IC from Analytical Functions — Particles.PAR_INIT=2: restarting from a simulation snapshot.PAR_INIT=3: loading a binary file namedPAR_IC; see Setting IC from Files — Particles. -
Restriction:
It will be automatically reset to
PAR_INIT=2when adopting OPT__INIT=2.
-
Description:
Initialization methods for particles.
-
-
Description:
Automatically assign the refinement flags of all particles to
PAR_FLAG_INITwhenPAR_INIT=1/3. Refer to OPT__FLAG_PAR_TARGET for the definitions of must-refine and can-refine particles. SetPAR_FLAG_INIT=9999to assign refinement flags manually, either by editing a particle IC function or by loading them from a particle IC file. - Restriction:
-
Description:
Automatically assign the refinement flags of all particles to
-
-
Description:
Data format of the particle initial condition file
PAR_ICused by PAR_INIT=3. See Setting IC from Files — Particles for details. - Restriction:
-
Description:
Data format of the particle initial condition file
-
PAR_IC_FLOAT8(<0: same as --double_par, 0=single precision, 1=double precision) [-1]-
Description:
Floating-point precision of the particle initial condition file
PAR_IC. - Restriction:
-
Description:
Floating-point precision of the particle initial condition file
-
PAR_IC_INT8(<0: same as --long_par, 0=32-bit integer (int), 1=64-bit integer (long)) [-1]-
Description:
Integer width of the particle initial condition file
PAR_IC. - Restriction:
-
Description:
Integer width of the particle initial condition file
-
-
Description:
Assigning this particle mass to all particles when adopting
PAR_INIT=3. Note that when enabling this functionality (by setting
PAR_IC_MASS≥0.0), the particle initial condition filePAR_ICshould not include the particle mass data. See also Setting IC from Files — Particles. - Restriction:
-
Description:
Assigning this particle mass to all particles when adopting
PAR_INIT=3. Note that when enabling this functionality (by setting
-
-
Description:
Assigning this particle type to all particles when adopting
PAR_INIT=3. Note that when enabling this functionality (by setting
PAR_IC_TYPE≥0), the particle initial condition filePAR_ICshould not include the particle type data. See also Setting IC from Files — Particles. - Restriction:
-
Description:
Assigning this particle type to all particles when adopting
PAR_INIT=3. Note that when enabling this functionality (by setting
-
-
Description:
Flag indicating whether the particle initial condition file
PAR_ICcontains UID information. If this option is disabled, new particle UIDs will be assigned automatically. See also Setting IC from Files — Particles. - Restriction:
-
Description:
Flag indicating whether the particle initial condition file
-
- Description: Massive particle interpolation schemes: NGP=nearest-grid-point, CIC=cloud-in-cell, TSC=triangular-shape cloud. Accuracy: TSC > CIC > NGP. Performance: NGP > CIC > TSC. In general, NGP is not recommended.
- Restriction:
-
- Description: Massive particle integration scheme. Euler integration is only first-order accurate and is generally not recommended.
- Restriction:
-
- Description: Tracer particle interpolation schemes. See PAR_INTERP for details.
- Restriction:
-
- Description: Tracer particle integration scheme. Euler integration is only first-order accurate and is generally not recommended.
- Restriction:
-
- Description: Tracer particle velocities will be corrected in regions of discontinuous flow. It may be used only for mapping velocity, used to correct tracer particle trajectories in discontinuous flows. See Section 2.2 and Equation 1 of Wittor et al. (2016) MNRAS, 464, 4
- Restriction: Only applicable when adopting PAR_INTERP=2/3
-
- Description: Improve the force accuracy for particles close to the patch boundaries.
- Restriction: Only applicable when adopting PAR_INTERP=2/3 and enabling the compilation option --store_pot_ghost.
-
- Description: Predict particle position during mass assignment to synchronize particles and grids.
- Restriction:
-
-
Description:
Remove particles too close to the simulation boundaries when adopting
non-periodic boundary conditions. It is necessary because the force
accuracy around the simulation boundaries may be deteriorated due
to the potential extrapolation. Specifically, we remove particles
located in the outermost
PAR_REMOVE_CELLroot cells in the simulation box. The default value is 1.0 ~ 2.0 depending on the adopted particle interpolation scheme (PAR_INTERP). - Restriction: Only applicable when adopting the isolated gravity boundary condition (i.e., OPT__BC_POT=2).
-
Description:
Remove particles too close to the simulation boundaries when adopting
non-periodic boundary conditions. It is necessary because the force
accuracy around the simulation boundaries may be deteriorated due
to the potential extrapolation. Specifically, we remove particles
located in the outermost
-
- Description: 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:
-
-
Description:
Check particle initialization by calling
Par_Aux_InitCheck()function after particle initialization (only works for PAR_INIT!=2). Disable this check when particles are initialized after setting grid fields, such as byInit_User_Ptr(). - Restriction:
-
Description:
Check particle initialization by calling
Valid particle UIDs should lie within [1, number of particles].
The particle UID assignment occurs during either initialization or on-the-fly creation
in simulation (e.g., star formation). The particle UIDs can be inherited from PAR_IC
(when PAR_INIT=3 and PAR_IC_PUID is enabled) or from a restart file. Except for
these, the particle UIDs should be assigned internally via Par_SetParUID() in all
other cases (e.g., PAR_INIT=1).
To ensure uniqueness and reproducibility, all particle UIDs should be assigned by
Par_SetParUID() globally, rather than decided by individual MPI ranks. The particle
UID must be first marked as PUID_TBA when the particle is created (e.g., in
Par_Init_ByFunction_Ptr(), Par_Init_ByFile(), and
src/StarFormation/SF_CreateStar_AGORA.cpp) before invoking Par_SetParUID() (e.g., at
the end of Init_GAMER() and SF_CreateStar()). And Par_SetParUID() should be
invoked after all the particle creation within a single routine is complete.
The assignment procedure of Par_SetParUID() follows:
First, we collect the PUIDs and positions of new particles from all ranks
into a single array.
Second, we sort the particles by their positions.
Third, assign the particle UIDs according to the array index plus NextPUID.
Finally, send the new particle UIDs back to all ranks.
Caution
If the particle positions are exactly the same (which should unlikely happen), the particle UID is determined by the sorting algorithm.
Please check the implementation in Miscellaneous/Mis_SortByRows.cpp and Mis_Heapsort.cpp
Getting Started
User Guide
- Installation
- Running the Code
- Adding New Simulations
- Runtime Parameters
- MPI and OpenMP
- GPU
- Units
- Physics Modules
- Timestep
- Refinement
- Outputs
- Simulation Logs
- Data Analysis
- In Situ Python Analysis
- Test Problems
- Troubleshooting
Advanced Topics
Developer Guide