-
Notifications
You must be signed in to change notification settings - Fork 288
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
First stab at importing tracing routines #3432
Open
loganharbour
wants to merge
30
commits into
libMesh:devel
Choose a base branch
from
loganharbour:tracing
base: devel
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 1 commit
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
00e305b
Accept string_view for Xdr::data comments
roystgnr 47d25a7
Xdr::data() no longer needs comment.c_str()
roystgnr 3f27d80
Add Elem::n_vertices_per_side()
loganharbour 09acf75
Add Elem::n_nodes_on_side
loganharbour 0941b26
Add Elem::nodes_on_side_ptr
loganharbour 1c1d5b0
Add Elem::n_nodes_on_edge
loganharbour c080d7e
Add Elem::nodes_on_edge_ptr
loganharbour c58be1e
Add ElemCorner
loganharbour ff7e024
Add IntersectionTools and within_segment
loganharbour 4887954
Add IntersectionTools::collinear
loganharbour 1dad25a
Add IntersectionTools::within_edge_on_side
loganharbour cf19f26
ElemCorner improvements
loganharbour 0600a0f
Add test for ElemCorner::build_edge for 2D
loganharbour ba4c226
Fix spelling
loganharbour 697438c
Correct assertion: we need _at least_ 3 nodes/edge
loganharbour 55202ab
Make within_segment more robust with a relative tolerance
loganharbour 13f2ec8
Update docstring to note relative tolerance
loganharbour 0f0a476
Make collinear more robust with a relative tolerance
loganharbour 5c29b5b
Make within_edge_on_side more robust with a relative tolerance
loganharbour c054c98
Add proxy version of ElemCorner::build_edge
loganharbour 53ec530
Re-bootstrap
loganharbour 08d51bb
Add IntersectionTools::within_edge
loganharbour c0bc3c1
Only test when quad is available
loganharbour 7c4df98
Remove incorrect statement from doxygen
loganharbour 663c05f
Run the within_edge cases over a variety of scales
loganharbour f6f8ba3
Run collinear tests over a variety of scales
loganharbour 6fe2405
Run within_segment tests over a variety of scales
loganharbour 889ffe8
Add IntersectionTools::at_vertex methods
loganharbour f6ed4b6
Add tolerance to docstring
loganharbour ae116d8
Add unit testing for ElemExtrema print and <<
loganharbour 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,32 @@ bool within_edge(const Elem & elem, | |
return false; | ||
} | ||
|
||
unsigned short at_vertex(const Elem & elem, | ||
const Point & p, | ||
const Real tol) | ||
{ | ||
for (const auto v : elem.vertex_index_range()) | ||
if (elem.point(v).relative_fuzzy_equals(p, tol)) | ||
return v; | ||
return Elem::invalid_vertex; | ||
} | ||
|
||
unsigned short at_vertex_on_side(const Elem & elem, | ||
const Point & p, | ||
const unsigned short s, | ||
const Real tol) | ||
{ | ||
libmesh_assert_less(s, elem.n_sides()); | ||
const unsigned int * side_node_map = elem.nodes_on_side_ptr(s); | ||
for (const auto i : make_range(elem.n_vertices_on_side(s))) | ||
{ | ||
const auto v = side_node_map[i]; | ||
if (elem.point(v).relative_fuzzy_equals(p, tol)) | ||
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. Similar tolerance issue here. |
||
return v; | ||
} | ||
return Elem::invalid_vertex; | ||
} | ||
|
||
namespace detail | ||
{ | ||
bool _within_edge(const Elem & elem, | ||
|
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
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 isn't a proper relative tolerance. Here
relative_fuzzy_equals
will usep+elem.point(v)
to compare against, which is likely to be way too big in some cases (a tiny element far from the origin) and is going to be effectively zero in other cases (a huge element with a vertex at the origin).I'd normally use
elem.hmax()
as a scale here, but that might be too expensive for you? If so, it wouldn't be unreasonable to have something likeElem::cheap_scale()
that returns something like an l1 norm (how do we not already have that forTypeVector
...) of(elem.point(1)-elem.point(0))
. Kind of arbitrary for anisotropic meshes but so is the choice ofhmax()
overhmin()
.