Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/src/t8_cmesh/t8_cmesh_helpers.h
903 views
1
/*
2
This file is part of t8code.
3
t8code is a C library to manage a collection (a forest) of multiple
4
connected adaptive space-trees of general element classes in parallel.
5
6
Copyright (C) 2023, 2024 the developers
7
8
t8code is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
12
13
t8code is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with t8code; if not, write to the Free Software Foundation, Inc.,
20
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
*/
22
23
/** \file t8_cmesh_helpers.h
24
*
25
* Collection of helper routines for building cmeshes.
26
*/
27
28
#ifndef T8_CMESH_HELPERS_H
29
#define T8_CMESH_HELPERS_H
30
31
#include <t8.h>
32
#include <t8_cmesh/t8_cmesh.h>
33
#include <t8_eclass.h>
34
35
T8_EXTERN_C_BEGIN ();
36
37
/** Sets the face connectivity information of an un-committed cmesh based on a list of tree vertices.
38
* \param[in,out] cmesh Pointer to a t8code cmesh object. If set to NULL this argument is ignored.
39
* \param[in] ntrees Number of coarse mesh elements resp. trees.
40
* \param[in] vertices List of per element vertices with dimensions
41
* [ntrees,T8_ECLASS_MAX_CORNERS,T8_ECLASS_MAX_DIM].
42
* \param[in] eclasses List of element classes of length [ntrees].
43
* \param[in,out] connectivity If connectivity is not NULL the variable is filled with a pointer to an
44
* allocated face connectivity array. The ownership of this
45
* array goes to the caller. This argument is mainly used for debugging and
46
* testing purposes. The dimension of \a connectivity are
47
* [ntrees,T8_ECLASS_MAX_FACES,3].
48
* For each element and each face the following is stored:
49
* neighbor_tree_id, neighbor_dual_face_id, orientation
50
* \param[in] do_both_directions Compute the connectivity from both neighboring sides.
51
* Takes much longer to compute.
52
*
53
* \warning This routine might be too expensive for very large meshes. In this case,
54
* consider to use a fully featured mesh generator.
55
*
56
* \note This routine does not detect periodic boundaries.
57
*/
58
void
59
t8_cmesh_set_join_by_vertices (t8_cmesh_t cmesh, const t8_gloidx_t ntrees, const t8_eclass_t *eclasses,
60
const double *vertices, int **connectivity, const int do_both_directions);
61
62
/** Sets the face connectivity information of an un-committed cmesh based on the cmesh stash.
63
* \param[in,out] cmesh An uncommitted cmesh. The trees eclasses and vertices do need to be set.
64
* \param[in,out] connectivity If connectivity is not NULL the variable is filled with a pointer to an
65
* allocated face connectivity array. The ownership of this
66
* array goes to the caller. This argument is mainly used for debugging and
67
* testing purposes. The dimension of \a connectivity are
68
* [ntrees,T8_ECLASS_MAX_FACES,3].
69
* For each element and each face the following is stored:
70
* neighbor_tree_id, neighbor_dual_face_id, orientation
71
* \param[in] do_both_directions Compute the connectivity from both neighboring sides. Takes much longer to compute.
72
*
73
* \warning This routine might be too expensive for very large meshes. In this case,
74
* consider to use a fully featured mesh generator.
75
*
76
* \note This routine does not detect periodic boundaries.
77
*/
78
void
79
t8_cmesh_set_join_by_stash (t8_cmesh_t cmesh, int **connectivity, const int do_both_directions);
80
81
T8_EXTERN_C_END ();
82
83
#endif /* !T8_CMESH_HELPERS_H */
84
85