This means that an atom cannot find the atom that owns the rigid body it is part of, or vice versa. The solution is to use the communicate cutoff command to ensure ghost atoms are acquired from far enough away to encompass the max distance printed when the fix rigid/small command was invoked.
In LAMMPS, rigid bodies (e.g., those defined by fix rigid/small) must “know” about all of their constituent atoms, even if those atoms happen to lie in neighboring sub-domains. If the communication (ghost-atom) cutoff is too small, some atoms of a rigid body may not be communicated (“ghosted”) across processor boundaries, so the fix rigid/small code cannot find them. That can lead to an error such as:
“This means that an atom cannot find the atom that owns the rigid body it is part of, or vice versa.”
The solution is to increase the distance over which atoms are ghosted. In LAMMPS, you do this via the comm_modify cutoff <value> command.
Below is a more detailed explanation:
Why a Larger Ghost Cutoff is Needed
- Domain Decomposition
In a parallel LAMMPS run, the simulation box is split among multiple ranks. Each rank “owns” certain atoms but must also “ghost” atoms from neighboring sub-domains to build local neighbor lists and compute forces correctly. - Rigid Bodies Span Multiple Sub-Domains
When using fix rigid/small, each rigid body is internally managed by a “body owner” rank. The body owner rank needs data for all atoms in that rigid body. If an atom is physically on a neighboring sub-domain (or crosses into it as it moves), the body owner rank relies on LAMMPS’s ghost-atom mechanism to receive that atom’s positions, velocities, etc. - Default Ghost Cutoff May Be Too Small
By default, LAMMPS sets a ghost cutoff based on the pairwise force cutoff plus some buffer. However, if your rigid body is large in physical extent or if it has some geometry that places atoms far apart, this default may be insufficient. - “Max distance from body owner to body atom”
When you invoke fix rigid/small, LAMMPS often prints a line like:This tells you how far an atom can be from the rank that “owns” the rigid body. If your ghost cutoff is smaller than this distance (plus a small safety margin), LAMMPS may fail to communicate some of these atoms. - 0.003 = max distance from body owner to body atom
- Symptom: MPI truncation or rigid-body errors
If ghost atoms are missing, the fix rigid/small code can produce MPI truncation errors, “could not find atom ID,” or mysterious crashes.
How to Increase the Ghost Cutoff
In your LAMMPS input script, before the run, insert something like:
comm_modify cutoff 0.01
(or a value larger than the “max distance” that LAMMPS reported, with some margin). For instance, if LAMMPS says:
0.003 = max distance from body owner to body atom
you might set:
comm_modify cutoff 0.01
to ensure a comfortable margin.
Note: The comm_modify cutoff syntax has replaced older commands like communicate single cutoff .... Depending on your LAMMPS version, refer to the documentation to confirm the correct syntax.
Practical Tips
- Choose a safe buffer: If LAMMPS says the max distance is 0.003, pick something larger (e.g., 0.01 or 0.02) to account for further motion.
- Avoid an excessively large cutoff: Ghosting too large a region wastes memory and communication time. Pick something just large enough to accommodate the largest body.
- Re-check if you have multiple body sizes: If you insert or use different-sized rigid bodies, you may need an even bigger cutoff to handle the largest one.
Example
Here is a short snippet integrating all these ideas:
# ... your setup, region, etc. ...
fix makeClumps all rigid/small molecule mol clump1
# LAMMPS should print "max distance from body owner to body atom = X"
# Increase the ghost cutoff slightly larger than X
comm_modify cutoff 0.01
# ... rest of your input script ...
run 300000
With this change, LAMMPS should communicate all the clump’s atoms to the owner rank properly, preventing the “atom cannot find the atom that owns the rigid body” error.
Critical time step도 영향을 준다. clump가 갑자기 domain을 건너 뛰는걸 추적하지 못할 수 도 있으니까.
'LAMMPS' 카테고리의 다른 글
NVE/NVT/NPT/NHT (0) | 2025.01.15 |
---|---|
fix rigid/small vs fix rigid (0) | 2025.01.15 |
Molecule을 이용한 Clump Simulation (0) | 2025.01.14 |
LAMMPS에서 Clump의 구현 (1) | 2025.01.13 |
Intel build with (Packages : granular, openmp, vtk, rigid) (0) | 2025.01.09 |