Dear Zhicheng, After a look over your suggestion I think your approach is generally correct. However I am not sure you should be using the “MultiRegions::eGlobal” argument in IProductWRTbase. This option is stating that it will place the global coefficients into a storage format where every global degree of freedom is only stored one (hence the eGlobal). Normally we keep the coefficient space in local or elemental format. This seems to be how you are requesting the IProductWRTDerivBase to be stored. Best regards, Spencer. On 11 Jun 2015, at 03:02, Zhicheng Wang <wangzhicheng09@gmail.com<mailto:wangzhicheng09@gmail.com>> wrote: Hi All, I'd like to use explicit scheme to discretize the diffusion term in the case of 3DHomogeneous1D in continuous Galerkin projection framework. For example, I have an array u, which stores the value of first component of velocity vector in Fourier spoace. and I want to calculate the inner product (grad w, grad u), where w is the base function, grad is gradient operator. Could following code get the correct result? m_fields[0]->PhysDeriv(0,u ,u_derv[0]); // gradient in x direction m_fields[0]->PhysDeriv(1,u, u_derv[1]); // gradient in y direction for(unsigned int i=0; i<num_planes; ++i) { double beta = 2*M_PI*m_trans->GetK(i)/m_homoLen; beta *= beta; m_fields[0]->GetPlane(i)->IProductWRTDerivBase(0, &u _derv[0]+i*np, &wkCoef1[0] +i*nc); // m_fields[0]->GetPlane(i)->IProductWRTDerivBase(1, &u _derv[1]+i*np, &wkCoef1[0]+i*nc); m_fields[0]->GetPlane(i)->IProductWRTBase(tmp1 = &u[0]+i*np, &wkCoef2[0]+i*nc,MultiRegions::eGlobal); Vmath::Smul(nc, beta, &wkCoef2[0] + i*nc, 1, &wkCoef2[0]+ i*nc, 1); } Vmath::Vadd(NumTotCoeffs,wkCoef0,1,wkCoef1,1,diff,1); Vmath::Vadd(NumTotCoeffs,wkCoef0,1,wkCoef2,1,diff,1); // array diff stores the final diffusion value _______________________________________________ Nektar-users mailing list Nektar-users@imperial.ac.uk<mailto:Nektar-users@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/nektar-users Spencer Sherwin McLaren Racing/Royal Academy of Engineering Research Chair, Professor of Computational Fluid Mechanics, Department of Aeronautics, Imperial College London South Kensington Campus London SW7 2AZ s.sherwin@imperial.ac.uk<mailto:s.sherwin@imperial.ac.uk> +44 (0) 20 759 45052