#include "bt.h"

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


//---------------------------------------------------------------------
// south face and north face                                                 
//---------------------------------------------------------------------
__kernel void initialize4(__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);
  i = get_global_id(0);
  if (k >= gp2 || i >= gp0) return;

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

  zeta = (double)k * dnzm1;
  xi = (double)i * dnxm1;

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

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

