Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include all boundary cells in GlobalNy #1829

Merged
merged 9 commits into from
Nov 5, 2019
Merged

Include all boundary cells in GlobalNy #1829

merged 9 commits into from
Nov 5, 2019

Conversation

johnomotani
Copy link
Contributor

The GlobalNx, GlobalNy variables include boundary cells, but previously GlobalNy only included boundary cells from one divertor. If a second divertor boundary is present, the guard cells from there should also be included. This change makes GlobalNy consistent with getGlobalYIndex in the sense that on the last processor getGlobalYIndex(LocalNy) == GlobalNy always.

The lines setting the global grid sizes are moved below those getting the separatrix/X-point locations just so that setting GlobalNy can use jyseps2_1 and jyseps1_2 - the other lines are not changed.

The `GlobalNx`, `GlobalNy` variables include boundary cells, but previously `GlobalNy` only included boundary cells from one divertor. If a second divertor boundary is present, the guard cells from there should also be included. This change makes `GlobalNy` consistent with `getGlobalYIndex` in the sense that on the last processor `getGlobalYIndex(LocalNy) == GlobalNy` always.
@johnomotani johnomotani added the small-change Changes less than 100 lines - should be quick to review label Oct 30, 2019
@johnomotani johnomotani force-pushed the globalny-fix branch 2 times, most recently from 7351f6d to e13ce3b Compare November 3, 2019 22:49
Allows calculating the number of boundary cells in the global y-grid.
After changing defition of GlobalNy, need to update its uses.

Vol_Integral() seems to have been incorrect previously, since it used a
number of points including boundary cells to weight the integral.
Error in conditional meant method returned the wrong result.
The correct value for the total number of y-boundary cells is
mesh.numberOfYBoundaries()*2*mesh.ystart
As there are two boundaries (upper and lower) containing mesh.ystart
cells each for each boundary.

Previously the factor of 2 was missed in several places in the recent
re-definition of GlobalNy. The use in Vol_Integral was missing a factor
of mesh.ystart as well.
@johnomotani
Copy link
Contributor Author

The Travis tests are not completing because they time out when test-initial is trying to run on 3 processors (the 1 and 2 processor cases run and pass). The test only takes a few seconds on my laptop which only has 2 physical cores, and looks like it used to take ~30s on Travis (looking at the last commit on master). I also don't think this PR should particularly affect the test. Has Travis changed something??

@ZedThree
Copy link
Member

ZedThree commented Nov 4, 2019

Not to my knowledge. The same tests work fine on other builds. I'll have a look on my machine now

@ZedThree
Copy link
Member

ZedThree commented Nov 4, 2019

Works on my machine too, so must be something about travis. Will investigate further this afternoon

GlobalNx is used as the default for ixseps1 and ixseps2 so needs to be
initialised first, while GlobalNy uses jyseps1_2 and jyseps2_1 so does
need to be initialised after the separatrix positions are loaded.
An identical check is already performed above the one removed in this
commit.
src/field/globalfield.cxx Outdated Show resolved Hide resolved
@ZedThree
Copy link
Member

ZedThree commented Nov 5, 2019

Please can you add a section at the top of CHANGELOG.md like so:

# Change Log

## [v5.0.0-alpha](https://github.com/boutproject/BOUT-dev/tree/next) 
[Full Changelog](https://github.com/boutproject/BOUT-dev/compare/v4.3.0...next)

### Breaking changes

- `BoutMesh::GlobalNy` now counts points from all
  y-boundaries. Previously it only counted points from one boundary
  [\#1829](https://github.com/boutproject/BOUT-dev/pull/1829)

@johnomotani johnomotani added the breaking change Introduces a change that is not backward compatible with the previous major version label Nov 5, 2019
@ZedThree ZedThree merged commit c52eba6 into next Nov 5, 2019
@ZedThree ZedThree deleted the globalny-fix branch November 5, 2019 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Introduces a change that is not backward compatible with the previous major version small-change Changes less than 100 lines - should be quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants