Skip to content

Commit

Permalink
[clang-format-command] fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 31, 2020
1 parent ccaf491 commit 54e042f
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 45 deletions.
2 changes: 1 addition & 1 deletion include/bout/fv_ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -514,5 +514,5 @@ namespace FV {
*/
Field3D Div_Perp_Lap(const Field3D& a, const Field3D& f,
CELL_LOC outloc = CELL_DEFAULT);
}
} // namespace FV
#endif // __FV_OPS_H__
6 changes: 3 additions & 3 deletions src/fileio/datafile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1202,9 +1202,9 @@ bool Datafile::write() {
}

#ifdef COORDINATES_USE_3D
write_f3d(name+"x", &(v.x), var.save_repeat);
write_f3d(name+"y", &(v.y), var.save_repeat);
write_f3d(name+"z", &(v.z), var.save_repeat);
write_f3d(name + "x", &(v.x), var.save_repeat);
write_f3d(name + "y", &(v.y), var.save_repeat);
write_f3d(name + "z", &(v.z), var.save_repeat);
#else
write_f2d(name+"x", &(v.x), var.save_repeat);
write_f2d(name+"y", &(v.y), var.save_repeat);
Expand Down
2 changes: 1 addition & 1 deletion src/invert/laplace/impls/multigrid/multigrid_laplace.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ BOUT_OMP(for collapse(2))
D(i2, yindex, k2) * 2. * coords->g13(i2, yindex) / coords->dx(i2, yindex) / dz;
// coefficient of mixed derivative stencil (could assume zero, at least initially,
// if easier; then check this is true in constructor)

BoutReal dxd = (D(i2, yindex, k2)*coords->G1(i2, yindex)
+ coords->g11(i2, yindex)*ddx_C
+ coords->g13(i2, yindex)*ddz_C // (could assume zero, at least initially, if easier; then check this is true in constructor)
Expand Down
33 changes: 20 additions & 13 deletions src/invert/laplace/impls/petsc/petsc_laplace.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -691,19 +691,26 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) {
MatA);
}
else {
// // Second Order Accuracy on Boundary
// Element(i,x,z, 0, 0, 3.0 / (2.0*coords->dx(x,y)), MatA );
// Element(i,x,z, -1, 0, -2.0 / coords->dx(x,y), MatA );
// Element(i,x,z, -2, 0, 1.0 / (2.0*coords->dx(x,y)), MatA );
// Element(i,x,z, -3, 0, 0.0, MatA ); // Reset these elements to 0 in case 4th order flag was used previously: not allowed now
// Element(i,x,z, -4, 0, 0.0, MatA );
// Second Order Accuracy on Boundary, set half-way between grid points
Element(i, x, z, 0, 0, 1.0 / coords->dx(x, y, z) / sqrt(coords->g_11(x, y, z)), MatA);
Element(i, x, z, -1, 0, -1.0 / coords->dx(x, y, z) / sqrt(coords->g_11(x, y, z)), MatA);
Element(i, x, z, -2, 0, 0.0, MatA);
// Element(i,x,z, -3, 0, 0.0, MatA ); // Reset these elements to 0 in case 4th order flag was used previously: not allowed now
// Element(i,x,z, -4, 0, 0.0, MatA );
}
// // Second Order Accuracy on Boundary
// Element(i,x,z, 0, 0, 3.0 / (2.0*coords->dx(x,y)), MatA );
// Element(i,x,z, -1, 0, -2.0 / coords->dx(x,y), MatA );
// Element(i,x,z, -2, 0, 1.0 / (2.0*coords->dx(x,y)), MatA );
// Element(i,x,z, -3, 0, 0.0, MatA ); // Reset these elements to 0
// in case 4th order flag was used previously: not allowed now
// Element(i,x,z, -4, 0, 0.0, MatA );
// Second Order Accuracy on Boundary, set half-way between grid
// points
Element(i, x, z, 0, 0,
1.0 / coords->dx(x, y, z) / sqrt(coords->g_11(x, y, z)),
MatA);
Element(i, x, z, -1, 0,
-1.0 / coords->dx(x, y, z) / sqrt(coords->g_11(x, y, z)),
MatA);
Element(i, x, z, -2, 0, 0.0, MatA);
// Element(i,x,z, -3, 0, 0.0, MatA ); // Reset these elements to 0
// in case 4th order flag was used previously: not allowed now
// Element(i,x,z, -4, 0, 0.0, MatA );
}
}
else {
if (fourth_order) {
Expand Down
46 changes: 23 additions & 23 deletions src/mesh/boundary_standard.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1887,8 +1887,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
}
}
#else
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
#endif
}

Expand Down Expand Up @@ -2126,9 +2126,9 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y, zk)
+ bndry->by * metric->dy(bndry->x, bndry->y, zk);
#else
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y)
+ bndry->by * metric->dy(bndry->x, bndry->y);
for (int zk = 0; zk < mesh->LocalNz; zk++) {
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y)
+ bndry->by * metric->dy(bndry->x, bndry->y);
for (int zk = 0; zk < mesh->LocalNz; zk++) {
#endif
if (fg) {
val = fg->generate(Context(bndry, zk, loc, t, mesh));
Expand Down Expand Up @@ -2223,8 +2223,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
}
}
#else
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
#endif
}

Expand Down Expand Up @@ -2328,8 +2328,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
// cell
}
#else
throw BoutException(
"void BoundaryNeumann_4thOrder::apply(Field2D& f) not implemented with 3D metrics");
throw BoutException("void BoundaryNeumann_4thOrder::apply(Field2D& f) not "
"implemented with 3D metrics");
#endif
}

Expand Down Expand Up @@ -2397,8 +2397,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
* sqrt(metric->g_22(bndry->x, bndry->y)
/ metric->g_22(bndry->x - bndry->bx, bndry->y - bndry->by));
#else
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
#endif
}

Expand Down Expand Up @@ -2549,8 +2549,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
} while (!bndry->isDone());
}
#else
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
#endif
}

Expand Down Expand Up @@ -2610,8 +2610,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
} while (!bndry->isDone());
}
#else
throw BoutException(
"Applying boundary to Field3D not compatible with 3D metrics in ZeroLaplace case.");
throw BoutException("Applying boundary to Field3D not compatible with 3D metrics in "
"ZeroLaplace case.");
#endif
}

Expand Down Expand Up @@ -2652,8 +2652,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
} while (!bndry->isDone());
}
#else
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
throw BoutException(
"Applying boundary to Field2D not compatible with 3D metrics in all cases.");
#endif
}

Expand Down Expand Up @@ -2710,8 +2710,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
} while (!bndry->isDone());
}
#else
throw BoutException("Applying boundary to Field3D not compatible with 3D metrics in "
"ZeroLaplace2 case.");
throw BoutException("Applying boundary to Field3D not compatible with 3D metrics in "
"ZeroLaplace2 case.");
#endif
}

Expand Down Expand Up @@ -2825,8 +2825,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
} while (!bndry->isDone());
}
#else
throw BoutException("Applying boundary to Field3D not compatible with 3D metrics in "
"ConstLaplace case.");
throw BoutException("Applying boundary to Field3D not compatible with 3D metrics in "
"ConstLaplace case.");
#endif
}

Expand Down Expand Up @@ -2937,8 +2937,8 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
}
}
#else
throw BoutException(
"Applying boundary to Vector3D not compatible with 3D metrics in DivCurl.");
throw BoutException(
"Applying boundary to Vector3D not compatible with 3D metrics in DivCurl.");
#endif
}

Expand Down
6 changes: 4 additions & 2 deletions src/mesh/coordinates.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,10 @@ Coordinates::Coordinates(Mesh* mesh, Options* options, const CELL_LOC loc,
// Attempt to read Bxy from the grid file
auto Bcalc = Bxy;
if (getAtLoc(mesh, Bxy, "Bxy", suffix, location)) {
output_warn.write("\tWARNING: Magnitude of B field 'Bxy_{:s}' not found. Calculating "
" from metric tensor\n", suffix);
output_warn.write(
"\tWARNING: Magnitude of B field 'Bxy_{:s}' not found. Calculating "
" from metric tensor\n",
suffix);
Bxy = Bcalc;
} else {
Bxy = interpolateAndExtrapolate(Bxy, location, extrapolate_x, extrapolate_y, false,
Expand Down
4 changes: 2 additions & 2 deletions src/mesh/difops.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,11 @@ Field3D bracket(const Field3D& f, const Field2D& g, BRACKET_METHOD method,
result(jx,jy,jz) = (Jpp + Jpx + Jxp) * spacingFactor;
}
}
}
}
#else
throw BoutException("BRACKET_ARAKAWA_OLD not valid with 3D metrics yet.");
#endif
break;
break;
}
case BRACKET_SIMPLE: {
// Use a subset of terms for comparison to BOUT-06
Expand Down

0 comments on commit 54e042f

Please sign in to comment.