Skip to content
Arto Sandroos edited this page Jul 2, 2015 · 1 revision

All meshes in VLSV format are logically Cartesian, i.e. mesh is defined by its Cartesian bounding box, and node coordinates can be calculated from (i,j,k) indices. With Cartesian coordinate system the logical coordinates coincide with physical coordinates,

float x = xcrds[i];
float y = ycrds[j];
float z = zcrds[k];

However, in case of Cylindrical and spherical coordinate systems the logical coordinates must map into (r,phi,z) and (r,theta,phi). VLSV visualization plugin maps these into Cartesian coordinates for Visit,

// Cylindrical
float r_cyl   = xcrds[i];
float phi_cyl = ycrds[j];
float z_cyl   = zcrds[k];
float x_cyl = r_cyl * cos(phi_cyl);
float y_cyl = r_cyl * sin(phi_cyl);
float z_cyl = z_cyl;

// Spherical
float r_sph     = xcrds[i];
float theta_sph = ycrds[j];
float phi_sph   = zcrds[k];
float x_sph = r_sph * sin(theta_sph) * cos(phi_sph);
float y_sph = r_sph * sin(theta_sph) * sin(phi_sph);float z_sph = r_sph * cos(theta_sph);
Clone this wiki locally