Skip to content

Commit 75e8ae7

Browse files
committed
BUG: fixed bcs
1 parent d2c7003 commit 75e8ae7

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/advance.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ bool advance(Planets &planet,
117117
if (didWork)
118118
didWork = neutralsMag.set_bcs(mGrid, time, indices);
119119

120-
if (didWork)
121-
didWork = ionsMag.set_bcs(mGrid, time, indices);
120+
//if (didWork)
121+
// didWork = ionsMag.set_bcs(mGrid, time, indices);
122122

123123
didWork = neutralsMag.check_for_nonfinites("Ion Grid: set bcs");
124124

@@ -129,7 +129,7 @@ bool advance(Planets &planet,
129129
if (didWork & input.get_check_for_nans())
130130
didWork = neutrals.check_for_nonfinites("After Vertical Neutral Advection");
131131

132-
// ajr - ions.advect_vertical(gGrid, time);
132+
ions.advect_vertical(gGrid, time);
133133

134134
if (didWork & input.get_check_for_nans())
135135
didWork = ions.check_for_nonfinites("After Vertical Ion Advection");
@@ -143,7 +143,7 @@ bool advance(Planets &planet,
143143
if (didWork & input.get_check_for_nans())
144144
didWork = neutralsMag.check_for_nonfinites("After Vertical Neutral Advection");
145145

146-
// ajr - ionsMag.advect_vertical(mGrid, time);
146+
ionsMag.advect_vertical(mGrid, time);
147147

148148
if (didWork & input.get_check_for_nans())
149149
didWork = ionsMag.check_for_nonfinites("After Vertical Ion Advection");

src/ions_bcs.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ bool Ions::set_lower_bcs(Grid &grid, Times time, Indices indices) {
125125

126126
// This is true for all grids:
127127
for (iX = 0; iX < nX; iX++) {
128-
for (int iY = 0; iY < nY; iY++) {
128+
for (iY = 0; iY < nY; iY++) {
129129
iFirst = grid.first_lower_gc(iX, iY);
130130

131131
for (iAlt = iFirst; iAlt >= 0; iAlt--) {
132132
// Bulk Quantities:
133-
temperature_scgc.slice(iAlt) = temperature_scgc.slice(iFirst + 1);
133+
temperature_scgc(iX, iY, iAlt) = temperature_scgc(iX, iY, iFirst + 1);
134134

135135
// For each species:
136136
for (int iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
137137
// assign all species temperatures the bulk temperature:
138-
species[iSpecies].temperature_scgc.slice(iAlt) =
139-
temperature_scgc.slice(iAlt);
138+
species[iSpecies].temperature_scgc(iX, iY, iAlt) =
139+
temperature_scgc(iX, iY, iAlt);
140140
// Assume each species falls off a bit.
141141
// this BC shouldn't matter, since the bottom of the code
142142
// should be in chemical equalibrium:
143-
species[iSpecies].density_scgc.slice(iAlt) =
144-
0.95 * species[iSpecies].density_scgc.slice(iFirst + 1);
143+
species[iSpecies].density_scgc(iX, iY, iAlt) =
144+
0.95 * species[iSpecies].density_scgc(iX, iY, iFirst + 1);
145145
}
146146
}
147147
}
@@ -158,8 +158,8 @@ bool Ions::set_lower_bcs(Grid &grid, Times time, Indices indices) {
158158

159159
if (grid.setNorthAsDown) {
160160
// First physical cell:
161-
iFirst = nY - nGCs - 2;
162-
iYs = nY - nGCs - 1;
161+
iFirst = nY - nGCs - 1;
162+
iYs = nY - nGCs;
163163
iYe = nY;
164164
}
165165

0 commit comments

Comments
 (0)