Skip to content

Rename Mesh::coordinates -> Mesh::getCoordinates; deprecate old name - #1310

Merged
ZedThree merged 2 commits into
v4.2-rcfrom
rename-mesh-coordinates
Oct 16, 2018
Merged

Rename Mesh::coordinates -> Mesh::getCoordinates; deprecate old name#1310
ZedThree merged 2 commits into
v4.2-rcfrom
rename-mesh-coordinates

Conversation

@ZedThree

Copy link
Copy Markdown
Member

While we are polishing things for the release candidate -- renames Mesh::coordinates to Mesh::getCoordinates to be more in line with our naming convention. The old name is deprecated.

I used rtags to rename the symbol, so it got all instances of Mesh::coordinates and not just things named ->coordinates. Some of these could potentially use the fields version, but I couldn't be bothered to go through and check


There's a couple of other quick changes I'd like to make to Mesh::getCoordinates:

  1. change the coords_map.insert(...) to coords_map.emplace(location, createDefaultCoordinates(location));. I'm not 100% sure emplace should be used here. At least, make_pair could be used to remove the type name

  2. Move the throw to the top as a precondition, rather than burying it in the middle of the conditional. Should it always be on, or at CHECK > 1/2/3?

@ZedThree ZedThree added this to the BOUT-4.2 milestone Oct 10, 2018
@d7919

d7919 commented Oct 10, 2018

Copy link
Copy Markdown
Member

I'm sure I've already changed the coordinates routine to use asserts so not sure why it looks like I haven't!

@d7919

d7919 commented Oct 11, 2018

Copy link
Copy Markdown
Member

I'm sure I've already changed the coordinates routine to use asserts so not sure why it looks like I haven't!

Ah yes, in #1293 (not yet merged) https://github.com/boutproject/BOUT-dev/blob/vecops-consistent-cell-default/include/bout/mesh.hxx#L433

@d7919

d7919 commented Oct 11, 2018

Copy link
Copy Markdown
Member

As this touches a lot of files we might want to hold this until all other changes are into the rc?

@d7919

d7919 commented Oct 11, 2018

Copy link
Copy Markdown
Member

2. Move the throw to the top as a precondition, rather than burying it in the middle of the conditional. Should it always be on, or at CHECK > 1/2/3?

I don't think it should always be on as we have a large number of these calls throughout the code.

@ZedThree

Copy link
Copy Markdown
Member Author

Yes, probably hold off on merging this till the other PRs are in.

@d7919
d7919 requested a review from bendudson October 15, 2018 11:45
bendudson
bendudson previously approved these changes Oct 15, 2018
* v4.2-rc: (58 commits)
  Invert conditional in Div_par and Div_par_flux
  Make test-yupdown work with new test for TwistShift=true
  Check TwistShift==true in ShiftedMetric
  Remove output location from Curl properly
  Fix whitespace in vecops header
  Deprecate Curl overloads that take a location
  Fix locations of Jacobian in Div
  Set yup/ydown fields for Div_par_flux()
  Use curly braces with if statements
  Fix V_dot_Grad documentation
  Use std::map::emplace to avoid naming complicated type with insert
  Add method argument to Grad2_par2
  Remove const on arguments passed by value
  Remove bracket_location() function, replace with ASSERT1
  Tidying up more location setting in derivatives
  Remove unnecessary interp_to in Grad2_par2
  Make mesh::getRegion?? const
  Add const(_iterator) overload of Region::begin/end
  Provide `getRegion` method on Fields to return the requested Region from fieldmesh
  Fix some sphinx whitespace/code blocks
  ...
@ZedThree

Copy link
Copy Markdown
Member Author

This is good to go in now -- all other PRs have been resolved. Last commit just fixed the conflicts

@ZedThree
ZedThree merged commit 7516b23 into v4.2-rc Oct 16, 2018
@ZedThree
ZedThree deleted the rename-mesh-coordinates branch October 16, 2018 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants