t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_mesh.h
Go to the documentation of this file.
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) 2015 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 
35 #ifndef T8_MESH_H
36 #define T8_MESH_H
37 
38 #include <t8_element.h>
39 
40 typedef struct t8_mesh t8_mesh_t;
41 
42 /************************* preallocate **************************/
43 
44 t8_mesh_t *t8_mesh_new (int dimension,
45  t8_gloidx_t Kglobal, t8_locidx_t Klocal);
46 
47 /************* all-in-one convenience constructors **************/
48 
49 t8_mesh_t *t8_mesh_new_unitcube (t8_eclass_t theclass);
50 
51 /***************************** setters **************************/
52 
53 void t8_mesh_set_comm (t8_mesh_t *mesh, sc_MPI_Comm comm);
54 
58 void t8_mesh_set_partition (t8_mesh_t *mesh, int enable);
59 
60 void t8_mesh_set_element (t8_mesh_t *mesh,
61  t8_eclass_t theclass,
62  t8_gloidx_t gloid,
63  t8_locidx_t locid);
64 
65 void t8_mesh_set_local_to_global (t8_mesh_t *mesh,
66  t8_locidx_t ltog_length,
67  const t8_gloidx_t *ltog);
68 
69 void t8_mesh_set_face (t8_mesh_t *mesh,
70  t8_locidx_t locid1, int face1,
71  t8_locidx_t locid2, int face2,
72  int orientation);
73 
74 void t8_mesh_set_element_vertices (t8_mesh_t *mesh,
75  t8_locidx_t locid,
76  t8_locidx_t vids_length,
77  const t8_locidx_t *vids);
78 
79 /***************************** construct ************************/
80 
83 void t8_mesh_build (t8_mesh_t *mesh);
84 
85 /****************************** queries *************************/
86 
87 sc_MPI_Comm t8_mesh_get_comm (t8_mesh_t *mesh);
88 
89 t8_locidx_t t8_mesh_get_element_count (t8_mesh_t *mesh,
90  t8_eclass_t theclass);
91 
100  t8_locidx_t locid);
101 
102 t8_locidx_t t8_mesh_get_element_locid (t8_mesh_t *mesh,
103  t8_gloidx_t gloid);
104 
105 t8_gloidx_t t8_mesh_get_element_gloid (t8_mesh_t *mesh,
106  t8_locidx_t locid);
107 
108 t8_element_t t8_mesh_get_element (t8_mesh_t *mesh, t8_locidx_t locid);
109 
110 void t8_mesh_get_element_boundary (t8_mesh_t *mesh,
111  t8_locidx_t locid,
112  int length_boundary,
113  t8_locidx_t *elemid,
114  int *orientation);
115 
119 
124  t8_locidx_t locid,
125  int *length_support,
126  t8_locidx_t *elemid,
127  int *orientation);
128 
129 /***************************** destruct *************************/
130 
131 void t8_mesh_destroy (t8_mesh_t *mesh);
132 
133 #endif /* !T8_MESH_H */
Definition: t8_mesh.c:26
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:105
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:94
enum t8_eclass t8_eclass_t
This enumeration contains all possible element classes.
This file defines basic operations on an element in a refinement tree.
struct t8_element t8_element_t
Opaque structure for a generic element, only used as pointer.
Definition: t8_element.h:42
t8_locidx_t t8_mesh_get_element_class(t8_mesh_t *mesh, t8_locidx_t locid)
void t8_mesh_get_element_support(t8_mesh_t *mesh, t8_locidx_t locid, int *length_support, t8_locidx_t *elemid, int *orientation)
int t8_mesh_get_maximum_support(t8_mesh_t *mesh)
Return the maximum of the length of the support of any local element.
void t8_mesh_set_partition(t8_mesh_t *mesh, int enable)
Determine whether we partition in t8_mesh_build.
void t8_mesh_build(t8_mesh_t *mesh)
Setup a mesh and turn it into a usable object.
Definition: t8_mesh.c:44