def dump(self, f):
<EOL>print("<STR_LIT>", file=f)<EOL>print(file=f)<EOL>print("<STR_LIT>", file=f)<EOL>print(self.title, file=f)<EOL>print(file=f)<EOL>print("<STR_LIT>" % len(self.numbers), file=f)<EOL>if len(self.numbers) > <NUM_LIT:0>:<EOL><INDENT>for index, (number, atom_type, charge, name, molecule) in enumerate(zip(self.numbers, self.atom_types, self.charges, self.names, self.molecules)):<EOL><INDENT>atom = periodic[number]<EOL>print("<STR_LIT>" % (<EOL>index + <NUM_LIT:1>,<EOL>name,<EOL>molecule + <NUM_LIT:1>,<EOL>atom.symbol,<EOL>atom_type,<EOL>charge,<EOL>atom.mass/unified,<EOL>), file=f)<EOL><DEDENT><DEDENT>print(file=f)<EOL>print("<STR_LIT>" % len(self.bonds), file=f)<EOL>if len(self.bonds) > <NUM_LIT:0>:<EOL><INDENT>tmp = []<EOL>for bond in self.bonds:<EOL><INDENT>tmp.extend(bond+<NUM_LIT:1>)<EOL>if len(tmp) >= <NUM_LIT:8>:<EOL><INDENT>print("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp[:<NUM_LIT:8>]), file=f)<EOL>tmp = tmp[<NUM_LIT:8>:]<EOL><DEDENT><DEDENT>if len(tmp) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp), file=f)<EOL><DEDENT><DEDENT>print(file=f)<EOL>print("<STR_LIT>" % len(self.bends), file=f)<EOL>if len(self.bends) > <NUM_LIT:0>:<EOL><INDENT>tmp = []<EOL>for bend in self.bends:<EOL><INDENT>tmp.extend(bend+<NUM_LIT:1>)<EOL>if len(tmp) >= <NUM_LIT:9>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp[:<NUM_LIT:9>])), file=f)<EOL>tmp = tmp[<NUM_LIT:9>:]<EOL><DEDENT><DEDENT>if len(tmp) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp)), file=f)<EOL><DEDENT><DEDENT>print(file=f)<EOL>print("<STR_LIT>" % len(self.dihedrals), file=f)<EOL>if len(self.dihedrals) > <NUM_LIT:0>:<EOL><INDENT>tmp = []<EOL>for dihedral in self.dihedrals:<EOL><INDENT>tmp.extend(dihedral+<NUM_LIT:1>)<EOL>if len(tmp) >= <NUM_LIT:8>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp[:<NUM_LIT:8>])), file=f)<EOL>tmp = tmp[<NUM_LIT:8>:]<EOL><DEDENT><DEDENT>if len(tmp) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp)), file=f)<EOL><DEDENT><DEDENT>print(file=f)<EOL>print("<STR_LIT>" % len(self.impropers), file=f)<EOL>if len(self.impropers) > <NUM_LIT:0>:<EOL><INDENT>tmp = []<EOL>for improper in self.impropers:<EOL><INDENT>tmp.extend(improper+<NUM_LIT:1>)<EOL>if len(tmp) >= <NUM_LIT:8>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp[:<NUM_LIT:8>])), file=f)<EOL>tmp = tmp[<NUM_LIT:8>:]<EOL><DEDENT><DEDENT>if len(tmp) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT:U+0020>" + ("<STR_LIT:U+0020>".join("<STR_LIT>" % v for v in tmp)), file=f)<EOL><DEDENT><DEDENT>print(file=f)<EOL>print("<STR_LIT>", file=f)<EOL>print(file=f)<EOL>print("<STR_LIT>", file=f)<EOL>print(file=f)<EOL>print("<STR_LIT>", file=f)<EOL>print(file=f)<EOL>
Dump the data structure to a file-like object