specify periodicity

18 views
Skip to first unread message

azam cheraghi

unread,
Apr 24, 2023, 11:59:40 AM4/24/23
to hoomd...@googlegroups.com
I am trying to make my box periodic only in z direction, but I am receiving the following error.

DeprecationWarning: elementwise comparison failed; this will raise an error in the future.
  snapshot.configuration.box = [20, 20, 20, 0, 0, 0, periodic == (False,False,True)]
Traceback (most recent call last):
  File "./nowall_rand.py", line 44, in <module>
    f.append(snapshot)
  File "/localscratch/azam.65945896.0/MYENV/lib/python3.8/site-packages/gsd/hoomd.py", line 710, in append
    snapshot.validate()
  File "/localscratch/azam.65945896.0/MYENV/lib/python3.8/site-packages/gsd/hoomd.py", line 449, in validate
    self.configuration.validate()
  File "/localscratch/azam.65945896.0/MYENV/lib/python3.8/site-packages/gsd/hoomd.py", line 102, in validate
    self.box = self.box.reshape([6])
ValueError: cannot reshape array of size 7 into shape (6,)

Related code:
periodic = np.ndarray(shape = (3,0))
snapshot.configuration.box = [20, 20, 20, 0, 0, 0, periodic == (False,False,True)]
BoxMC = hoomd.hpmc.update.BoxMC(trigger = hoomd.trigger.Periodic(10), betaP = 20)
BoxMC.volume = {'weight':0.2,'mode':'standard','delta':0.1}
BoxMC.length = {'weight':0.2,'delta': (0, 0, 2.0)}
sim.operations.updaters.append(BoxMC)
periodic = hoomd.trigger.Periodic(10)
with gsd.hoomd.open(name='init.gsd', mode='xb') as f:
    f.append(snapshot)





Joshua Anderson

unread,
Apr 24, 2023, 1:05:14 PM4/24/23
to hoomd...@googlegroups.com
Azam,

All HOOMD-blue boxes are periodic in all D directions, where D (=2 or 3) is the dimensionality of the system.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/CAKfCtRNf9fgDRwWTsx2kdkGenMXP7zBKm1-wFjFo8%3D68wZQDig%40mail.gmail.com.

azam cheraghi

unread,
Apr 24, 2023, 1:36:08 PM4/24/23
to hoomd...@googlegroups.com
May I ask what is the periodic property do in the following link? Based on my understanding I need to write my box as 1D to make it periodic in 1D, but how can I specify it to be periodic in z direction?
 
propertyperiodic

The periodicity of each dimension.


Joshua Anderson

unread,
Apr 24, 2023, 1:43:53 PM4/24/23
to hoomd...@googlegroups.com
Azam,

HOOMD-blue does not perform 1D simulations. The number of dimensions must be 2 or 3.

When you perform MPI domain decomposition simulations (https://hoomd-blue.readthedocs.io/en/v3.11.0/tutorial/03-Parallel-Simulations-With-MPI/00-index.html), the *local* boxes on each rank are non-periodic in 1,2, or 3 directions depending on the dimensionality of your decomposition. Internally, HOOMD-blue uses this flag to compute proper interactions across box boundaries (e.g. in a 1x1x2 decomposition, the local ranks should wrap r_ij vectors in the x and y directions only). This is exposed so that users of the rank local particle data can also wrap vectors accordingly(https://hoomd-blue.readthedocs.io/en/v3.11.0/tutorial/03-Parallel-Simulations-With-MPI/03-Accessing-System-Configurations-With-MPI.html). However, the *global* simulation box remains periodic in all 3 directions (e.g. rank 0's top neighbor is rank 1 and rank 0's bottom neighbor is also rank 1).

------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Reply all
Reply to author
Forward
0 new messages