Skip to content

Commit

Permalink
Fix edge -> side mapping for InfHex and consolidate edge_sides_map
Browse files Browse the repository at this point in the history
  • Loading branch information
loganharbour authored and roystgnr committed Dec 14, 2021
1 parent 2ec055c commit 61105f3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 56 deletions.
5 changes: 5 additions & 0 deletions include/geom/cell_inf_hex.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ class InfHex : public InfCell
*/
virtual unsigned int n_permutations() const override final { return 4; }

/**
* This maps each edge to the sides that contain said edge.
*/
static const unsigned int edge_sides_map[8][2];

protected:

/**
Expand Down
5 changes: 0 additions & 5 deletions include/geom/cell_inf_hex16.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ class InfHex16 final : public InfHex
*/
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];

/**
* This maps each edge to the sides that contain said edge.
*/
static const unsigned int edge_sides_map[num_edges][2];

virtual void permute(unsigned int perm_num) override final;

protected:
Expand Down
5 changes: 0 additions & 5 deletions include/geom/cell_inf_hex18.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ class InfHex18 final : public InfHex
*/
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];

/**
* This maps each edge to the sides that contain said edge.
*/
static const unsigned int edge_sides_map[num_edges][2];

virtual void permute(unsigned int perm_num) override final;

protected:
Expand Down
5 changes: 0 additions & 5 deletions include/geom/cell_inf_hex8.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ class InfHex8 final : public InfHex
*/
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge];

/**
* This maps each edge to the sides that contain said edge.
*/
static const unsigned int edge_sides_map[num_edges][2];

virtual void permute(unsigned int perm_num) override final;

protected:
Expand Down
19 changes: 15 additions & 4 deletions src/geom/cell_inf_hex.C
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ const Real InfHex::_master_points[18][3] =
{0, 0, 1}
};


const unsigned int InfHex::edge_sides_map[8][2] =
{
{0, 1}, // Edge 0
{0, 2}, // Edge 1
{0, 3}, // Edge 2
{0, 4}, // Edge 3
{1, 4}, // Edge 4
{1, 2}, // Edge 5
{2, 3}, // Edge 6
{3, 4} // Edge 7
};



Expand Down Expand Up @@ -222,15 +232,16 @@ bool InfHex::is_edge_on_side (const unsigned int e,
libmesh_assert_less (e, this->n_edges());
libmesh_assert_less (s, this->n_sides());

return (InfHex8::edge_sides_map[e][0] == s ||
InfHex8::edge_sides_map[e][1] == s);
return (edge_sides_map[e][0] == s || edge_sides_map[e][1] == s);
}



std::vector<unsigned int> InfHex::sides_on_edge(const unsigned int e) const
{
return {InfHex8::edge_sides_map[e][0], InfHex8::edge_sides_map[e][1]};
libmesh_assert_less(e, this->n_edges());

return {edge_sides_map[e][0], edge_sides_map[e][1]};
}


Expand Down
12 changes: 0 additions & 12 deletions src/geom/cell_inf_hex16.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ const unsigned int InfHex16::edge_nodes_map[InfHex16::num_edges][InfHex16::nodes
{3, 7, 99} // Edge 7
};

const unsigned int InfHex16::edge_sides_map[InfHex16::num_edges][2] =
{
{0, 1}, // Edge 0
{1, 2}, // Edge 1
{0, 3}, // Edge 2
{0, 4}, // Edge 3
{1, 4}, // Edge 4
{1, 2}, // Edge 5
{2, 3}, // Edge 6
{3, 4} // Edge 7
};

// ------------------------------------------------------------
// InfHex16 class member functions

Expand Down
12 changes: 0 additions & 12 deletions src/geom/cell_inf_hex18.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ const unsigned int InfHex18::edge_nodes_map[InfHex18::num_edges][InfHex18::nodes
{3, 7, 99} // Edge 7
};

const unsigned int InfHex18::edge_sides_map[InfHex18::num_edges][2] =
{
{0, 1}, // Edge 0
{1, 2}, // Edge 1
{0, 3}, // Edge 2
{0, 4}, // Edge 3
{1, 4}, // Edge 4
{1, 2}, // Edge 5
{2, 3}, // Edge 6
{3, 4} // Edge 7
};

// ------------------------------------------------------------
// InfHex18 class member functions

Expand Down
13 changes: 0 additions & 13 deletions src/geom/cell_inf_hex8.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ const unsigned int InfHex8::edge_nodes_map[InfHex8::num_edges][InfHex8::nodes_pe
{3, 7} // Edge 7
};

const unsigned int InfHex8::edge_sides_map[InfHex8::num_edges][2] =
{
{0, 1}, // Edge 0
{1, 2}, // Edge 1
{0, 3}, // Edge 2
{0, 4}, // Edge 3
{1, 4}, // Edge 4
{1, 2}, // Edge 5
{2, 3}, // Edge 6
{3, 4} // Edge 7
};


// ------------------------------------------------------------
// InfHex8 class member functions

Expand Down

0 comments on commit 61105f3

Please sign in to comment.