Skip to content

Commit b5363b7

Browse files
authored
Merge pull request #194 from ax3l/topic-removeDataOrder
Mesh: Remove Data Order
2 parents 8223062 + a6a5b53 commit b5363b7

File tree

1 file changed

+19
-31
lines changed

1 file changed

+19
-31
lines changed

STANDARD.md

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -369,41 +369,29 @@ meshes):
369369
the *imaginary* part)
370370
![definition of imaginary part](img/cylindrical.png)
371371

372-
- `dataOrder`
373-
- type: *(string)*
374-
- description: used for the reading of 1-dimensional arrays of N elements,
375-
where N is the number of dimensions in the simulation;
376-
these should be in the ordering of variation for the indexes
377-
for matrices as defined by the index-operator (`[...][...]`)
378-
of the writing code; can be omitted for 1D records
379-
- rationale: in Fortran, ordering of matrices is linearized in memory in
380-
column-major order whereas in C it is row-major; due to that
381-
the index-operators in Fortran and C operate in exactly
382-
opposite order;
383-
supported file-formats keep the order of the writing code's
384-
record components; we still need to store additional
385-
information such as `axisLabels` in a defined order
386-
- allowed values:
387-
- `C` if data is written by C or a C-like language such as C++, Python,
388-
Java
389-
- `F` if data is written by a Fortran code
390-
391372
- `axisLabels`
392373
- type: 1-dimensional array containing N *(string)*
393374
elements, where N is the number of dimensions in the simulation
394-
- description: ordering of the labels for the `geometry` of the mesh
395-
- advice to implementors: in the ordering of variation for the indexes for
396-
matrices as defined by the index-operator
397-
(`[...][...]`) of the writing code
398-
- advice to implementors: on read, query the record's `dataOrder` to get the
399-
information if you need to invert the access to
400-
`axisLabels` (and other attributes that use the
401-
same definition)
375+
- description: this attribute assigns human-readible labels for the
376+
indices `i`, `j`, `k`, etc. denoting the axes of a mesh
377+
`A_{i,j,k}`
378+
- advice to implementors: dimensions shall be ordered from slowest to
379+
fastest varying index when accessing the mesh
380+
contiguously (as 1D flattened logical memory)
381+
- advice to implementors: if you access a ND array in C-like languages,
382+
a matrix `A[i,j,k]` will have its first index
383+
as the slowest varying index (e.g. `i`);
384+
- if you access a ND array Fortran-like,
385+
a matrix `A(i,j,k)` will have its last index
386+
as the slowest varying index (e.g. `k`);
402387
- examples:
403-
- 3D `cartesian` C-style `A[z,y,x]` write: `("z", "y", "x")` and `dataOrder='C'`
404-
- 2D `cartesian` C-style `A[y,x]` write: `("y", "x")` and `dataOrder='C'`
405-
- 2D `cartesian` Fortran-style `A[x,y]` write: `("x", "y")` and `dataOrder='F'`
406-
- `thetaMode` Fortran-style `A[r,z]` write: `("r", "z")` and `dataOrder='F'`
388+
- 3D `cartesian` mesh accessed in C-like as `A[z,y,x]` will have `z` as
389+
its slowest varying index name and `axisLabels`: `("z", "y", "x")`
390+
- 3D `cartesian` mesh accessed in C-like as `A[x,y,z]` will have `x` as
391+
its slowest varying index name and `axisLabels`: `("x", "y", "z")`
392+
- 2D `cartesian` mesh accessed in Fortran-like as `A(x,y)` will have `y` as
393+
its slowest varying index name and `axisLabels`: `("y", "x")`
394+
- `thetaMode` accessed Fortran-like `A(r,z)`, `axisLabels`: `("z", "r")`
407395

408396
- `gridSpacing`
409397
- type: 1-dimensional array containing N *(floatX)*

0 commit comments

Comments
 (0)