Code Monkey home page Code Monkey logo

Comments (5)

mccoys avatar mccoys commented on June 25, 2024

Thank you for both reports. The attributes are indeed incorrect and will be fixed.

from smilei.

mccoys avatar mccoys commented on June 25, 2024

I read the standard again, and I find it very confusing. It does not specify that this is about staggering. There is a confusing way to refer to cells or elements. I would not have guessed this was about grid staggering. Can you confirm that the staggered direction must have a value of 0.5 in this attribute?

from smilei.

mccoys avatar mccoys commented on June 25, 2024

I have made changes locally to fix both the position issue and the timeOffset issue. Does this look ok to you?

$ h5ls -rvd Fields0.h5/data/0000001800/Bx_m | grep -4 timeOffset
    Attribute: position {2}
        Type:      native double
        Data:
               0, 0.5
    Attribute: timeOffset scalar
        Type:      native double
        Data:
               0.0785398163397448
    Attribute: unitDimension {7}
$ h5ls -rvd Fields0.h5/data/0000001800/Ex | grep -4 timeOffset
    Attribute: position {2}
        Type:      native double
        Data:
               0.5, 0
    Attribute: timeOffset scalar
        Type:      native double
        Data:
               0
    Attribute: unitDimension {7}

from smilei.

skuschel avatar skuschel commented on June 25, 2024

Thanks for the quick fix, looks good to me! Regarding your queston: Yes, the position attribute is related either to the stagger or to the (half) iteration when the fields are dumped. Some codes perform half iterations to make sure that the fields are dumped without offset, some codes dont and this is what is saved here. Its designed in its own variable to make sure this possibly tiny offset is always resolved numerically, even if the absolute coordinates are large values. The definition is here:

The following attributes must be stored with each scalar record and each component of a vector record:

position
    type: 1-dimensional array of N (floatX) where N is the number of dimensions in the simulation.
    range of each value: [ 0.0 : 1.0 )
    description: relative position of the component on the current element of the mesh/grid/node/cell/voxel; 0.0 means at the beginning of the mesh element and 1.0 is the beginning of the next mesh element; the same dimensionality N as in gridSpacing and gridGlobalOffset

from https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#mesh-based-records

In Contrast the gridGlobalOffset, which also has to be stored on every mesh record, can set arbitrary offsets for the entire grid, for example a moving window can be saved by only changing this number. Does that make sense?

from smilei.

mccoys avatar mccoys commented on June 25, 2024

Fixed: 12dd7db

from smilei.

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.