#include "bt.h"

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


//---------------------------------------------------------------------
// bottom face and top face
//---------------------------------------------------------------------
__kernel void initialize5(__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];

  j = get_global_id(1);
  i = get_global_id(0);
  if (j >= gp1 || i >= gp0) return;

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

  eta = (double)j * dnym1;
  xi = (double)i * dnxm1;

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

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


