Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3187,9 +3187,12 @@ vmecpp::MercierFileContents vmecpp::ComputeMercierStability(
// S
mercier.s[jF] = mercier_intermediate.s[jF];

// mercier.f90 forms this as sqs = 0.5*(vp_real(i) + vp_real(i+1))*sign_jac
// and divides SHEAR, ITOR' and PRES' by it, so the Jacobian sign belongs
// here rather than only on WELL.
const double vp_full = (mercier_intermediate.vp_real[jHo] +
mercier_intermediate.vp_real[jHi]) /
2.0;
2.0 * vmec_internal_results.sign_of_jacobian;
if (vp_full == 0.0) {
// skip this surface
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ TEST_P(MercierStabilityTest, CheckMercierStability) {

const double vp_full = (static_cast<double>(mercier["vp_real"][jHo]) +
static_cast<double>(mercier["vp_real"][jHi])) /
2.0;
2.0 * sign_of_jacobian;

// The running sum advances even on surfaces the assembly skips, and is
// scaled by deltaS only at the end, as the assembly does.
Expand Down
Loading