Field initialization
Initialization of fields using a formula working on coords attribute shouls always be used as follows.
def init_scalar(data, coords):
(x,y,z) = coords[0]
This is required as a consistency of vector-like objects. As we consider as 1st coordinate V_x the element velocity.data[0], the first array of coords[0] should be the x axis.
For instance, with a discretization of shape (16,32,64) in C_ORDER,
The shape of the x,y and z arrays defined as : (x,y,z) = coords[0]
should be :
- (1,1,64), (1,32,1) and (16,1,1) in topology state ZYX in C_ORDER
- (64,1,1), (1,32,1) and (1,1,16) in topology state XYZ in C_ORDER
- (64,1,1), (1,32,1) and (1,1,16) in topology state ZYX in F_ORDER
In conclusion, the get_local_mesh_coord of a mesh should always give the (ordered) x,y,z coordinates in the current transposition state.
Edited by EXT Jean-Matthieu Etancelin