Skip to content

Commit

Permalink
more braces
Browse files Browse the repository at this point in the history
  • Loading branch information
drreynolds committed Sep 25, 2024
1 parent a449946 commit 42e99d9
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions examples/arkode/CXX_manyvector/ark_sod_lsrk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ class EulerData
const sunrealtype* my, const sunrealtype* mz,
const sunrealtype* et, const long int& i)
{
for (int l = 0; l < STSIZE; l++) this->w1d[l][0] = rho[i - 3 + l];
for (int l = 0; l < STSIZE; l++) this->w1d[l][1] = mx[i - 3 + l];
for (int l = 0; l < STSIZE; l++) this->w1d[l][2] = my[i - 3 + l];
for (int l = 0; l < STSIZE; l++) this->w1d[l][3] = mz[i - 3 + l];
for (int l = 0; l < STSIZE; l++) this->w1d[l][4] = et[i - 3 + l];
for (int l = 0; l < STSIZE; l++) { this->w1d[l][0] = rho[i - 3 + l]; }
for (int l = 0; l < STSIZE; l++) { this->w1d[l][1] = mx[i - 3 + l]; }
for (int l = 0; l < STSIZE; l++) { this->w1d[l][2] = my[i - 3 + l]; }
for (int l = 0; l < STSIZE; l++) { this->w1d[l][3] = mz[i - 3 + l]; }
for (int l = 0; l < STSIZE; l++) { this->w1d[l][4] = et[i - 3 + l]; }
}

// Utility routine to pack 1-dimensional data for locations near the
Expand All @@ -164,25 +164,45 @@ class EulerData
const sunrealtype* et, const long int& i)
{
for (int l = 0; l < 3; l++)
{
this->w1d[l][0] = (i < (3 - l)) ? rho[2 - (i + l)] : rho[i - 3 + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l][1] = (i < (3 - l)) ? mx[2 - (i + l)] : mx[i - 3 + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l][2] = (i < (3 - l)) ? my[2 - (i + l)] : my[i - 3 + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l][3] = (i < (3 - l)) ? mz[2 - (i + l)] : mz[i - 3 + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l][4] = (i < (3 - l)) ? et[2 - (i + l)] : et[i - 3 + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l + 3][0] = (i > (nx - l - 1)) ? rho[i + l - 3] : rho[i + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l + 3][1] = (i > (nx - l - 1)) ? mx[i + l - 3] : mx[i + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l + 3][2] = (i > (nx - l - 1)) ? my[i + l - 3] : my[i + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l + 3][3] = (i > (nx - l - 1)) ? mz[i + l - 3] : mz[i + l];
}
for (int l = 0; l < 3; l++)
{
this->w1d[l + 3][4] = (i > (nx - l - 1)) ? et[i + l - 3] : et[i + l];
}
}

// Equation of state -- compute and return pressure,
Expand Down

0 comments on commit 42e99d9

Please sign in to comment.