@@ -99,7 +99,19 @@ def create_structure(lmp, calc, species=None):
9999 return lmp
100100
101101
102- def set_potential (lmp , options ):
102+ def set_mass (lmp , options , ghost_elements = 0 ):
103+ count = 1
104+ for i in range (options .n_elements ):
105+ lmp .mass (i + 1 , options .mass [i ])
106+ count += 1
107+
108+ for i in range (ghost_elements ):
109+ lmp .mass (count + i , 1.00 )
110+
111+ return lmp
112+
113+
114+ def set_potential (lmp , options , ghost_elements = 0 ):
103115 """
104116 Set the interatomic potential
105117
@@ -116,8 +128,8 @@ def set_potential(lmp, options):
116128 lmp .pair_style (options .pair_style [0 ])
117129 lmp .pair_coeff (options .pair_coeff [0 ])
118130
119- for i in range ( options . n_elements ):
120- lmp . mass ( i + 1 , options . mass [ i ])
131+ lmp = set_mass ( lmp , options , ghost_elements = ghost_elements )
132+
121133 return lmp
122134
123135
@@ -158,7 +170,7 @@ def get_structures(file, species, index=None):
158170 aseobjs = traj [index ].to_ase (species = species )
159171 return aseobjs
160172
161- def set_hybrid_potential (lmp , options , eps ):
173+ def set_hybrid_potential (lmp , options , eps , ghost_elements = 0 ):
162174 pc = options .pair_coeff [0 ]
163175 pcraw = pc .split ()
164176 pcnew = " " .join ([* pcraw [:2 ], * [options .pair_style [0 ],], * pcraw [2 :]])
@@ -167,11 +179,11 @@ def set_hybrid_potential(lmp, options, eps):
167179 lmp .command ("pair_coeff %s" % pcnew )
168180 lmp .command ("pair_coeff * * ufm %f 1.5" % eps )
169181
170- for i in range ( options . n_elements ):
171- lmp . mass ( i + 1 , options . mass [ i ])
182+ lmp = set_mass ( lmp , options , ghost_elements = ghost_elements )
183+
172184 return lmp
173185
174- def set_double_hybrid_potential (lmp , options , pair_style , pair_coeff ):
186+ def set_double_hybrid_potential (lmp , options , pair_style , pair_coeff , ghost_elements = 0 ):
175187
176188 pc1 = pair_coeff [0 ]
177189 pcraw1 = pc1 .split ()
@@ -191,8 +203,8 @@ def set_double_hybrid_potential(lmp, options, pair_style, pair_coeff):
191203 lmp .command ("pair_coeff %s" % pcnew1 )
192204 lmp .command ("pair_coeff %s" % pcnew2 )
193205
194- for i in range ( options . n_elements ):
195- lmp . mass ( i + 1 , options . mass [ i ])
206+ lmp = set_mass ( lmp , options , ghost_elements = ghost_elements )
207+
196208 return lmp
197209
198210def remap_box (lmp , x , y , z ):
0 commit comments