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 22, 2020
1 parent 136625c commit 0c5b881
Show file tree
Hide file tree
Showing 49 changed files with 2,945 additions and 2,665 deletions.
13 changes: 7 additions & 6 deletions examples/blob2d-laplacexz/blob2d.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Blob2D : public PhysicsModel {
}

int rhs(BoutReal UNUSED(t)) {
//Coordinates *coord = mesh->getCoordinates();
// Coordinates *coord = mesh->getCoordinates();

// Run communications
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -140,15 +140,15 @@ class Blob2D : public PhysicsModel {
/////////////////////////////////////////////////////////////////////////////

ddt(n) = -bracket(phi, n, BRACKET_SIMPLE) // ExB term
+ 2 * DDZ(n) * (rho_s / R_c); // Curvature term
ddt(n) += D_n*Delp2(n, CELL_DEFAULT, false);
+ 2 * DDZ(n) * (rho_s / R_c); // Curvature term
ddt(n) += D_n * Delp2(n, CELL_DEFAULT, false);

// if(coord->is3D()){
// ddt(n) += Div_Perp_Lap_FV(D_n, n); // Diffusion term
// }else{
// ddt(n) += D_n*Delp2(n);
// }

if (compressible) {
ddt(n) -= 2 * n * DDZ(phi) * (rho_s / R_c); // ExB Compression term
}
Expand All @@ -162,8 +162,9 @@ class Blob2D : public PhysicsModel {
/////////////////////////////////////////////////////////////////////////////

ddt(omega) = -bracket(phi, omega, BRACKET_SIMPLE) // ExB term
+ 2 * DDZ(n) * (rho_s / R_c) / n; // Curvature term
ddt(omega) += D_vort * Delp2(omega, CELL_DEFAULT, false)/n; // Viscous diffusion term
+ 2 * DDZ(n) * (rho_s / R_c) / n; // Curvature term
ddt(omega) +=
D_vort * Delp2(omega, CELL_DEFAULT, false) / n; // Viscous diffusion term

// if(coord->is3D()){
// ddt(omega) += Div_Perp_Lap_FV(D_vort ,omega) / n ; // Viscous diffusion term
Expand Down
9 changes: 5 additions & 4 deletions examples/elm-pb/elm_pb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ELMpb : public PhysicsModel {
// 2D inital profiles
Field2D J0, P0; // Current and pressure
Vector2D b0xcv; // Curvature term
Field2D beta; // Used for Vpar terms
Field2D beta; // Used for Vpar terms
Coordinates::metric_field_type gradparB;
Field2D phi0; // When diamagnetic terms used
Field2D Psixy, x; // 0th vorticity of equilibrium flow,
Field2D Psixy, x; // 0th vorticity of equilibrium flow,
Coordinates::metric_field_type U0;
// radial flux coordinate, normalized radial flux coordinate

Expand Down Expand Up @@ -657,8 +657,9 @@ class ELMpb : public PhysicsModel {
for (int jy = 0; jy < mesh->LocalNy; jy++)
for (int jz = 0; jz < mesh->LocalNz; jz++) {

BoutReal angle = rmp_m * pol_angle(jx, jy)
+ rmp_n * ((BoutReal)jz) * mesh->getCoordinates()->dz(jx,jy,jz);
BoutReal angle =
rmp_m * pol_angle(jx, jy)
+ rmp_n * ((BoutReal)jz) * mesh->getCoordinates()->dz(jx, jy, jz);
rmp_Psi0(jx, jy, jz) =
(((BoutReal)(jx - 4)) / ((BoutReal)(mesh->LocalNx - 5)))
* rmp_factor * cos(angle);
Expand Down
80 changes: 43 additions & 37 deletions examples/lapd-drift/lapd_drift.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ class LAPDdrift : public PhysicsModel {


/****************SPECIAL DIFFERENTIAL OPERATORS******************/
Coordinates::metric_field_type Perp_Grad_dot_Grad(const Field2D &p, const Field2D &f) {
Coordinates::metric_field_type Perp_Grad_dot_Grad(const Field2D& p, const Field2D& f) {

return DDX(p)*DDX(f)*mesh->getCoordinates()->g11;
}

Expand All @@ -738,7 +738,7 @@ class LAPDdrift : public PhysicsModel {
// ExB terms. These routines allow comparisons with BOUT-06
// if bout_exb=true is set in BOUT.inp
/////////////////////////////////////////////////////////////////
Coordinates::metric_field_type vE_Grad(const Field2D &f, const Field2D &p) {
Coordinates::metric_field_type vE_Grad(const Field2D& f, const Field2D& p) {
Coordinates::metric_field_type result;
if (bout_exb) {
// Use a subset of terms for comparison to BOUT-06
Expand Down Expand Up @@ -767,25 +767,27 @@ class LAPDdrift : public PhysicsModel {
int jzm = (jz - 1 + ncz) % ncz;

// J++ = DDZ(p)*DDX(f) - DDX(p)*DDZ(f)
BoutReal Jpp = 0.25*( (p(jx,jy,jzp) - p(jx,jy,jzm))*
(f(jx+1,jy) - f(jx-1,jy)) -
(p(jx+1,jy,jz) - p(jx-1,jy,jz))*
(f(jx,jy) - f(jx,jy)) )
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));
BoutReal Jpp =
0.25
* ((p(jx, jy, jzp) - p(jx, jy, jzm)) * (f(jx + 1, jy) - f(jx - 1, jy))
- (p(jx + 1, jy, jz) - p(jx - 1, jy, jz)) * (f(jx, jy) - f(jx, jy)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));

// J+x
BoutReal Jpx = 0.25*( f(jx+1,jy)*(p(jx+1,jy,jzp)-p(jx+1,jy,jzm)) -
f(jx-1,jy)*(p(jx-1,jy,jzp)-p(jx-1,jy,jzm)) -
f(jx,jy)*(p(jx+1,jy,jzp)-p(jx-1,jy,jzp)) +
f(jx,jy)*(p(jx+1,jy,jzm)-p(jx-1,jy,jzm)))
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));
BoutReal Jpx = 0.25
* (f(jx + 1, jy) * (p(jx + 1, jy, jzp) - p(jx + 1, jy, jzm))
- f(jx - 1, jy) * (p(jx - 1, jy, jzp) - p(jx - 1, jy, jzm))
- f(jx, jy) * (p(jx + 1, jy, jzp) - p(jx - 1, jy, jzp))
+ f(jx, jy) * (p(jx + 1, jy, jzm) - p(jx - 1, jy, jzm)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));
// Jx+
BoutReal Jxp = 0.25*( f(jx+1,jy)*(p(jx,jy,jzp)-p(jx+1,jy,jz)) -
f(jx-1,jy)*(p(jx-1,jy,jz)-p(jx,jy,jzm)) -
f(jx-1,jy)*(p(jx,jy,jzp)-p(jx-1,jy,jz)) +
f(jx+1,jy)*(p(jx+1,jy,jz)-p(jx,jy,jzm)))
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));

BoutReal Jxp = 0.25
* (f(jx + 1, jy) * (p(jx, jy, jzp) - p(jx + 1, jy, jz))
- f(jx - 1, jy) * (p(jx - 1, jy, jz) - p(jx, jy, jzm))
- f(jx - 1, jy) * (p(jx, jy, jzp) - p(jx - 1, jy, jz))
+ f(jx + 1, jy) * (p(jx + 1, jy, jz) - p(jx, jy, jzm)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));

result(jx,jy,jz) = (Jpp + Jpx + Jxp) / 3.;
}

Expand Down Expand Up @@ -828,25 +830,29 @@ class LAPDdrift : public PhysicsModel {
int jzm = (jz - 1 + ncz) % ncz;

// J++ = DDZ(p)*DDX(f) - DDX(p)*DDZ(f)
BoutReal Jpp = 0.25*( (p(jx,jy,jzp) - p(jx,jy,jzm))*
(f(jx+1,jy,jz) - f(jx-1,jy,jz)) -
(p(jx+1,jy,jz) - p(jx-1,jy,jz))*
(f(jx,jy,jzp) - f(jx,jy,jzm)) )
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));

BoutReal Jpp = 0.25
* ((p(jx, jy, jzp) - p(jx, jy, jzm))
* (f(jx + 1, jy, jz) - f(jx - 1, jy, jz))
- (p(jx + 1, jy, jz) - p(jx - 1, jy, jz))
* (f(jx, jy, jzp) - f(jx, jy, jzm)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));

// J+x
BoutReal Jpx = 0.25*( f(jx+1,jy,jz)*(p(jx+1,jy,jzp)-p(jx+1,jy,jzm)) -
f(jx-1,jy,jz)*(p(jx-1,jy,jzp)-p(jx-1,jy,jzm)) -
f(jx,jy,jzp)*(p(jx+1,jy,jzp)-p(jx-1,jy,jzp)) +
f(jx,jy,jzm)*(p(jx+1,jy,jzm)-p(jx-1,jy,jzm)))
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));
BoutReal Jpx =
0.25
* (f(jx + 1, jy, jz) * (p(jx + 1, jy, jzp) - p(jx + 1, jy, jzm))
- f(jx - 1, jy, jz) * (p(jx - 1, jy, jzp) - p(jx - 1, jy, jzm))
- f(jx, jy, jzp) * (p(jx + 1, jy, jzp) - p(jx - 1, jy, jzp))
+ f(jx, jy, jzm) * (p(jx + 1, jy, jzm) - p(jx - 1, jy, jzm)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));
// Jx+
BoutReal Jxp = 0.25*( f(jx+1,jy,jzp)*(p(jx,jy,jzp)-p(jx+1,jy,jz)) -
f(jx-1,jy,jzm)*(p(jx-1,jy,jz)-p(jx,jy,jzm)) -
f(jx-1,jy,jzp)*(p(jx,jy,jzp)-p(jx-1,jy,jz)) +
f(jx+1,jy,jzm)*(p(jx+1,jy,jz)-p(jx,jy,jzm)))
/ (coord->dx(jx,jy, jz) * coord->dz(jx,jy,jz));

BoutReal Jxp = 0.25
* (f(jx + 1, jy, jzp) * (p(jx, jy, jzp) - p(jx + 1, jy, jz))
- f(jx - 1, jy, jzm) * (p(jx - 1, jy, jz) - p(jx, jy, jzm))
- f(jx - 1, jy, jzp) * (p(jx, jy, jzp) - p(jx - 1, jy, jz))
+ f(jx + 1, jy, jzm) * (p(jx + 1, jy, jz) - p(jx, jy, jzm)))
/ (coord->dx(jx, jy, jz) * coord->dz(jx, jy, jz));

result(jx,jy,jz) = (Jpp + Jpx + Jxp) / 3.;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/orszag-tang/mhd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MHD : public PhysicsModel {

Coordinates *coord = mesh->getCoordinates();
output.write("dx(0,0,0) = {:e}, dy(0,0,0) = {:e}, dz(0,0,0) = {:e}\n",
coord->dx(0, 0, 0), coord->dy(0, 0, 0), coord->dz(0, 0, 0));
coord->dx(0, 0, 0), coord->dy(0, 0, 0), coord->dz(0, 0, 0));

SAVE_REPEAT(divB);

Expand Down
Loading

0 comments on commit 0c5b881

Please sign in to comment.