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

Clean-up: Proper C/C++ interface for t8_cmesh_set_join_by_vertices #1056

Open
jmark opened this issue Apr 30, 2024 · 0 comments
Open

Clean-up: Proper C/C++ interface for t8_cmesh_set_join_by_vertices #1056

jmark opened this issue Apr 30, 2024 · 0 comments
Labels
C++ enhancement Enhances already existing code

Comments

@jmark
Copy link
Collaborator

jmark commented Apr 30, 2024

The signature of t8_cmesh_set_join_by_vertices is like the following which is not clean and useful for users:

/** Sets the face connectivity information of an un-committed \cmesh based on a list of tree vertices.
 * \param[in,out]   cmesh         Pointer to a t8code cmesh object. If set to NULL this argument is ignored.
 * \param[in]       ntrees        Number of coarse mesh elements resp. trees.
 * \param[in]       vertices      List of per element vertices with dimensions [ntrees,T8_ECLASS_MAX_CORNERS,T8_ECLASS_MAX_DIM].
 * \param[in]       eclasses      List of element classes of length [ntrees].
 * \param[in,out]   connectivity  If connectivity is not NULL the variable is filled with a pointer to an allocated
                                  face connectivity array. The ownership of this
                                  array goes to the caller. This argument is mainly used for debugging and
                                  testing purposes. The dimension of \a connectivity are [ntrees,T8_ECLASS_MAX_FACES,3].
                                  For each element and each face the following is stored:
                                      neighbor_tree_id, neighbor_dual_face_id, orientation
 * \param[in]       do_both_directions Compute the connectivity from both neighboring sides. Takes much longer to compute.
  \warning This routine might be too expensive for very large meshes. In this case, consider to use a fully featured mesh generator.
  \note This routine does not detect periodic boundaries.
 */
void
t8_cmesh_set_join_by_vertices (t8_cmesh_t cmesh, const int ntrees, const t8_eclass_t *eclasses, const double *vertices,
                               int **connectivity, const int do_both_directions);

The optiondo_both_directions is for debugging and testing purposes. It is used in the GoogleTests. However, changing this now would mean a breaking release. This routine created a life on its own and creeped into several interfaces/codes already even though it was originally envisaged as an internal helper function. When we switch to proper C++/C interfaces we should clean this up and provide
a proper interface.

@jmark jmark added enhancement Enhances already existing code C++ labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ enhancement Enhances already existing code
Projects
None yet
Development

No branches or pull requests

1 participant