I don't want to make that for the whole array members one by one, that is for i=0,1,2,...,size
That's what you have to do. Just put it in a loop:
1 2
for(int i = 0; i < size; ++i)
cent[i].grad.x = ¢[i].grad.u;
Only way around it would be to do this in a constructor:
1 2 3 4 5 6 7 8 9 10 11 12 13
struct sGrad
{
sGrad() // constructor -- called for each object when it is created
{
x = &u; // set this pointer in the constructor
}
vectorize u;
vectorize v;
vectorize w;
vectorize T;
vectorize *x;
} grad;