Skip to content

Commit

Permalink
Bxy has to be of type Field2D, so get from TokamakCoordinatesFactory …
Browse files Browse the repository at this point in the history
…object
  • Loading branch information
tomchapman committed Nov 10, 2024
1 parent 9417099 commit 680498a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/elm-pb-outerloop/elm_pb_outerloop.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ class ELMpb : public PhysicsModel {
int damp_width; // Width of inner damped region
BoutReal damp_t_const; // Timescale of damping

TokamakCoordinatesFactory tokamak_coordinates_factory = TokamakCoordinatesFactory(*mesh);

const BoutReal MU0 = 4.0e-7 * PI;
const BoutReal Mi = 2.0 * 1.6726e-27; // Ion mass
const BoutReal Me = 9.1094e-31; // Electron mass
Expand Down Expand Up @@ -704,7 +706,6 @@ class ELMpb : public PhysicsModel {
Dphi0 *= -1;
}

auto tokamak_coordinates_factory = TokamakCoordinatesFactory(*mesh);
const auto& metric = tokamak_coordinates_factory.make_tokamak_coordinates();

V0 = -tokamak_coordinates_factory.get_Rxy() * tokamak_coordinates_factory.get_Bpxy() * Dphi0 / tokamak_coordinates_factory.get_Bxy();
Expand Down Expand Up @@ -1522,7 +1523,7 @@ class ELMpb : public PhysicsModel {
auto P0_acc = Field2DAccessor<>(P0);
auto J0_acc = Field2DAccessor<>(J0);
auto phi0_acc = Field2DAccessor<>(phi0);
FieldMetric Bxy = metric->Bxy();
const Field2D& Bxy = tokamak_coordinates_factory.get_Bxy();
auto B0_acc = Field2DAccessor<>(Bxy);

// Evolving fields
Expand Down

0 comments on commit 680498a

Please sign in to comment.