Giter VIP home page Giter VIP logo

Comments (5)

akohlmey avatar akohlmey commented on May 19, 2024

@rbberger is still under consideration? or should we close is issue?

from lammps.

rbberger avatar rbberger commented on May 19, 2024

@giacomofiorin can you have a look at this avg/chunk reader? Still need to write some example and/or docs. But it should be usable as follows:

from lammps import AvgChunkFile

c = AvgChunkFile(filename)
c.timesteps # list of timesteps in file
c.chunks    # list of chunks in file

# c.chunks[chunk_id][property_name]
c.chunks[0]['id']
c.chunks[0]['coord']
c.chunks[0]['density/count']  # list of density/count values over time of chunk 1

from lammps.

giacomofiorin avatar giacomofiorin commented on May 19, 2024

Will do ASAP, thanks for implementing it!

from lammps.

giacomofiorin avatar giacomofiorin commented on May 19, 2024

@rbberger: sorry for the delay. I misunderstood that the new class AvgChunkFile was going to make use of LAMMPS API functions (it can actually be used in the stand-alone interpreter).

Overall the class does the intended job. One thing that I recommend is replacing:

assert(num_chunks == int(parts[1]))

with an exception like:

if not (num_chunks == int(parts[1])):
  raise Exception("Currently, changing numbers of chunks are not supported.")

because the case of changing number of chunks over time is not an uncommon one (e.g. chunks along a Cartesian axis when running NPT, or chunks computed for a sub-set of the system).

I think it's possible to amend your parser, but ultimately this is an issue of the way the fix ave/chunk file is written to begin with. I think it'd be useful to define additional variants of the styles bin/1d through bin/3d where not only the grid spacings but also the boundaries can be pre-allocated (similarly to bin/cylinder and bin/sphere). This would make parsing of the ave/chunk output files much easier: empty chunks can be easily handled by having Ncount written as zero.

from lammps.

rbberger avatar rbberger commented on May 19, 2024

please don't close issues until the PR is merged.

from lammps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.