-
Notifications
You must be signed in to change notification settings - Fork 37
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
custom coords #1039
Merged
Merged
custom coords #1039
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
be24c3d
Add CoordinatesVec flag
jonahm-LANL dbf28b4
clean details a bit
jonahm-LANL 4610d02
start special casing coordinate fields
jonahm-LANL 071d305
clean up some of this insane C++ string processing
jonahm-LANL 0e082bd
Merge branch 'jmm/output-nodes-2' into jmm/custom-coords
jonahm-LANL 0ee7442
lets try this
jonahm-LANL 7656598
working
jonahm-LANL da3727e
Merge branch 'jmm/output-nodes-2' into jmm/custom-coords
jonahm-LANL ac12de0
intermediate commit dealing with issues with 2D and 1D
jonahm-LANL a7c621c
gotcha
jonahm-LANL 19379e4
am I insane
jonahm-LANL c652ebe
Merge branch 'jmm/output-nodes-2' into jmm/custom-coords
jonahm-LANL b198055
fix typos, enable particle output (optimistically)
jonahm-LANL 0f8a018
oops, too much data to stringprintf from incomplete fix
jonahm-LANL 0d6deb5
need c_str()
jonahm-LANL dc768e2
don't need it here
jonahm-LANL 7f111a1
nope particles still don't work. I tried.
jonahm-LANL d958618
Merge branch 'develop' into jmm/custom-coords
jonahm-LANL 525b80a
try to fix 2D and 1D meshes
jonahm-LANL f1ccda1
remove extraneous vector dimension
jonahm-LANL 5acd3ac
make documentation explain
jonahm-LANL 115cccd
fix issue with n321 in lower dims
jonahm-LANL bee7d4d
changelog
jonahm-LANL 015b349
debug
jonahm-LANL ebbe5c6
debugging
jonahm-LANL 738fe53
why wasnt mesh_ndim being passed correctly whatever try this
jonahm-LANL cb6eddb
remove warning since I tested polyline
jonahm-LANL 610c324
oh my god what a mistake
jonahm-LANL 53b140e
number of elements
jonahm-LANL 4130974
try this polyline
jonahm-LANL 7057ffe
shape
jonahm-LANL f982fd8
flat baby
jonahm-LANL 5be9c99
topology
jonahm-LANL 94cff20
I can't get 1D to work. Removed the insanity
jonahm-LANL 7e29c1b
cant write ndim_mesh
jonahm-LANL 55a99b4
globals my rank
jonahm-LANL ac75270
disable vector output
jonahm-LANL 53bd349
Merge branch 'develop' into jmm/custom-coords
Yurlungur 0b0599f
Merge branch 'develop' into jmm/custom-coords
Yurlungur ae4cffd
Switch to new gold file for sparse advection
jonahm-LANL 80b39ae
Merge branch 'jmm/custom-coords' of github.com:lanl/parthenon into jm…
jonahm-LANL 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 |
---|---|---|
|
@@ -184,6 +184,88 @@ std::ostream &operator<<(std::ostream &os, const parthenon::Metadata &m) { | |
return os; | ||
} | ||
|
||
// Return true if the flags constraints are satisfied, false otherwise. If throw_on_fail | ||
// is true, throw a descriptive exception when invalid | ||
bool Metadata::IsValid(bool throw_on_fail) const { | ||
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. Moved from hpp to cpp |
||
bool valid = true; | ||
|
||
// Topology | ||
if (CountSet({None, Node, Edge, Face, Cell}) != 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Exactly one topology flag must be set"); | ||
} | ||
} | ||
|
||
// Role | ||
if (CountSet({Private, Provides, Requires, Overridable}) != 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Exactly one role flag must be set"); | ||
} | ||
} | ||
|
||
// Shape | ||
if (CountSet({Vector, Tensor}) > 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("At most one shape flag can be set"); | ||
} | ||
} | ||
|
||
// Coordinates | ||
if (IsSet(CoordinatesVec)) { | ||
if (Where() != Node) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Coordinate field must be node-centered"); | ||
} | ||
} | ||
if (shape_.size() != 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Coordinate field must be tensor rank 1"); | ||
} | ||
} | ||
if (shape_[0] != 3) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW( | ||
"Coordinate field must be 3-vector. (Does not need Vector metadata flag)."); | ||
Yurlungur marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
|
||
// Datatype | ||
if (CountSet({Boolean, Integer, Real}) != 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Exactly one data type flag must be set"); | ||
} | ||
} | ||
|
||
// Independent | ||
if (CountSet({Independent, Derived}) != 1) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW("Either the Independent or Derived flag must be set"); | ||
} | ||
} | ||
|
||
// Prolongation/restriction | ||
if (IsRefined()) { | ||
if (refinement_funcs_.label().size() == 0) { | ||
valid = false; | ||
if (throw_on_fail) { | ||
PARTHENON_THROW( | ||
"Registered for refinment but no prolongation/restriction ops found"); | ||
} | ||
} | ||
} | ||
|
||
return valid; | ||
} | ||
|
||
std::vector<MetadataFlag> Metadata::Flags() const { | ||
std::vector<MetadataFlag> set_flags; | ||
const auto &flags = metadata_state.AllFlags(); | ||
|
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
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.
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.
this ended up in the changelog for the previous release by accident.