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