#include "bt.h"

void exact_solution(double xi, double eta, double zeta, double dtemp[5],
                    __global double *g_ce);


//---------------------------------------------------------------------
// west face and east face                                                  
//---------------------------------------------------------------------
__kernel void initialize3(__global double *g_u,
                          __global double *g_ce,
                          int gp0,
                          int gp1,
                          int gp2)
{
  int i, j, k, m;
  double xi, eta, zeta, temp[5];

  k = get_global_id(1);
  j = get_global_id(0);
  if (k >= gp2 || j >= gp1) return;

  __global double (*u)[JMAXP+1][IMAXP+1][5] =
    (__global double (*)[JMAXP+1][IMAXP+1][5])g_u;

  zeta = (double)k * dnzm1;
  eta = (double)j * dnym1;

  i  = 0;
  xi = 0.0;
  exact_solution(xi, eta, zeta, temp, g_ce);
  for (m = 0; m < 5; m++) {
    u[k][j][i][m] = temp[m];
  }

  i  = gp0-1;
  xi = 1.0;
  exact_solution(xi, eta, zeta, temp, g_ce);
  for (m = 0; m < 5; m++) {
    u[k][j][i][m] = temp[m];
  }
}

