1 """Contains the functions used to print the trajectories and read input
2 configurations (or even full status dump) as unformatted binary.
4 Copyright (C) 2013, Joshua More and Michele Ceriotti
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http.//www.gnu.org/licenses/>.
21 print_bin: Prints an atomic configuration.
24 __all__
= ['print_bin']
29 from ipi
.utils
.depend
import depstrip
31 def print_bin(atoms
, cell
, filedesc
= sys
.stdout
, title
=""):
32 """Prints the centroid configurations, into a binary file.
35 beads: An atoms object giving the centroid positions.
36 cell: A cell object giving the system box.
37 filedesc: An open writable file object. Defaults to standard output.
38 title: This gives a string to be appended to the comment line.
41 buff
= filedesc
# .buffer
43 nat
= np
.asarray([atoms
.natoms
])
45 atoms
.names
.tofile(buff
)