static std::size_t index_##first##second##third(const RectilinearMesh3D* mesh, std::size_t index0, std::size_t index1, std::size_t index2) { \
return index##third + mesh->axis[third]->size() * (index##second + mesh->axis[second]->size() * index##first); \
} \
static std::size_t index##first##_##first##second##third(const RectilinearMesh3D* mesh, std::size_t mesh_index) { \
return mesh_index / mesh->axis[third]->size() / mesh->axis[second]->size(); \
} \
static std::size_t index##second##_##first##second##third(const RectilinearMesh3D* mesh, std::size_t mesh_index) { \
return (mesh_index / mesh->axis[third]->size()) % mesh->axis[second]->size(); \
} \
static std::size_t index##third##_##first##second##third(const RectilinearMesh3D* mesh, std::size_t mesh_index) { \
return mesh_index % mesh->axis[third]->size(); \
}