Skip to content

Commit

Permalink
add examples inside geop
Browse files Browse the repository at this point in the history
  • Loading branch information
litman90 committed Nov 12, 2024
1 parent 9c91377 commit 783fc69
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3
# CELL(abcABC): 35.23300 35.23300 35.23300 90.00000 90.00000 90.00000 Traj: positions{angstrom} Step: 11 Bead: 0
O 0.00000e+00 -2.00000e-02 0.00000e+00
H 7.50000e-01 5.00000e-01 0.00000e+00
H -7.50000e-01 5.00000e-01 0.00000e+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<simulation mode='static' verbosity='high'>
<output prefix='simulation'>
<properties stride='1' filename='out'> [ step, potential ] </properties>
<trajectory filename='pos' stride='1'> positions </trajectory>
</output>
<total_steps> 1000 </total_steps>
<prng>
<seed> 32342 </seed>
</prng>
<ffsocket name='pswater' mode='unix' pbc='false'>
<address> h2o-geop </address>
</ffsocket>
<system>
<initialize nbeads='1'>
<file mode='xyz'> init.xyz </file>
</initialize>
<forces>
<force forcefield='pswater'> </force>
</forces>
<motion mode='minimize'>
<fixatoms>[0]</fixatoms>
<optimizer mode='sd'>
<tolerances>
<energy> 1e-5 </energy>
<force> 1e-5 </force>
<position> 1e-5 </position>
</tolerances>
</optimizer>
</motion>
</system>
</simulation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ipi=i-pi
driver="i-pi-driver -m pswater -u -a h2o-geop"
sleep_time=4

${ipi} input.xml > log.i-pi &
echo "# i-PI is running"

echo "# Waiting for ${sleep_time} (s) before executing driver"
sleep ${sleep_time}

${driver} > /dev/null &
echo "# Driver is running"

wait

echo "# Simulation complete"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3
# CELL(abcABC): 35.23300 35.23300 35.23300 90.00000 90.00000 90.00000 Traj: positions{angstrom} Step: 11 Bead: 0
O 0.00000e+00 -2.00000e-02 0.00000e+00
H 7.50000e-01 5.00000e-01 0.00000e+00
H -7.50000e-01 5.00000e-01 0.00000e+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<simulation mode='static' verbosity='high'>
<output prefix='simulation'>
<properties stride='1' filename='out'> [ step, potential ] </properties>
<trajectory filename='pos' stride='1'> positions </trajectory>
</output>
<total_steps> 1000 </total_steps>
<prng>
<seed> 32342 </seed>
</prng>
<ffsocket name='pswater' mode='unix' pbc='false'>
<address> h2o-geop </address>
</ffsocket>
<system>
<initialize nbeads='1'>
<file mode='xyz'> init.xyz </file>
</initialize>
<forces>
<force forcefield='pswater'> </force>
</forces>
<motion mode='minimize'>
<fixatoms_dof>[0,1,2]</fixatoms_dof>
<optimizer mode='sd'>
<tolerances>
<energy> 1e-5 </energy>
<force> 1e-5 </force>
<position> 1e-5 </position>
</tolerances>
</optimizer>
</motion>
</system>
</simulation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ipi=i-pi
driver="i-pi-driver -m pswater -u -a h2o-geop"
sleep_time=4

${ipi} input.xml > log.i-pi &
echo "# i-PI is running"

echo "# Waiting for ${sleep_time} (s) before executing driver"
sleep ${sleep_time}

${driver} > /dev/null &
echo "# Driver is running"

wait

echo "# Simulation complete"
3 changes: 2 additions & 1 deletion ipi/engine/motion/geop.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def bind(self, ens, beads, nm, cell, bforce, prng, omaker):
# Binds optimizer
self.optimizer.bind(self)

if len(self.fixatoms_dof) == len(self.beads[0]):
print("HERE", len(self.fixatoms_dof), len(self.beads[0]))
if len(self.fixatoms_dof) == 3 * len(self.beads[0]):
softexit.trigger(
status="bad",
message="WARNING: all atoms are fixed, geometry won't change. Exiting simulation",
Expand Down
2 changes: 1 addition & 1 deletion ipi/engine/motion/stringmep.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def bind(self, ens, beads, nm, cell, bforce, prng, omaker):
else:
raise ValueError("Hessian size does not match system size.")

if len(self.fixatoms_dof // 3) == len(self.beads[0]):
if len(self.fixatoms_dof) == 3 * len(self.beads[0]):
softexit.trigger(
status="bad",
message="WARNING: all atoms are fixed, geometry won't change. Exiting simulation.",
Expand Down

0 comments on commit 783fc69

Please sign in to comment.