pyiron / FAQs

General question board for pyiron users
3 stars 0 forks source link

How to decrease the precision in `dump.out` from a `LAMMPS` job #57

Open aageo25 opened 3 months ago

aageo25 commented 3 months ago

I want to reduce the size of my dump.out files. I see that pyiron controls the precision of decimal points when load_default is defined ; https://github.com/pyiron/pyiron_atomistics/blob/233478c295fe2d67aeffb3e2d1a16a4160aa67ad/pyiron_atomistics/lammps/control.py#L87

    def load_default(self, file_content=None):
        if file_content is None:
            file_content = (
                "units                 metal\n"
                + "dimension             3\n"
                + "boundary              p p p\n"
                + "atom_style            atomic\n"
                + "read_data             structure.inp\n"
                + "include               potential.inp\n"
                + "fix___ensemble        all nve\n"
                + "variable___dumptime   equal 100\n"
                + "variable___thermotime equal 100\n"
                + "dump___1              all custom ${dumptime} dump.out id type xsu ysu zsu fx fy fz vx vy vz\n"
                + 'dump_modify___1       sort id format line "%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g"\n'
                + "thermo_style          custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol\n"
                + "thermo_modify         format float %20.15g\n"
                + "thermo                ${thermotime}\n"
                + "run                   0\n"
            )
        self.load_string(file_content)

What would be the better way of changing 'dump_modify___1?

  1. Should I pass a new file_content? If so, how/where?
  2. Can I modify after or when I create my Lammps job?
  3. Any other suggestions?

Thank you in advance!

jan-janssen commented 3 months ago

You can update the line using:

job.input.control["dump_modify___1"] = 'sort id format line "%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g"'

Some more details are explained in the pyiron tutorial we prepared for the LAMMPS workshop https://github.com/pyiron-workshop/lammps-workshop-2023/blob/main/part_1.ipynb

aageo25 commented 3 months ago

Thanks a lot, @jan-janssen

It would be useful if the up-to-date tutorials were more visible on the docs page. I see these tutorials as richer than the examples there.