Hello all,
I am trying to have access to Tensorfield2D through get(iX,iY) function which return reference tensor type. However, the compilator gives me the error cpp:131: error: invalid array assignment
Could you comment something or just explain how can I have access to TensorField2D to each node.
Here is the piece of code:
void calculateforce(TensorField2D<T,2>& force,BlockStructure2D<T,DESCRIPTOR>& lattice)
{
//TensorField2D<T,2> calc;
T calc[2];
for(int iX=0;iX<nx;iX++)
{
for(int iY=0;iY<ny;iY++)
{
for (int m=0;m < DESCRIPTOR<T>::d;m++)
{
calc[0]=0.0;calc[1]=0.0;
for(int k=0;k < DESCRIPTOR<T>::q; k++)
{
calc[m]=calc[m]+DESCRIPTOR<T>::t[k]*((T)1- exp(lattice.get(iX,iY).computeRho()))*DESCRIPTOR<T>::c[k][m];
}
calc[m]= -G*calc[m]*((T)1-exp(lattice.get(iX,iY).computeRho()));
//force[m][iX][iY]=calc[m];
}
force.get(iX,iY)=calc;
}
}
}
Thank you,
Alex