forked from boutproject/BOUT-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hermes-3 merges #1
Open
mikekryjak
wants to merge
37
commits into
next
Choose a base branch
from
hermes3
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
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9d7f620
Add Array<int> to Options
bendudson c8e3dd0
GridFile: Check sizes, allocate vector ints
bendudson 2e9f495
Add limiters in input mesh
bendudson 1c77e00
Merge branch 'bugfix-fvops-yalign' into hermes3-temp
bendudson 7d261d4
Merge branch 'next' into hermes3-temp
bendudson 30a93f7
Apply black changes
bendudson fee27c9
Dump field before and after rhs evaluation for debugging
dschwoerer 96da2e9
Add setName function
dschwoerer e56981c
Set div_par and grad_par names
dschwoerer 6b2c132
Dump debug file if PVODE fails
dschwoerer df2d661
Add tracking to Field3D
dschwoerer 263f9fe
Add tracking to Field3D
dschwoerer bac4ca9
cvode: Add option to use Adams Moulton solver instead of BDF
dschwoerer 708bdcb
Expose more pvode option to user
dschwoerer d88b454
Fix bad cherry-pick
dschwoerer 023bc41
Update to new API
dschwoerer affc995
Fix documentation
dschwoerer 71f5b6a
Apply clang-format changes
dschwoerer 31fd461
Apply recomendations from code-review
dschwoerer 17e46cf
Use more meaningful names
dschwoerer 9c0ae16
Apply clang-format changes
dschwoerer 4a17b49
Apply suggestions from code review
dschwoerer 2f7c3c0
Workaround for gcc 9.4
dschwoerer d611758
Add option to debug on failure
dschwoerer db96b7e
Add option to euler solver to dump debug info
dschwoerer 84bfcef
Disable tracking once we are done
dschwoerer 73265df
Allow to dump every timestep with euler
dschwoerer 8ff388a
Apply clang-format changes
dschwoerer d7f8807
Merge branch 'next' into hermes3-temp
bendudson acdc86c
Add debug_on_failure for cvode
dschwoerer 87e6877
Add cvode_max_conv_fails option
Steven-Roberts ffca58c
Apply clang-format changes
mikekryjak bb7c0f2
Merge remote-tracking branch 'boutproject/pvcode-cvode-improvements' …
mikekryjak 01951e8
Merge remote-tracking branch 'Steven-Roberts/cvode_max_conv_fails' in…
mikekryjak 44022f9
Merge remote-tracking branch 'boutproject/cvode-for-mike' into hermes3
mikekryjak 9cccd66
merge
mikekryjak 79821e2
Apply clang-format changes
mikekryjak 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 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 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 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 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 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 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 | ||||
---|---|---|---|---|---|---|
|
@@ -245,6 +245,7 @@ Field3D& Field3D::operator=(const Field3D& rhs) { | |||||
} | ||||||
|
||||||
TRACE("Field3D: Assignment from Field3D"); | ||||||
track(rhs, "operator="); | ||||||
|
||||||
// Copy base slice | ||||||
Field::operator=(rhs); | ||||||
|
@@ -265,6 +266,7 @@ Field3D& Field3D::operator=(const Field3D& rhs) { | |||||
|
||||||
Field3D& Field3D::operator=(Field3D&& rhs) { | ||||||
TRACE("Field3D: Assignment from Field3D"); | ||||||
track(rhs, "operator="); | ||||||
|
||||||
// Move parallel slices or delete existing ones. | ||||||
yup_fields = std::move(rhs.yup_fields); | ||||||
|
@@ -285,6 +287,7 @@ Field3D& Field3D::operator=(Field3D&& rhs) { | |||||
|
||||||
Field3D& Field3D::operator=(const Field2D& rhs) { | ||||||
TRACE("Field3D = Field2D"); | ||||||
track(rhs, "operator="); | ||||||
|
||||||
/// Check that the data is allocated | ||||||
ASSERT1(rhs.isAllocated()); | ||||||
|
@@ -329,6 +332,7 @@ void Field3D::operator=(const FieldPerp& rhs) { | |||||
|
||||||
Field3D& Field3D::operator=(const BoutReal val) { | ||||||
TRACE("Field3D = BoutReal"); | ||||||
track(val, "operator="); | ||||||
|
||||||
// Delete existing parallel slices. We don't copy parallel slices, so any | ||||||
// that currently exist will be incorrect. | ||||||
|
@@ -833,3 +837,47 @@ Field3D::getValidRegionWithDefault(const std::string& region_name) const { | |||||
void Field3D::setRegion(const std::string& region_name) { | ||||||
regionID = fieldmesh->getRegionID(region_name); | ||||||
} | ||||||
|
||||||
Field3D& Field3D::enableTracking(const std::string& name, Options& _tracking) { | ||||||
tracking = &_tracking; | ||||||
tracking_state = 1; | ||||||
selfname = name; | ||||||
return *this; | ||||||
} | ||||||
|
||||||
template <class T> | ||||||
Options* Field3D::track(const T& change, std::string operation) { | ||||||
if (tracking != nullptr and tracking_state != 0) { | ||||||
const std::string outname{fmt::format("track_{:s}_{:d}", selfname, tracking_state++)}; | ||||||
tracking->set(outname, change, "tracking"); | ||||||
// Workaround for bug in gcc9.4 | ||||||
#if BOUT_USE_TRACK | ||||||
const std::string changename = change.name; | ||||||
#endif | ||||||
(*tracking)[outname].setAttributes({ | ||||||
{"operation", operation}, | ||||||
#if BOUT_USE_TRACK | ||||||
{"rhs.name", changename}, | ||||||
#endif | ||||||
}); | ||||||
return &(*tracking)[outname]; | ||||||
} | ||||||
return nullptr; | ||||||
} | ||||||
|
||||||
template Options* Field3D::track<Field3D>(const Field3D&, std::string); | ||||||
template Options* Field3D::track<Field2D>(const Field2D&, std::string); | ||||||
template Options* Field3D::track<FieldPerp>(const FieldPerp&, std::string); | ||||||
|
||||||
Options* Field3D::track(const BoutReal& change, std::string operation) { | ||||||
if (tracking and tracking_state) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: implicit conversion 'int' -> bool [readability-implicit-bool-conversion]
Suggested change
|
||||||
const std::string outname{fmt::format("track_{:s}_{:d}", selfname, tracking_state++)}; | ||||||
tracking->set(outname, change, "tracking"); | ||||||
(*tracking)[outname].setAttributes({ | ||||||
{"operation", operation}, | ||||||
{"rhs.name", "BR"}, | ||||||
}); | ||||||
return &(*tracking)[outname]; | ||||||
} | ||||||
return nullptr; | ||||||
} |
This file contains 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.
warning: implicit conversion 'Options *' -> bool [readability-implicit-bool-conversion]