def dump_system(self, filepath=None, modular=False, **kwargs):
<EOL>if filepath is None:<EOL><INDENT>filepath = '<STR_LIT:/>'.join((os.getcwd(), str(self.system_id)))<EOL>filepath = '<STR_LIT:.>'.join((filepath, '<STR_LIT>'))<EOL><DEDENT>system_dict = deepcopy(self.system)<EOL>if modular is True:<EOL><INDENT>elements = np.array([])<EOL>atom_ids = np.array([])<EOL>coor = np.array([]).reshape(<NUM_LIT:0>, <NUM_LIT:3>)<EOL>for mol_ in self.molecules:<EOL><INDENT>mol = self.molecules[mol_]<EOL>elements = np.concatenate((elements, mol.mol['<STR_LIT>']))<EOL>atom_ids = np.concatenate((atom_ids, mol.mol['<STR_LIT>']))<EOL>coor = np.concatenate((coor, mol.mol['<STR_LIT>']), axis=<NUM_LIT:0>)<EOL><DEDENT>system_dict['<STR_LIT>'] = elements<EOL>system_dict['<STR_LIT>'] = atom_ids<EOL>system_dict['<STR_LIT>'] = coor<EOL><DEDENT>if '<STR_LIT>' not in system_dict.keys():<EOL><INDENT>atom_ids = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>atom_ids = '<STR_LIT>'<EOL><DEDENT>self._Output.dump2file(<EOL>system_dict, filepath, atom_ids=atom_ids, **kwargs)<EOL>
Dump a :class:`MolecularSystem` to a file (PDB or XYZ).

Kwargs are passed to :func:`pywindow.io_tools.Output.dump2file()`.

Parameters
----------
filepath : :class:`str`
   The filepath for the dumped file. If :class:`None`, the file is
   dumped localy with :attr:`system_id` as filename.
   (defualt=None)

modular : :class:`bool`
    If False, dump the :class:`MolecularSystem` as in
    :attr:`MolecularSystem.system`, if True, dump the
    :class:`MolecularSystem` as catenated :class:Molecule objects
    from :attr:`MolecularSystem.molecules`

Returns
-------
None : :class:`NoneType`