/*1This file is part of t8code.2t8code is a C library to manage a collection (a forest) of multiple3connected adaptive space-trees of general element classes in parallel.45Copyright (C) 2023, 2024 the developers67t8code is free software; you can redistribute it and/or modify8it under the terms of the GNU General Public License as published by9the Free Software Foundation; either version 2 of the License, or10(at your option) any later version.1112t8code is distributed in the hope that it will be useful,13but WITHOUT ANY WARRANTY; without even the implied warranty of14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15GNU General Public License for more details.1617You should have received a copy of the GNU General Public License18along with t8code; if not, write to the Free Software Foundation, Inc.,1951 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.20*/2122/** \file t8_cmesh_helpers.h23*24* Collection of helper routines for building cmeshes.25*/2627#ifndef T8_CMESH_HELPERS_H28#define T8_CMESH_HELPERS_H2930#include <t8.h>31#include <t8_cmesh/t8_cmesh.h>32#include <t8_eclass.h>3334T8_EXTERN_C_BEGIN ();3536/** Sets the face connectivity information of an un-committed cmesh based on a list of tree vertices.37* \param[in,out] cmesh Pointer to a t8code cmesh object. If set to NULL this argument is ignored.38* \param[in] ntrees Number of coarse mesh elements resp. trees.39* \param[in] vertices List of per element vertices with dimensions40* [ntrees,T8_ECLASS_MAX_CORNERS,T8_ECLASS_MAX_DIM].41* \param[in] eclasses List of element classes of length [ntrees].42* \param[in,out] connectivity If connectivity is not NULL the variable is filled with a pointer to an43* allocated face connectivity array. The ownership of this44* array goes to the caller. This argument is mainly used for debugging and45* testing purposes. The dimension of \a connectivity are46* [ntrees,T8_ECLASS_MAX_FACES,3].47* For each element and each face the following is stored:48* neighbor_tree_id, neighbor_dual_face_id, orientation49* \param[in] do_both_directions Compute the connectivity from both neighboring sides.50* Takes much longer to compute.51*52* \warning This routine might be too expensive for very large meshes. In this case,53* consider to use a fully featured mesh generator.54*55* \note This routine does not detect periodic boundaries.56*/57void58t8_cmesh_set_join_by_vertices (t8_cmesh_t cmesh, const t8_gloidx_t ntrees, const t8_eclass_t *eclasses,59const double *vertices, int **connectivity, const int do_both_directions);6061/** Sets the face connectivity information of an un-committed cmesh based on the cmesh stash.62* \param[in,out] cmesh An uncommitted cmesh. The trees eclasses and vertices do need to be set.63* \param[in,out] connectivity If connectivity is not NULL the variable is filled with a pointer to an64* allocated face connectivity array. The ownership of this65* array goes to the caller. This argument is mainly used for debugging and66* testing purposes. The dimension of \a connectivity are67* [ntrees,T8_ECLASS_MAX_FACES,3].68* For each element and each face the following is stored:69* neighbor_tree_id, neighbor_dual_face_id, orientation70* \param[in] do_both_directions Compute the connectivity from both neighboring sides. Takes much longer to compute.71*72* \warning This routine might be too expensive for very large meshes. In this case,73* consider to use a fully featured mesh generator.74*75* \note This routine does not detect periodic boundaries.76*/77void78t8_cmesh_set_join_by_stash (t8_cmesh_t cmesh, int **connectivity, const int do_both_directions);7980T8_EXTERN_C_END ();8182#endif /* !T8_CMESH_HELPERS_H */838485