number of particles in dump file?

Submitted by ahobbs on Wed, 12/12/2012 - 20:09

Another beginner question:

I'd like to output the total number of atoms per timestep. This can already be in the thermo_style output so can be extracted from the log file by editing out all the other compute comments and warnings, but this is a little tedious.

Is there a way to either suppress the comments during the solve or write out the thermo_style output to a separate file? Or perhaps put the atoms # into the dump file?
thanks.

richti83's picture

richti83 | Thu, 12/13/2012 - 09:19

Hi,
you did not tell us where you need the number of atoms, but if you are using Paraview for Postprozessing you can acces this information in a python-programmable-filter with
COUNT=input.GetNumberOfPoints()

Here is a usefull skript:
node/706

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

ahobbs | Thu, 12/13/2012 - 13:15

Thanks, I can post-process the information, but that is an extra step. All I want is an quick way of plotting the # atoms vs time at the end of the simulation to judge if steady state has been achieved. Since the information is in thermo output it seems like there should be a way either to write this specific data to a separate log file or suppress the solver comments so only the thermo_style is reported to the log.liggghts.

richti83's picture

richti83 | Thu, 12/13/2012 - 20:28

You can access every thermo style via a variable and output this via fix print

quick & dirty in 1 minute:


thermo_style custom step atoms ke cpu cu tpcpu spcpu
thermo 1000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

variable t equal step*dt
variable a equal atoms

fix screen all print 1 "$t,$a"
fix file all print 1 "$t,$a" file atoms_per_time.csv title "time,atoms"

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact