Skip to content

Commit

Permalink
Update more tests to use Bxy setter.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchapman committed Nov 22, 2023
1 parent 4444a24 commit 3e52360
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/conducting-wall-mode/cwm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class CWM : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

// 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 @@ -183,7 +183,7 @@ class Alfven : public PhysicsModel {

Bpxy /= Bnorm;
Btxy /= Bnorm;
coord->Bxy() /= Bnorm;
coord->setBxy(coord->Bxy() / Bnorm);

// Check type of parallel transform
std::string ptstr =
Expand Down
2 changes: 1 addition & 1 deletion examples/em-drift/2fluid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class EMdrift : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

/**************** CALCULATE METRICS ******************/

Expand Down
2 changes: 1 addition & 1 deletion examples/lapd-drift/lapd_drift.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class LAPDdrift : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

// calculate pressures
pei0 = (Ti0 + Te0) * Ni0;
Expand Down
2 changes: 1 addition & 1 deletion examples/laplacexy/alfven-wave/alfven.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Alfven : public PhysicsModel {

Bpxy /= Bnorm;
Btxy /= Bnorm;
coord->Bxy() /= Bnorm;
coord->setBxy(coord->Bxy() / Bnorm);

// Calculate metric components
sinty = 0.0; // I disappears from metric for shifted coordinates
Expand Down
10 changes: 5 additions & 5 deletions examples/reconnect-2field/2field.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class TwoField : public PhysicsModel {
// Normalise magnetic field
Bpxy /= Bnorm;
Btxy /= Bnorm;
coord->Bxy() /= Bnorm;
coord->setBxy(coord->Bxy() / Bnorm);

// Plasma quantities
Jpar0 /= Nenorm * Charge * Cs;
Expand Down Expand Up @@ -273,10 +273,10 @@ class TwoField : public PhysicsModel {
ddt(U) = SQ(coord->Bxy()) * Grad_parP(jpar / coord_ylow->Bxy(), CELL_CENTRE);

if (include_jpar0) {
ddt(U) -=
SQ(coord->Bxy()) * beta_hat
* interp_to(bracket(Apar + Apar_ext, Jpar0 / coord_ylow->Bxy(), BRACKET_ARAKAWA),
CELL_CENTRE);
ddt(U) -= SQ(coord->Bxy()) * beta_hat
* interp_to(
bracket(Apar + Apar_ext, Jpar0 / coord_ylow->Bxy(), BRACKET_ARAKAWA),
CELL_CENTRE);
}

ddt(U) -= bracket(Phi0_ext, U, bm); // ExB advection
Expand Down
2 changes: 1 addition & 1 deletion examples/shear-alfven-wave/2fluid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ShearAlfven : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

// calculate pressures
pei0 = (Ti0 + Te0) * Ni0;
Expand Down
2 changes: 1 addition & 1 deletion examples/tokamak-2fluid/2fluid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class TwoFluid : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

// calculate pressures
pei0 = (Ti0 + Te0) * Ni0;
Expand Down
2 changes: 1 addition & 1 deletion tests/integrated/test-drift-instability/2fluid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class TwoFluid : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

// calculate pressures
pei0 = (Ti0 + Te0) * Ni0;
Expand Down
8 changes: 3 additions & 5 deletions tests/integrated/test-interchange-instability/2fluid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Interchange : public PhysicsModel {
// Normalise magnetic field
Bpxy /= (bmag / 1.e4);
Btxy /= (bmag / 1.e4);
coord->Bxy() /= (bmag / 1.e4);
coord->setBxy(coord->Bxy() / (bmag / 1.e4));

/**************** CALCULATE METRICS ******************/

Expand All @@ -146,8 +146,7 @@ class Interchange : public PhysicsModel {
g12 = 0.0;
g13 = -I * coord->g11();
g23 = -Btxy / (hthe * Bpxy * Rxy);
coord->setContravariantMetricTensor(
MetricTensor(g11, g22, g33, g12, g13, g23));
coord->setContravariantMetricTensor(MetricTensor(g11, g22, g33, g12, g13, g23));

coord->setJ(hthe / Bpxy);

Expand All @@ -158,8 +157,7 @@ class Interchange : public PhysicsModel {
g_12 = Btxy * hthe * I * Rxy / Bpxy;
g_13 = I * Rxy * Rxy;
g_23 = Btxy * hthe * Rxy / Bpxy;
coord->setCovariantMetricTensor(
MetricTensor(g_11, g_22, g_33, g_12, g_13, g_23));
coord->setCovariantMetricTensor(MetricTensor(g_11, g_22, g_33, g_12, g_13, g_23));

coord->geometry();

Expand Down

0 comments on commit 3e52360

Please sign in to comment.