simphony / simphony-metadata

[LEGACY] This repository contains the metadata definitions used in SimPhoNy project.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Use of shape in some contexts is arbitrary, hints at incorrect VECTOR shape usage #84

Closed stefanoborini closed 7 years ago

stefanoborini commented 7 years ago

The "shape" entry in some context is arbitrary and deceiving. For example, in this context:

542   BOND:
543     definition: A bond between two or more atoms or particles
544     parent: CUBA.CUDS_ITEM
545     CUBA.PARTICLE:
546       shape: (:)

Implies a list of PARTICLE entities of any length. This is ok.

Similarly, this entry specifies a list of three sizes, each of shape 1 as from cuba.yml

596   BRAVAIS_LATTICE: 
597     definition: A Bravais lattice 
598     parent: CUBA.LATTICE 
599     CUBA.SIZE:
600       shape: (3)
601       default: [1, 1, 1]

In POINT, we use POSITION, which is defined as shape 3 in cuba.yml. This is a single position (no shape specified), and the position is 3-dimensional. This is also ok.

521   POINT:
522     definition: A point in a 3D space system
523     parent: CUBA.CUDS_ITEM
524     CUBA.POSITION:
525       default: [0, 0, 0]

The problem is however in usages of VECTOR, which is defined as shape 3 in cuba.yml. The specification of shape: (3,3) means 3x3 entries of vectors (each vector holding 3 values). I doubt this is what was intended.

510   BOX:
511     definition: A simple hexahedron (with six faces) simulation box defined by the three vectors and three directions. The condition should be specified for each direction (two faces at a time).
512     parent: CUBA.BOUNDARY
513     CUBA.VECTOR:
514       shape: (3,3)
515       default: [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
516       scope: CUBA.USER

Therefore I suspect the intention was to have shape 3 here. We also need to check if this is an issue somewhere else.

ahashibon commented 7 years ago

shape in BOX for VECTOR is not correct, in the context of a BOX we need to define three vectors, each of shape 3. So you are right, it should be shape (3).