-
Notifications
You must be signed in to change notification settings - Fork 111
Require Mesh::addCoordinates(location) to initialize Coordinates at location #1392
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
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bdb56d8
Use localmesh for d2x and d2y, and interpolate them to location
johnomotani 8795aca
Remove uses of global 'mesh' in BoutMesh::addBoundaryRegions()
johnomotani 21a0fc5
Allow initialization of Coordinates with Mesh::addCoordinates(location)
johnomotani f528e6a
Add nullptr entries to coords_map in FakeMesh of unit tests
johnomotani 85e054d
Allow initialization of Coordinates with Mesh::addCoordinates(location)
johnomotani b93a956
Require use of Mesh::addCoordinates(location)
johnomotani d5675d2
Add Mesh::addCoordinates(location) calls in tests
johnomotani 73480c4
Update examples/staggered_grid
johnomotani cc0c57d
Update manual with addCoordinates
johnomotani 9f6f9c4
Update boutcore with getCoordinates and addCoordinates
johnomotani 5353de5
Fix MMS tests
johnomotani b9ae93d
Test addCoordinates in BoutMeshTest
johnomotani c2a6fcc
Call addCoordinates in tests/integrated/test-boutcore/collect-staggered
johnomotani 1495a35
Tidy up Mesh::addCoordinates()
johnomotani 0f5ebf4
Use defaultwarn("...") rather than print("Warning ...")
johnomotani 755ce75
Make allow_geometry_without_recalculate_staggered argument not option
johnomotani 6444206
Use getMesh() instead of fieldmesh in check for Coordinates
johnomotani 53f780a
Merge remote-tracking branch 'origin/next' into getCoordinates_fix-next
johnomotani 032b4fd
Use make_unique for Coordinates
johnomotani b5b80f2
Fix error message, replacing reference to 'REQUEST_STAGGER'
johnomotani 0bf16af
Remove createDefaultCoordinates() method from header
johnomotani 75ce522
Revert change of Mesh::coords_map to use std::unique_ptr
johnomotani b999f3c
Merge branch 'getCoordinates_fix' into getCoordinates_fix-next
johnomotani c8b4dd5
Use std::unique_ptr for Mesh::coords_map
johnomotani 2452c52
Remove allow_geometry_without_recalculate_staggered from Mesh
johnomotani d9efb73
Merge branch 'next' into getCoordinates_fix-next
johnomotani 4c58b83
Fix FakeMesh::setCoordinates() for std::unique_ptr
johnomotani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ MZ = 1 | |
|
|
||
| grid = "test-staggered.nc" | ||
|
|
||
| [mesh] | ||
|
|
||
| StaggerGrids = true | ||
|
|
||
| [mesh:ddy] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,9 @@ timestep = 0.02 | |
|
|
||
| MZ = 1 | ||
|
|
||
| [mesh] | ||
| StaggerGrids = true | ||
|
|
||
| [mesh] | ||
| nx = 5 | ||
| ny = 16 | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about changing this to
unique_ptr. I know we currently hand out a raw pointer, but that should change, and returning aunique_ptrsays "I'm giving ownership over to you", whereas ashared_ptrsays "You can have a look at this, but I will keep hold of it too"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought in changing to
unique_ptrit was that theMeshobject should keep ownership of theCoordinatesobjects, and not share ownership (since there is no point keeping theCoordinatesafter theMeshhas been deleted anyway). I'm having trouble finding much discussion, but see e.g. https://www.reddit.com/r/cpp/comments/6dyq6l/is_it_alright_to_return_raw_pointer_from_unique/. Maybe raw pointer is OK, or we could return reference?