I was using the syntax as given in driver.cc example to create a 1D array descriptor. That worked fine. However, I am facing problems in creating a descriptor for a 2D array. Could some one please provide me with a very simple example on creation of an array descriptor for a 2D array. I am not looking for a full-blown example; all I need is just an idea of how that can be done.
Thanks in advance !!
Regards,
Ankur
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I was using the syntax as given in driver.cc example to create a 1D array descriptor. That worked fine. However, I am facing problems in creating a descriptor for a 2D array. Could some one please provide me with a very simple example on creation of an array descriptor for a 2D array. I am not looking for a full-blown example; all I need is just an idea of how that can be done.
Thanks in advance !!
Regards,
Ankur
Hi Ankur,
Happy New Year! This snippet is based on the particle/driver.cc
example you mentioned. It creates a very simple 2D array (3x3).
double position2[][3] = {{1.1, 1.2, 1.3},
{2.1, 2.2, 2.3},
{3.1, 3.2, 3.3}};
int rank = 2;
unsigned long size[] = {3,3};
F90::Array<double> pos2((double *)position2, rank, size);
Hope that helps,
Paul