Skip to content
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
wants to merge 30 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
00e305b
Accept string_view for Xdr::data comments
roystgnr Nov 10, 2022
47d25a7
Xdr::data() no longer needs comment.c_str()
roystgnr Nov 10, 2022
3f27d80
Add Elem::n_vertices_per_side()
loganharbour Nov 8, 2022
09acf75
Add Elem::n_nodes_on_side
loganharbour Nov 9, 2022
0941b26
Add Elem::nodes_on_side_ptr
loganharbour Nov 9, 2022
1c1d5b0
Add Elem::n_nodes_on_edge
loganharbour Nov 9, 2022
c080d7e
Add Elem::nodes_on_edge_ptr
loganharbour Nov 9, 2022
c58be1e
Add ElemCorner
loganharbour Nov 14, 2022
ff7e024
Add IntersectionTools and within_segment
loganharbour Nov 14, 2022
4887954
Add IntersectionTools::collinear
loganharbour Nov 9, 2022
1dad25a
Add IntersectionTools::within_edge_on_side
loganharbour Nov 10, 2022
cf19f26
ElemCorner improvements
loganharbour Nov 14, 2022
0600a0f
Add test for ElemCorner::build_edge for 2D
loganharbour Nov 14, 2022
ba4c226
Fix spelling
loganharbour Nov 14, 2022
697438c
Correct assertion: we need _at least_ 3 nodes/edge
loganharbour Nov 14, 2022
55202ab
Make within_segment more robust with a relative tolerance
loganharbour Nov 14, 2022
13f2ec8
Update docstring to note relative tolerance
loganharbour Nov 14, 2022
0f0a476
Make collinear more robust with a relative tolerance
loganharbour Nov 14, 2022
5c29b5b
Make within_edge_on_side more robust with a relative tolerance
loganharbour Nov 14, 2022
c054c98
Add proxy version of ElemCorner::build_edge
loganharbour Nov 14, 2022
53ec530
Re-bootstrap
loganharbour Nov 14, 2022
08d51bb
Add IntersectionTools::within_edge
loganharbour Nov 14, 2022
c0bc3c1
Only test when quad is available
loganharbour Nov 14, 2022
7c4df98
Remove incorrect statement from doxygen
loganharbour Nov 14, 2022
663c05f
Run the within_edge cases over a variety of scales
loganharbour Nov 14, 2022
f6f8ba3
Run collinear tests over a variety of scales
loganharbour Nov 14, 2022
6fe2405
Run within_segment tests over a variety of scales
loganharbour Nov 14, 2022
889ffe8
Add IntersectionTools::at_vertex methods
loganharbour Nov 15, 2022
f6ed4b6
Add tolerance to docstring
loganharbour Nov 15, 2022
ae116d8
Add unit testing for ElemExtrema print and <<
loganharbour Nov 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 192 additions & 45 deletions Makefile.in

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions include/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ include_HEADERS = \
geom/edge_edge4.h \
geom/edge_inf_edge2.h \
geom/elem.h \
geom/elem_corner.h \
geom/elem_cutter.h \
geom/elem_hash.h \
geom/elem_internal.h \
Expand All @@ -751,6 +752,7 @@ include_HEADERS = \
geom/face_tri3_subdivision.h \
geom/face_tri6.h \
geom/face_tri7.h \
geom/intersection_tools.h \
geom/node.h \
geom/node_elem.h \
geom/node_range.h \
Expand Down
6 changes: 6 additions & 0 deletions include/geom/cell_hex.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ class Hex : public Cell
*/
virtual unsigned int n_vertices() const override final { return 8; }

/**
* \returns 4. Every side has four vertices.
*/
virtual unsigned int n_vertices_on_side(const unsigned short libmesh_dbg_var(s)) const override final
{ libmesh_assert_less(s, this->n_sides()); return 4; }

/**
* \returns 12. All hexahedra have 12 edges.
*/
Expand Down
20 changes: 18 additions & 2 deletions include/geom/cell_hex20.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,14 @@ class Hex20 final : public Hex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<Hex20>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<Hex20>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -240,15 +246,25 @@ class Hex20 final : public Hex

ElemType side_type (const unsigned int s) const override final;

/**
* \returns 8. Every side has eight nodes.
*/
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<Hex20>(s); }

/**
* \returns 3. Every edge has two nodes.
*/
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<Hex20>(e); }

protected:

/**
* Data for links to nodes.
*/
Node * _nodelinks_data[num_nodes];



#ifdef LIBMESH_ENABLE_AMR

/**
Expand Down
18 changes: 18 additions & 0 deletions include/geom/cell_hex27.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,14 @@ class Hex27 final : public Hex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<Hex27>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<Hex27>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -258,6 +264,18 @@ class Hex27 final : public Hex

ElemType side_type (const unsigned int s) const override final;

/**
* \returns 9. Every side has eight nodes.
*/
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<Hex27>(s); }

/**
* \returns 3. Every edge has three nodes.
*/
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<Hex27>(e); }

protected:


Expand Down
18 changes: 18 additions & 0 deletions include/geom/cell_hex8.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ class Hex8 final : public Hex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<Hex8>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<Hex8>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -215,6 +221,18 @@ class Hex8 final : public Hex

ElemType side_type (const unsigned int s) const override final;

/**
* \returns 4. Every side has four nodes.
*/
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<Hex8>(s); }

/**
* \returns 2. Every edge has two nodes.
*/
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<Hex8>(e); }

protected:

/**
Expand Down
19 changes: 19 additions & 0 deletions include/geom/cell_inf_hex.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ class InfHex : public InfCell
*/
virtual unsigned int n_vertices() const override final { return 8; }

/**
* \returns 4. Every side has four vertices.
*/
virtual unsigned int n_vertices_on_side(const unsigned short libmesh_dbg_var(s)) const override final
{ libmesh_assert_less(s, this->n_sides()); return 4; }

/**
* \returns \p true if the specified (local) node number is a
* "mid-edge" node on an infinite element edge.
Expand Down Expand Up @@ -194,6 +200,19 @@ class InfHex : public InfCell
*/
static const unsigned int edge_sides_map[8][2];

/**
* Helper for n_nodes_on_side() for InfHex-derived classes.
*
* That is, returns InfHex::nodes_per_side - \p remove_num
* for sides 1-4, and InfHex::nodes_per_side for side 0.
*/
template <class InfHexClass, unsigned short remove_num>
unsigned int _n_nodes_on_side(const unsigned short s) const
{
static_assert(std::is_base_of<InfHex, InfHexClass>::value, "Not a InfHex");
return this->_n_nodes_on_side_constant<InfHexClass>(s) - ((s == 0) ? 0 : remove_num);
}

protected:

/**
Expand Down
12 changes: 12 additions & 0 deletions include/geom/cell_inf_hex16.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,14 @@ class InfHex16 final : public InfHex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfHex16>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfHex16>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -238,6 +244,12 @@ class InfHex16 final : public InfHex

ElemType side_type (const unsigned int s) const override final;

virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side<InfHex16, 2>(s); }

virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfHex16>(e) - ((e < 4) ? 0 : 1); }

protected:

/**
Expand Down
12 changes: 12 additions & 0 deletions include/geom/cell_inf_hex18.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,14 @@ class InfHex18 final : public InfHex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfHex18>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfHex18>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -253,6 +259,12 @@ class InfHex18 final : public InfHex

ElemType side_type (const unsigned int s) const override final;

virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side<InfHex18, 3>(s); }

virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfHex18>(e) - ((e < 4) ? 0 : 1); }

protected:

/**
Expand Down
18 changes: 18 additions & 0 deletions include/geom/cell_inf_hex8.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ class InfHex8 final : public InfHex

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfHex8>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfHex8>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -188,6 +194,18 @@ class InfHex8 final : public InfHex

ElemType side_type (const unsigned int s) const override final;

/**
* \returns 4. Every side has four nodes.
*/
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<InfHex8>(s); }

/**
* \returns 2. Every edge has two nodes.
*/
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfHex8>(e); }

protected:

/**
Expand Down
3 changes: 3 additions & 0 deletions include/geom/cell_inf_prism.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class InfPrism : public InfCell
*/
virtual unsigned int n_vertices() const override final { return 6; }

virtual unsigned int n_vertices_on_side(const unsigned short s) const override final
{ libmesh_assert_less(s, this->n_sides()); return 4 - (s == 0); }

/**
* \returns 6. All infinite prisms have 6 edges,
* 3 lying in the base, and 3 perpendicular to the base.
Expand Down
15 changes: 15 additions & 0 deletions include/geom/cell_inf_prism12.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ class InfPrism12 final : public InfPrism

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfPrism12>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfPrism12>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -226,6 +232,15 @@ class InfPrism12 final : public InfPrism

ElemType side_type (const unsigned int s) const override final;

/**
* \returns 6. Every side has six nodes.
*/
virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<InfPrism12>(s); }

virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfPrism12>(e) - ((e < 3) ? 0 : 1); }

protected:

/**
Expand Down
12 changes: 12 additions & 0 deletions include/geom/cell_inf_prism6.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ class InfPrism6 final : public InfPrism

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<InfPrism6>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<InfPrism6>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -187,6 +193,12 @@ class InfPrism6 final : public InfPrism

ElemType side_type (const unsigned int s) const override final;

virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return this->_n_nodes_on_side_constant<InfPrism6>(s) - ((s == 0) ? 1 : 0); }

virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<InfPrism6>(e); }

protected:

/**
Expand Down
16 changes: 16 additions & 0 deletions include/geom/cell_prism.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class Prism : public Cell
*/
virtual unsigned int n_vertices() const override final { return 6; }

virtual unsigned int n_vertices_on_side(const unsigned short s) const override final
{ libmesh_assert_less(s, this->n_sides()); return 4 - (s == 0 || s == 4); }

/**
* \returns 9. All prisms have 9 edges.
*/
Expand Down Expand Up @@ -160,6 +163,19 @@ class Prism : public Cell

protected:

/**
* Helper for n_nodes_on_side() for Prism-derived classes.
*
* That is, returns \p PrismClass::nodes_per_side for sides 1-3, and
* the same value minus \p remove_num for sides 0 and 4.
*/
template <class PrismClass, unsigned short remove_num>
unsigned int _n_nodes_on_side(const unsigned short s) const
{
static_assert(std::is_base_of<Prism, PrismClass>::value, "Not a Prism");
return this->_n_nodes_on_side_constant<PrismClass>(s) - ((s == 0 || s == 4) ? remove_num : 0);
}

/**
* Data for links to parent/neighbor/interior_parent elements.
*/
Expand Down
15 changes: 15 additions & 0 deletions include/geom/cell_prism15.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,14 @@ class Prism15 final : public Prism

virtual std::vector<unsigned int> nodes_on_side(const unsigned int s) const override;

virtual const unsigned int * nodes_on_side_ptr(const unsigned short s) const override final
{ return this->_nodes_on_side_ptr<Prism15>(s); }

virtual std::vector<unsigned int> nodes_on_edge(const unsigned int e) const override;

virtual const unsigned int * nodes_on_edge_ptr(const unsigned short e) const override final
{ return this->_nodes_on_edge_ptr<Prism15>(e); }

/**
* \returns \p true if the specified (local) node number is on the
* specified edge.
Expand Down Expand Up @@ -245,6 +251,15 @@ class Prism15 final : public Prism

ElemType side_type (const unsigned int s) const override final;

virtual unsigned int n_nodes_on_side(const unsigned short s) const override final
{ return _n_nodes_on_side<Prism15, 2>(s); }

/**
* \returns 3. Every edge has three nodes.
*/
virtual unsigned int n_nodes_on_edge(const unsigned short e) const override final
{ return this->_n_nodes_on_edge_constant<Prism15>(e); }

protected:

/**
Expand Down
Loading