TYCHO  1.3.0
 All Data Structures Files Functions Variables Enumerations Enumerator
/home/kapf/tycho_docu/copy_arrays_for_viscosity.c
Go to the documentation of this file.
1 /*
2  * copy arrays for viscosity.c
3  *
4  * Author: Wolfgang Kapferer
5  */
6 
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <math.h>
10 
11 #include "variables_global.h"
12 #include "prototypes.h"
13 
14 #ifdef _OPENMP
15 #include <omp.h>
16 #endif
17 
24 int copy_arrays_for_viscosity(int x, int y, int z) {
25 
26  int i, j, k;
27 
28 #ifdef _OPENMP
29 #pragma omp parallel default(none) \
30  private(j, i, k) \
31  shared(x,y,z, rho_visc, \
32  vx_visc, vy_visc, vz_visc, \
33  rho, vx, vy, vz)
34  {
35 #endif
36 
37  for (i = 0; i < x; i++) {
38 
39 #ifdef _OPENMP
40 #pragma omp for schedule(static)
41 #endif
42  for (j = 0; j < y; j++) {
43 
44  for (k = 0; k < z; k++) {
45  rho_visc[i][j][k] = rho[i][j][k];
46  vx_visc[i][j][k] = vx[i][j][k];
47  vy_visc[i][j][k] = vy[i][j][k];
48  vz_visc[i][j][k] = vz[i][j][k];
49  }
50  }
51  }
52 
53 #ifdef _OPENMP
54  }
55 #endif
56 
57  return 0;
58 }