Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
1 change: 1 addition & 0 deletions doc/author_schmitt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I place my contributions to t8code under the FreeBSD license. Vincent Schmitt (vinz@vincent-schmitt.de)
Comment thread
lenaploetzke marked this conversation as resolved.
39 changes: 39 additions & 0 deletions mesh_handle/element.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,45 @@ class element: public TCompetences<element<TMeshClass, TCompetences...>>... {
return m_is_ghost_element;
}

// get_reference_coordinates
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
/** Function to convert points in reference space of an element to points of the
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
* reference space of the tree.
* \param [in] ref_coords Pointer to the reference coordinates of the element.
* \param [in] num_coords Number of reference coordinates to convert.
* \param [out] tree_ref_coords Pointer to the reference coordinates of the tree.
*/
void
get_reference_coordinates (const double* ref_coords, std::size_t num_coords, double* tree_ref_coords) const
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
{
t8_forest_get_scheme (m_mesh->m_forest)
->element_get_reference_coords (get_tree_class (), m_element, ref_coords, num_coords, tree_ref_coords);
}

// element_is_equal
/** Check if two elements are equal.
Comment thread
Vyp3er marked this conversation as resolved.
* \param [in] elem1 The first element.
* \param [in] elem2 The second element.
* \return true if the elements are equal, false if they are not equal.
*/
bool
is_equal (const SelfType& elem1, const SelfType& elem2) const
{
return t8_forest_get_scheme (m_mesh->m_forest)
->element_is_equal (get_tree_class (), elem1.get_forest_element (), elem2.get_forest_element ());
}

//t8_forest_leaf_face_orientation
/** Compute the orientation of a face of an element with respect to its neighbor.
* \param [in] face The index of the face for which the orientation should be computed.
* \return The orientation of the face with respect to its neighbor. Returns 0 if the face has no neighbor.
*/
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
int
get_face_orientation (int face) const

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool function, could you maybe use this one in dg_competences.hxx?

{
return t8_forest_leaf_face_orientation (m_mesh->m_forest, m_tree_id, t8_forest_get_scheme (m_mesh->m_forest),
m_element, face);
}

private:
// --- Private member variables. ---
TMeshClass* m_mesh; /**< Pointer to the mesh the element is defined for. */
Expand Down
10 changes: 10 additions & 0 deletions test/mesh_handle/t8_gtest_compare_handle_to_forest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ TEST (t8_gtest_compare_handle_to_forest, compare_handle_to_forest)
// --- Compare elements. ---
EXPECT_EQ (mesh_iterator->get_local_tree_id (), itree);
EXPECT_EQ (mesh_iterator->get_local_element_id (), ielem);
EXPECT_EQ (mesh_iterator->is_equal (*mesh_iterator, *mesh_iterator),
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
Comment thread
Vyp3er marked this conversation as resolved.
Outdated
scheme->element_is_equal (tree_class, elem, elem));

t8_3D_vec ref = { 0.2, 0.3, 1 };
t8_3D_vec a, b;
mesh_iterator->get_reference_coordinates (ref.data (), 1, a.data ());
scheme->element_get_reference_coords (tree_class, elem, ref.data (), 1, b.data ());
EXPECT_EQ (a, b);
// --- Compare functionality. ---
EXPECT_EQ (mesh_iterator->get_level (), scheme->element_get_level (tree_class, elem));
EXPECT_EQ (mesh_iterator->get_num_faces (), scheme->element_get_num_faces (tree_class, elem));
Expand Down Expand Up @@ -94,6 +102,8 @@ TEST (t8_gtest_compare_handle_to_forest, compare_handle_to_forest)
EXPECT_EQ (mesh_iterator->face_vertex_to_element_vertex (iface, ivertex),
scheme->element_get_face_corner (tree_class, elem, iface, ivertex));
}
EXPECT_EQ (mesh_iterator->get_face_orientation (iface),
t8_forest_leaf_face_orientation (forest, itree, scheme, elem, iface));
}
// --- Evolve mesh iterator. ---
mesh_iterator++;
Expand Down