To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 7d78fc2b authored by ahuegli's avatar ahuegli

q4 finished

parent d3af0296
......@@ -328,23 +328,56 @@ void WaveEquation::run(double t_end) {
int i0_max = N;
int i1_max = N;
int i2_max = N;*/
#pragma omp parallel
{
int tid = omp_get_thread_num();
int ti0, ti1, ti2;
thread_coordinates(tid, threads_per_dim, ti0, ti1, ti2);
int nloc = N / threads_per_dim;
int i0_min = ti0 * nloc;
int i1_min = ti1 * nloc;
int i2_min = ti2 * nloc;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i1 = 1 + i1_min; i1 < i1_min + nloc + 1; i1++)
for (int i2 = 1 + i2_min; i2 < i2_min + nloc + 1; i2++)
UpdateGridPoint(i0, i1, i2);
}
int tid = omp_get_thread_num();
int ti0, ti1, ti2;
thread_coordinates(tid, threads_per_dim, ti0, ti1, ti2);
int nloc = N / threads_per_dim;
int i0_min = ti0 * nloc;
int i1_min = ti1 * nloc;
int i2_min = ti2 * nloc;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i1 = 1 + i1_min; i1 < i1_min + nloc + 1; i1++)
for (int i2 = 1 + i2_min; i2 < i2_min + nloc + 1; i2++)
UpdateGridPoint(i0, i1, i2);
int i0, i1, i2;
i0 = 1+i0_min;
for (int i1 = 1 + i1_min+1; i1 < i1_min + nloc; i1++)
for (int i2 = 1 + i2_min+1; i2 < i2_min + nloc; i2++)
UpdateGridPoint(i0, i1, i2);
i0 = i0_min+nloc;
for (int i1 = 1 + i1_min+1; i1 < i1_min + nloc; i1++)
for (int i2 = 1 + i2_min+1; i2 < i2_min + nloc; i2++)
UpdateGridPoint(i0, i1, i2);
i1 = 1+i1_min;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i2 = 1 + i2_min+1; i2 < i2_min + nloc; i2++)
UpdateGridPoint(i0, i1, i2);
i1 = i1_min+nloc;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i2 = 1 + i2_min+1; i2 < i2_min + nloc; i2++)
UpdateGridPoint(i0, i1, i2);
i2 = 1+i2_min;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i1 = 1 + i1_min; i1 < i1_min + nloc + 1; i1++)
UpdateGridPoint(i0, i1, i2);
i2 = i2_min+nloc;
for (int i0 = 1 + i0_min; i0 < i0_min + nloc + 1; i0++)
for (int i1 = 1 + i1_min; i1 < i1_min + nloc + 1; i1++)
UpdateGridPoint(i0, i1, i2);
// ********************************************************************************
// ********************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment