-
Notifications
You must be signed in to change notification settings - Fork 103
Refactor coordinates #2873
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
Open
tomc271
wants to merge
516
commits into
next
Choose a base branch
from
refactor-coordinates
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor coordinates #2873
Changes from 250 commits
Commits
Show all changes
516 commits
Select commit
Hold shift + click to select a range
6528658
Make non_uniform private.
tomchapman 3b3915e
Remove call to calculateGeometry() after setting metric tensor quanti…
tomchapman 05ea951
Clang-Tidy: Constructors that are callable with a single argument mus…
tomchapman 46a11ae
Make ShiftTorsion and IntShiftTorsion private.
tomchapman 62d19fb
Clang-Tidy: Pass by value and use std::move().
tomchapman 331eb1e
Rename calculateGeometry() to communicateAndCheckMeshSpacing().
tomchapman 31c7640
Remove comments referring to obsolete method Coordinates::calculateGe…
tomchapman 6fe1813
Extract class ChristoffelSymbols.
tomchapman 2cf9453
Error handling: null check in Mesh::sourceHasYBoundaryGuards().
tomchapman 3ccd720
Add a constructor for ChristoffelSymbols that takes no Mesh (because …
tomchapman 83c5d72
Make 'function' parameter to map() and applyToComponents() methods a …
tomchapman 8c06cd1
Make parameters to metric tensor setters const references.
tomchapman b8e192d
Rename getters (and private fields) for metric tensor components.
tomchapman aa42c9f
Clang-Tidy: Pass by value and use std::move().
tomchapman e44f1b7
Clang-Tidy: Pass by value and use std::move().
tomchapman 721479d
Clang-Tidy: Single-argument constructors must be marked explicit to a…
tomchapman 0d5c250
Remove redundant 'mesh' parameter from Geometry constructor.
tomchapman 046a7ad
Formatting.
tomchapman f2dc950
Remove Geometry class, as now redundant.
tomchapman 88e18b6
Corrected comment.
tomchapman 0460b04
Need to call setter directly on contravariantMetricTensor and covaria…
tomchapman 0c65aed
Ensure covariantMetricTensor is set.
tomchapman aa03305
Don't pass mesh to ChristoffelSymbols constructor in the Coordinates …
tomchapman 25399d7
Null check differential_operators in ChristoffelSymbols constructor.
tomchapman 3d81700
Ensure covariantMetricTensor is set.
tomchapman e8065ab
Pass (a reference to) Coordinates to CalculateChristoffelSymbols(), r…
tomchapman 35402dd
Use same pattern as for invSg for lazy evaluation of Coordinates::chr…
tomchapman 8f326fc
christoffel_symbols() return type should be reference.
tomchapman fad98bc
Remove unused ChristoffelSymbols constructor.
tomchapman 1cc67e4
G1, G2, G3 not part of christoffel symbols.
tomchapman 99683e4
interpolateAndExtrapolate G1, G2, G3.
tomchapman 12cdafe
Prefer const.
tomchapman ecd60c9
Tidy.
tomchapman e08bd11
Refactor.
tomchapman f87f834
Formatting.
tomchapman f54a3e4
Refactor method 'setBoundaryCells' (remove getting dx and dy from the…
tomchapman 529c253
Renaming to distinguish between 'options' variables.
tomchapman 937094e
Make CalculateChristoffelSymbols() method just another ChristoffelSym…
tomchapman 5f5d892
Extract variables for metric tensor components.
tomchapman f934687
Simplify case switching (reduce nesting) in Coordinates::setParallelT…
tomchapman f29ff3d
Extract method getDzFromOptionsFile().
tomchapman 58c21eb
Remove 'getAtLoc' function overload that updates an in/out variable, …
tomchapman 4f45142
Remove redundant initialisation of IntShiftTorsion, as it will alread…
tomchapman 47666d0
Remove method 'getUnalignedAtLocationAndFillGuards'.
tomchapman 44c87b3
Use member variables 'localmesh' and 'nz' in methods, rather than pas…
tomchapman cb86bd3
Rename private field J_ to jacobian_cache.
tomchapman 888317e
Don't recalculate Jacobian and Bxy if read from file.
tomchapman 9ffee2c
Don't recalculate Bxy if read from file.
tomchapman 1bc3d8f
DRY - use existing method recalculateBxy().
tomchapman 033c5df
Make recalculateBxy() const.
tomchapman e7ae4f3
No need to recalculate Bxy twice.
tomchapman 2a3358f
Use extrapolate_x, extrapolate_y options if set.
tomchapman b08a27c
Reduce code duplication by moving call to interpolateAndExtrapolate()…
tomchapman 34e6e37
Refactor to use sourceHasVar() and getAtLoc() for IntShiftTorsion, as…
tomchapman 12423e2
No need to assign to a local variable before setting property.
tomchapman 0ba9c00
Make jacobian_cache a std::unique_ptr.
tomchapman 81b83e4
Bug fix: update existing value of jacobian when setting for specific …
tomchapman f9ec8dc
Remove ShiftTorsion setter (to avoid problems with it not being initi…
tomchapman b7ac99b
Extract class GValues to encapsulate G1, G2, G3 (needs renaming when …
tomchapman 5538632
Extract methods Coordinates::communicateGValues() and Coordinates::ex…
tomchapman e254b98
Remove redundant MetricTensor::Allocate() method.
tomchapman 9ef7b74
Fix additional strings after renaming "MetricTensor::CalculateOpposit…
tomchapman 14887ff
Define two derived classes CovariantMetricTensor and CovariantMetricT…
tomchapman bb34560
Revert extracted functions on DifferentialOperators for those that ar…
tomchapman fb2266f
Fully revert extracting differential operator methods from Coordinate…
tomchapman 4ba9669
Move trivial getters and setters of Coordinates class to header file.
tomchapman c14070a
Move trivial getters and setters of ChristoffelSymbols class to heade…
tomchapman e8d5a7e
Move trivial getters and setters of GValues class to header file.
tomchapman 5ee546b
Move trivial getters and setters (and setLocation() method) of Metric…
tomchapman 49378cd
No need to pre-assign values to explanatory variables before using to…
tomc271 f4cbb8c
Remove obsolete inverse() and jacobian() in boutcpp.pxd.jinja file.
tomchapman 1293ff6
Restore semicolons after macros.
tomchapman 8a003ef
Remove redundant `const`.
tomchapman 315d739
Fix MetricTensor::inverse method (it was replacing each metric compon…
tomchapman eb58344
Restore commented-out code (Maximum error in diagonal/off-diagonal in…
tomchapman c1246bd
Use 'auto' when type name is obvious.
tomchapman b371136
Clang-tidy: "Use auto when initialising with a template cast to avoid…
tomchapman de146f1
Bug fix: Don't specify region when setting contravariant metric tenso…
tomchapman 7ad4b39
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman d1516db
Update petsc cases to use new getters.
tomchapman 518672d
Remove calls to geometry().
tomchapman cf6df73
Set death_test_style to "threadsafe", to prevent timeout.
tomchapman 3cddd46
Add [[maybe_unused]] attribute to 'J' parameter in Coordinates constr…
tomchapman 99751c6
Revert expansion of COPY_STRIPE macro.
tomchapman 5d0a696
Remove redundant function 'ChristoffelSymbols::map' (instead just cal…
tomchapman 15815f4
Revert "Minor fixes."
tomchapman b8a2158
Apply clang-format changes
tomc271 c46d0ab
More updates to examples and tests to use dx setter.
tomchapman 550a42d
Merge remote-tracking branch 'remotes/boutproject/refactor-coordinate…
tomchapman 9466334
Rename file MetricTensor to use snake case.
tomchapman 031fb4b
Updated another example (gravity_reduced) to use new metric tensor se…
tomchapman d259faf
Apply clang-format changes
tomc271 ad36b89
Remove obsolete comment.
tomchapman e7bdfcf
Make jacobian setter take a const reference.
tomchapman 2e46100
Call communicateAndCheckMeshSpacing() in ChristoffelSymbols construct…
tomchapman 92aaaa1
Remove unused #include.
tomchapman 9adbfda
Clang-Tidy: Single-argument constructors must be marked explicit to a…
tomchapman 62dcf21
Remove unused #include directives.
tomchapman 77231a6
Prefer const.
tomchapman 0235449
Add [[maybe_unused]] attributes.
tomchapman c967204
More unused #include directives.
tomchapman 2718250
Clang-Tidy: The 'empty' method should be used to check for emptiness …
tomchapman c7b70a9
More [[maybe_unused]] attributes.
tomchapman 07078ed
Clang-Tidy: Method can be made static.
tomchapman 363223a
Clang-Tidy: Constructors that are callable with a single argument mus…
tomchapman 1d36429
Another unused #include directive.
tomchapman 9e651aa
More [[maybe_unused]] attributes and unused #include directives.
tomchapman ac9cad6
Use std::move() for constructor parameters.
tomchapman 0dfafd4
More unused #include directives.
tomchapman 7348598
Merge branch 'clang-tidy' into refactor-coordinates
tomchapman 53b181e
No need to communicateAndCheckMeshSpacing() after creating Coordinates.
tomchapman 1624876
Revert "Move interpolateAndExtrapolate() to Mesh class."
tomchapman 5c1e0f5
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman e998baa
Fix using FieldMetric = Field3D.
tomchapman b50a5e2
Fix Field3D Coordinates::interpolateAndExtrapolate method.
tomchapman 1786e04
Add 3D version of setDy() for the BOUT_USE_METRIC_3D case.
tomchapman a837b72
d2z can't be const to work with Mesh::get().
tomchapman 9966161
Update BOUT_USE_METRIC_3D case to use metric tensor getters.
tomchapman e7a8e77
Return type of Grad_par() and Vpar_Grad_par() should be FieldMetric, …
tomchapman 4c33d86
Add 3D version of setJ() for the BOUT_USE_METRIC_3D case.
tomchapman 44dff02
Return type of the std::function parameter to MetricTensor::map shoul…
tomchapman b46795e
Return type of Mesh::get() should be FieldMetric, not Field2D
tomchapman 164660a
Bug fix: Mesh::get() should return a Field3D in the BOUT_USE_METRIC_3…
tomchapman 4e296bd
Merge branch 'fix-for-3d' into refactor-coordinates
tomchapman 3b09a2d
Fix updating of Bxy by splitParallelSlices().
tomchapman 3e03b76
Fix updating of Bxy yup and ydown.
tomchapman e551211
Fix updating of Bxy by splitParallelSlices().
tomchapman 3642d69
Fix updating of Bxy yup and ydown.
tomchapman a03362a
Merge branch 'fix-for-3d' into refactor-coordinates
tomchapman 9df8bf8
G1, G2, G3 are now calculated in the GValues constructor, so no need …
tomchapman 002539f
Remove call to obsolete method coords._setmembers().
tomchapman 459e598
Refactoring to DRY up Mesh::createDefaultCoordinates().
tomchapman ce2066b
Add new coordinates object to coords_map before calling recalculateAn…
tomchapman a0fc687
Improve exception handling - ensure that transform is not null before…
tomchapman 968497e
Ensure transform is set even when Coordinates is instantiated with th…
tomchapman cefb4ee
Need to ensure parallel transform is set before differential operator…
tomchapman b68f69d
Don't setLocation() of dz at this point, to avoid ASSERT1_FIELDS_COMP…
tomchapman dd0ee5c
Reorder to put the variable closer to its point of use.
tomchapman 2ea7e27
Fix type of dJ_dy in LaplaceHypre3d::updateMatrix3D() (3D not 2D).
tomchapman c0b4e04
Disable "Laplacian solver in 2D (X-Y)" for the BOUT_USE_METRIC_3D case.
tomchapman cee7596
Fix test-laplacexz: Use a non-zero value for off-diagonal components …
tomchapman 6232eb4
Apply clang-format changes
tomc271 9498ae1
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman 59faafd
Merge branch 'next' into refactor-coordinates
tomchapman 17f7097
include <functional>
10d0fdb
Add Coordinates::setMetricTensor() method for setting both co- and co…
tomchapman 834f11a
Call Mesh::communicate() rather than Coordinates::communicate() when …
tomchapman e045f2e
Add a version of Mesh::communicate<T>() that takes const-qualified pa…
tomchapman 5ced89d
Allow FieldGroup to take const-qualified parameters.
tomchapman 2f7a6af
Add a version of Coordinates::communicate<T>() that takes const-quali…
tomchapman 22a6341
Replace variadic template with two methods: void communicate(const Fi…
tomchapman 27b461b
This fixes the failure of tests `NotConstructableFromInt` and `NotCon…
tomchapman b53d092
Various Clang-Tidy suggestions.
tomchapman f1216b1
Do the copying in the method that calls communicate(), so that the co…
tomchapman 736198b
Do the copying in the method that calls Mesh::communicate(), so that …
tomchapman b308f6c
Merge branch 'communicate-const-qualified' into refactor-coordinates
tomchapman 3d17795
Add MetricTensor::communicate() method, since need to pass a non-cons…
tomchapman 550c38f
Add ChristoffelSymbols::communicate() method.
tomchapman 47017c6
Pass (const refs to) the actual d1_dx, d1_dy, d1_dz data to localmesh…
tomchapman fdc6c28
Add GValues::communicate() method.
tomchapman 896a610
Remove redundant methods Coordinates::communicateChristoffelSymbolTer…
tomchapman 545ede8
Coordinates::communicate() method needs to take a non-const parameter…
tomchapman e7df6bc
Fix copy-paste errors introduced during refactoring.
tomchapman 04c9399
Restore #include "impls/bout/boutmesh.hxx"
tomchapman c703dd3
Merge branch 'communicate-fix' into fx01
tomchapman 8194863
Revert "More [[maybe_unused]] attributes."
tomchapman 3ce726c
Revert "Add [[maybe_unused]] attributes."
tomchapman 53622ec
Revert "Prefer const."
tomchapman 8650f4f
Add test CheckCovariantCalculatedFromContravariant to CoordinatesTest…
tomchapman d32f7a6
Add test CheckContravariantCalculatedFromCovariant to CoordinatesTest…
tomchapman fb181e9
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman 45abd74
Use new method Coordinates::setMetricTensor() when manually setting b…
tomchapman 357601d
Define local variables on assignment (and using auto).
tomchapman e713a5e
Prefer const.
tomchapman 1ad60a6
Fix copy-paste errors introduced during refactoring (more).
tomchapman de8abf3
Define local variables on assignment (and using auto).
tomchapman 3928562
Revert "Clang-Tidy: Constructors that are callable with a single argu…
tomchapman 3f4abe0
Revert "Use std::move() for constructor parameters."
tomchapman 49deb09
Revert "Another unused #include directive."
tomchapman bf5e9e9
Revert "Clang-Tidy: Single-argument constructors must be marked expli…
tomchapman ec6b7d3
Revert "Remove redundant semicolons."
tomchapman 68fa3a4
Revert "More [[maybe_unused]] attributes."
tomchapman e3cb84e
Revert "More unused #include directives."
tomchapman 3d293c4
Revert "Clang-Tidy: The 'empty' method should be used to check for em…
tomchapman 64ed06e
Apply clang-format changes
tomc271 5ff4df3
Restore semicolons after macros.
tomchapman 187c081
Revert accidental renaming in docs.
tomchapman e5d1c77
Revert "Clang-Tidy: Method can be made static."
tomchapman 12e769c
Revert "More unused #include directives."
tomchapman b692beb
Clang-Tidy: Static member accessed through instance.
tomchapman 804d77a
Clang-Tidy: variable can be declared 'const'.
tomchapman ae29dc8
Apply clang-format changes
tomc271 77896a3
Rename setBoundaryCells() to readFromMesh(), and interpolateFieldsFro…
tomchapman 7c68462
Bug fix: can't assign to a const ref - Use a temporary variable with …
tomchapman 69eee97
Remove const qualifier from declaration of temporary copy of Bxy.
tomchapman 541ff17
x, y, z are accessed through getters on BoundaryRegionPar.
tomchapman ec1e0ac
Bug fix: can't assign to a const ref - Use a temporary variable with …
tomchapman 67e4c3d
Define local variables on assignment (and using auto).
tomchapman 2e88073
Explicity setting the jacobian has to come after setting the metric t…
tomchapman 33111b3
Apply clang-format changes
tomc271 2dfdb42
Add overload getters for dx, dy, and dz, that give the value at a par…
4c2a1d1
Use overloaded getters for dx, dy, and dz.
tomchapman dc2b0c3
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman a5157ce
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman fa24eb8
Add overloaded getters for d1_dx, d1_dy, and d1_dz, that give the val…
tomchapman 541da12
The (x, y) indexing methods return a pointer when BOUT_USE_METRIC_3D …
tomchapman a2b9584
Add overloaded getters for metric tensor components, that give the va…
tomchapman 4fb48ba
Use overloaded getters for metric tensor components.
tomchapman 7041398
Getters for metric tensor components given (x, y) indices.
tomchapman f2e01ab
The (x, y) indexing methods return a pointer when BOUT_USE_METRIC_3D …
tomchapman 35d0912
Disable metric tensor getter with (x, y) arguments when BOUT_USE_METR…
tomchapman 4852b00
Use overloaded getters for metric tensor components.
tomchapman dca8598
Improve readability of preprocessor directive
tomchapman 078a51b
Add overloaded getter for IntShiftTorsion that gives the value at a p…
tomchapman f49eb92
Add overloaded getter for J() that gives the value at a particular x,…
tomchapman 8ad42cc
Add overloaded getter for zlength() that gives the value at a particu…
tomchapman 10bf54a
Add overloaded getters for G1, G2, G3, that give the value at a parti…
tomchapman 3d8198f
Apply clang-format changes
tomc271 cbce1b4
Revert "x, y, z are accessed through getters on BoundaryRegionPar."
ZedThree fa6663d
Fix clang-tidy const-correctness warnings
ZedThree c85f2ad
Merge branch 'next' into refactor-coordinates
ZedThree 5b61d2b
Rename metric tensor component members
ZedThree e2d3c52
Use `std::array` instead of C array
ZedThree 687f0c4
Fix some clang-tidy warnings in metric_tensor
ZedThree 2411ab2
Reduce duplication in metric tensor between 2D/3D metric a little
ZedThree 1213035
Inline metric tensor function application `map`
ZedThree e5010e4
Use free-function derivatives in metric tensor classes
ZedThree a926df1
Remove some unused ctors from metric tensor classes
ZedThree ff3fdef
Ensure metric derivatives are always communicated
ZedThree 676f0a0
Remove `MetricTensor::setLocation`
ZedThree ff12e4a
Pull out duplicated region name
ZedThree 8a1d040
Remove specialised `setDy`, `setJ` overloads
ZedThree 0663ea8
Ensure grid spacings, Bxy, J, are always communicated
ZedThree a4fe574
Ensure metric terms are always communicated
ZedThree b276d74
Simplify `recalculateJacobian` a little
ZedThree 61196bf
Eliminate some unnecessary local variables
ZedThree 42dc6ee
Inline some single-use functions
ZedThree 47cff9e
Fix wrong type in MMS/gbs
ZedThree 15cffda
Set coordinates on FakeMesh
tomchapman 6c69d6a
Add optional boolean parameter `communicate` to Coordinates setters a…
tomchapman 77fb0c9
Add Coordinates::communicateDz() and call after constructing Coordinates
tomchapman 09162ca
Fix bug in test_snb
tomchapman 834b090
Apply clang-format changes
tomc271 e117fa5
Merge pull request #3056 from boutproject/fix-after-reactoring-commun…
bendudson 4b5bee3
Merge remote-tracking branch 'remotes/boutproject/next' into refactor…
tomchapman 52b817c
Fix merge
tomchapman fd099bf
Formatting (whitespace changes only)
tomchapman d52a724
Fix for failing fci tests. Need to use Coordinates::DDY() not bout::d…
tomchapman f7706f7
Revert "Use free-function derivatives in metric tensor classes"
tomchapman 58b66f6
Apply black changes
tomc271 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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.