Skip to content

Commit

Permalink
Extract method set_shearfactor_and_curvature_term()
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchapman committed Nov 19, 2024
1 parent a1a15e3 commit 1dba2f2
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions include/bout/tokamak_coordinates_factory.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,7 @@ public:

BoutReal sign_of_bp = get_sign_of_bp();

if (!include_curvature) {
b0xcv_m = 0.0;
}

if (noshear) {
if (include_curvature) {
b0xcv_m.z += ShearFactor_m * b0xcv_m.x;
}
ShearFactor_m = 0.0;
}
// if (ShiftXderivs and not!mesh->IncIntShear) {
// // Dimits style, using local coordinate system
// if (include_curvature) {
// b0xcv.z += I * b0xcv.x;
// }
// I = 0.0; // I disappears from metric
// }
set_shearfactor_and_curvature_term(noshear, include_curvature);

auto* coord = mesh_m.getCoordinates();

Expand All @@ -92,6 +76,29 @@ public:
return coord;
}

void set_shearfactor_and_curvature_term(const bool noshear, const bool include_curvature) {

if (!include_curvature) {
b0xcv_m = 0.0;
}

if (noshear) {
if (include_curvature) {
b0xcv_m.z += ShearFactor_m * b0xcv_m.x;
}
ShearFactor_m = 0.0;
}

// if (ShiftXderivs and not!mesh->IncIntShear) {
// // Dimits style, using local coordinate system
// if (include_curvature) {
// b0xcv.z += I * b0xcv.x;
// }
// I = 0.0; // I disappears from metric
// }

}

void normalise(BoutReal Lbar, BoutReal Bbar) {

Rxy_m /= Lbar;
Expand Down

0 comments on commit 1dba2f2

Please sign in to comment.