Skip to content

Commit

Permalink
FEAT: fill corners and moved the function to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjridley committed Apr 1, 2024
1 parent c38c7dc commit b54665e
Showing 1 changed file with 40 additions and 32 deletions.
72 changes: 40 additions & 32 deletions src/exchange_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,43 @@
// near the equator.
// -----------------------------------------------------------------------------


// -----------------------------------------------------------------------------
// This is the main exchange messages for the neutrals.
// We are exchanging densities, temperatures, and velocities
// -----------------------------------------------------------------------------


bool Neutrals::exchange_old(Grid &grid) {

std::string function = "Neutrals::exchange";
static int iFunction = -1;
report.enter(function, iFunction);

bool DidWork = true;
int64_t nGCs = grid.get_nGCs();

for (int iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
if (species[iSpecies].DoAdvect)
DidWork = exchange_one_var(grid, species[iSpecies].density_scgc, false);
}

DidWork = exchange_one_var(grid, temperature_scgc, false);

// velocity components:
// reverse east across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[0], true);
// reverse north across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[1], true);
// don't reverse vertical across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[2], false);

report.exit(function);
return DidWork;
}



// -----------------------------------------------------------------------------
// Pack variables for message passing
// value is variable to pack
Expand Down Expand Up @@ -473,38 +510,6 @@ Grid::messages_struct Grid::make_new_interconnection(int64_t iDir,
return new_inter;
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------


bool Neutrals::exchange_old(Grid &grid) {

std::string function = "Neutrals::exchange";
static int iFunction = -1;
report.enter(function, iFunction);

bool DidWork = true;

for (int iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
if (species[iSpecies].DoAdvect)
DidWork = exchange_one_var(grid, species[iSpecies].density_scgc, false);
}

DidWork = exchange_one_var(grid, temperature_scgc, false);

// velocity components:
// reverse east across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[0], true);
// reverse north across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[1], true);
// don't reverse vertical across the pole:
DidWork = exchange_one_var(grid, velocity_vcgc[2], false);

report.exit(function);
return DidWork;
}


/*
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -994,6 +999,9 @@ bool exchange_one_var(Grid &grid,
var_to_pass = var_scgc;
}

// Now we fill in the corners so that we don't have zero values there:
fill_corners(var_to_pass, nG);

report.exit(function);
return DidWork;
}
Expand Down

0 comments on commit b54665e

Please sign in to comment.