Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion include/geom/cell_prism.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class Prism : public Cell
/**
* Master element node locations
*/
static const Real _master_points[18][3];
static const Real _master_points[21][3];

/**
* This maps the \f$ j^{th} \f$ Prism vertex to the (in this case) 3
Expand Down
2 changes: 1 addition & 1 deletion include/geom/cell_pyramid.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class Pyramid : public Cell
/**
* Master element node locations
*/
static const Real _master_points[14][3];
static const Real _master_points[18][3];

#ifdef LIBMESH_ENABLE_AMR

Expand Down
2 changes: 1 addition & 1 deletion include/geom/face_tri.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Tri : public Face
/**
* Master element node locations
*/
static const Real _master_points[6][3];
static const Real _master_points[7][3];

/**
* This maps the \f$ j^{th} \f$ node to the (in this case) 2 side
Expand Down
8 changes: 4 additions & 4 deletions src/fe/fe_abstract.C
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,10 @@ void FEAbstract::get_refspace_nodes(const ElemType itemType, std::vector<Point>
case PYRAMID18:
{
// triangle centers
nodes[14] = Point (-2/Real(3),0.,1/Real(3));
nodes[15] = Point (0.,2/Real(3),1/Real(3));
nodes[16] = Point (2/Real(3),0.,1/Real(3));
nodes[17] = Point (0.,-2/Real(3),1/Real(3));
nodes[14] = Point (0., -2/Real(3),1/Real(3));
nodes[15] = Point (2/Real(3),0.,1/Real(3));
nodes[16] = Point (0.,2/Real(3),1/Real(3));
nodes[17] = Point (-2/Real(3),0.,1/Real(3));

libmesh_fallthrough();
}
Expand Down
7 changes: 5 additions & 2 deletions src/geom/cell_prism.C
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const int Prism::num_sides;
const int Prism::num_edges;
const int Prism::num_children;

const Real Prism::_master_points[18][3] =
const Real Prism::_master_points[21][3] =
{
{0, 0, -1},
{1, 0, -1},
Expand All @@ -53,7 +53,10 @@ const Real Prism::_master_points[18][3] =
{0, 0.5, 1},
{0.5, 0, 0},
{0.5, 0.5, 0},
{0, 0.5, 0}
{0, 0.5, 0},
{Real(1)/3, Real(1)/3, -1},
{Real(1)/3, Real(1)/3, 1},
{Real(1)/3, Real(1)/3, 0}
};

const unsigned int Prism::edge_sides_map[9][2] =
Expand Down
16 changes: 10 additions & 6 deletions src/geom/cell_pyramid.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const int Pyramid::num_sides;
const int Pyramid::num_edges;
const int Pyramid::num_children;

const Real Pyramid::_master_points[14][3] =
const Real Pyramid::_master_points[18][3] =
{
{-1, -1, 0},
{1, -1, 0},
Expand All @@ -44,11 +44,15 @@ const Real Pyramid::_master_points[14][3] =
{1, 0, 0},
{0, 1, 0},
{-1, 0, 0},
{0, -0.5, 0.5},
{0.5, 0, 0.5},
{0, 0.5, 0.5},
{-0.5, 0, 0.5},
{0, 0, 0}
{-0.5, -0.5, 0.5},
{0.5, -0.5, 0.5},
{0.5, 0.5, 0.5},
{-0.5, 0.5, 0.5},
{0, 0, 0},
{0, -Real(2)/3, Real(1)/3},
{ Real(2)/3, 0, Real(1)/3},
{0, Real(2)/3, Real(1)/3},
{-Real(2)/3, 0, Real(1)/3}
};

const unsigned int Pyramid::edge_sides_map[8][2] =
Expand Down
5 changes: 3 additions & 2 deletions src/geom/face_tri.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ const int Tri::num_children;

// Note: we can omit initialization of the third entry of each row because
// static variables are automatically zero-initialized.
const Real Tri::_master_points[6][3] =
const Real Tri::_master_points[7][3] =
{
{0, 0},
{1, 0},
{0, 1},
{0.5, 0},
{0.5, 0.5},
{0, 0.5}
{0, 0.5},
{Real(1)/3, Real(1)/3}
};

const unsigned int Tri::adjacent_sides_map[/*num_vertices*/3][/*n_adjacent_sides*/2] =
Expand Down
26 changes: 26 additions & 0 deletions tests/fe/fe_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#define FETEST \
CPPUNIT_TEST( testFEInterface ); \
CPPUNIT_TEST( testRefspaceNodes ); \
CPPUNIT_TEST( testU ); \
CPPUNIT_TEST( testPartitionOfUnity ); \
CPPUNIT_TEST( testGradU ); \
Expand Down Expand Up @@ -668,8 +669,33 @@ class FETest : public FETestBase<order, family, elem_type, 1, CaseName> {
#endif // LIBMESH_ENABLE_EXCEPTIONS
}

void testRefspaceNodes()
{
LOG_UNIT_TEST;

if (!this->_elem)
return;

// We don't currently support reference infinite elements
if (this->_elem->infinite())
return;

// We'll probably never support reference polytopes
if (this->_elem->runtime_topology())
return;

std::vector<Point> nodes;
this->_fe->get_refspace_nodes(this->_elem->type(), nodes);
for (auto n : index_range(nodes))
LIBMESH_ASSERT_REALVEC_EQUAL(nodes[n],
this->_elem->master_point(n),
TOLERANCE*TOLERANCE);
}

void testPartitionOfUnity()
{
LOG_UNIT_TEST;

if (!this->_elem)
return;

Expand Down
26 changes: 26 additions & 0 deletions tests/geom/elem_test.C
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,31 @@ public:
}
}

void test_ref_elem()
{
LOG_UNIT_TEST;

for (const auto & elem : this->_mesh->active_local_element_ptr_range())
{
// We don't currently support reference infinite elements
if (elem->infinite())
continue;

// We'll probably never support reference polytopes
if (elem->runtime_topology())
continue;

const Elem & ref_elem = *elem->reference_elem();

for (auto i : elem->node_index_range())
{
LIBMESH_ASSERT_REALVEC_EQUAL(elem->master_point(i),
ref_elem.point(i),
TOLERANCE*TOLERANCE);
}
}
}

void test_quality()
{
LOG_UNIT_TEST;
Expand Down Expand Up @@ -944,6 +969,7 @@ public:

#define ELEMTEST \
CPPUNIT_TEST( test_bounding_box ); \
CPPUNIT_TEST( test_ref_elem ); \
CPPUNIT_TEST( test_quality ); \
CPPUNIT_TEST( test_node_edge_map_consistency ); \
CPPUNIT_TEST( test_maps ); \
Expand Down