Skip to content

Commit

Permalink
Fix "Make TokamakCoordinates a struct rather than a class"
Browse files Browse the repository at this point in the history
(Need to pass TokamakCoordinates and Mesh to set_tokamak_coordinates_on_mesh(), now that it is a free function).
  • Loading branch information
tomchapman committed Jan 15, 2025
1 parent 6131033 commit 66ab04b
Show file tree
Hide file tree
Showing 17 changed files with 1,621 additions and 1,620 deletions.
2 changes: 1 addition & 1 deletion examples/6field-simple/elm_6f.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ class Elm_6f : public PhysicsModel {
}

/**************** CALCULATE METRICS ******************/
set_tokamak_coordinates_on_mesh(noshear, Lbar, Bbar);
set_tokamak_coordinates_on_mesh(tokamak_coordinates, *mesh, noshear, Lbar, Bbar);

//////////////////////////////////////////////////////////////
// SHIFTED RADIAL COORDINATES
Expand Down
2 changes: 1 addition & 1 deletion examples/conducting-wall-mode/cwm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class CWM : public PhysicsModel {
Te0 /= Te_x;

// Normalise geometry
set_tokamak_coordinates_on_mesh(noshear, rho_s, bmag / 1e4, ShearFactor);
set_tokamak_coordinates_on_mesh(tokamak_coordinates, *mesh, noshear, rho_s, bmag / 1e4, ShearFactor);

// Set nu
nu = nu_hat * Ni0 / pow(Te0, 1.5);
Expand Down
2 changes: 1 addition & 1 deletion examples/constraints/alfven-wave/alfven.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Alfven : public PhysicsModel {
}

auto tokamak_coordinates = TokamakCoordinates(*mesh);
set_tokamak_coordinates_on_mesh(noshear, Lnorm, Bnorm);
set_tokamak_coordinates_on_mesh(tokamak_coordinates, *mesh, noshear, Lnorm, Bnorm);
}
};

Expand Down
2 changes: 1 addition & 1 deletion examples/dalf3/dalf3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class DALF3 : public PhysicsModel {
b0xcv.z *= rho_s * rho_s;

// Metrics
set_tokamak_coordinates_on_mesh(noshear, rho_s, Bnorm);
set_tokamak_coordinates_on_mesh(tokamak_coordinates, *mesh, noshear, rho_s, Bnorm);

SOLVE_FOR3(Vort, Pe, Vpar);
comms.add(Vort, Pe, Vpar);
Expand Down
2 changes: 1 addition & 1 deletion examples/elm-pb-outerloop/elm_pb_outerloop.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ class ELMpb : public PhysicsModel {
if (mesh->get(Lbar, "rmag") != 0) { // Typical length scale
Lbar = 1.0;
}
const auto& metric = tokamak_coordinates.make_coordinates(noshear, Lbar, Bbar);
set_tokamak_coordinates_on_mesh(tokamak_coordinates, *mesh, true, Lbar, Bbar);

auto Bpxy = tokamak_coordinates.Bpxy;
auto hthe = tokamak_coordinates.hthe;
Expand Down
Loading

0 comments on commit 66ab04b

Please sign in to comment.