t8  UNKNOWN
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 *
45 t8_mesh_new (int dimension, t8_gloidx_t Kglobal, t8_locidx_t Klocal);
46 
47 /************* all-in-one convenience constructors **************/
48 
49 t8_mesh_t *
50 t8_mesh_new_unitcube (t8_eclass_t theclass);
51 
52 /***************************** setters **************************/
53 
54 void
55 t8_mesh_set_comm (t8_mesh_t *mesh, sc_MPI_Comm comm);
56 
60 void
61 t8_mesh_set_partition (t8_mesh_t *mesh, int enable);
62 
63 void
64 t8_mesh_set_element (t8_mesh_t *mesh, t8_eclass_t theclass, t8_gloidx_t gloid, t8_locidx_t locid);
65 
66 void
67 t8_mesh_set_local_to_global (t8_mesh_t *mesh, t8_locidx_t ltog_length, const t8_gloidx_t *ltog);
68 
69 void
70 t8_mesh_set_face (t8_mesh_t *mesh, t8_locidx_t locid1, int face1, t8_locidx_t locid2, int face2, int orientation);
71 
72 void
73 t8_mesh_set_element_vertices (t8_mesh_t *mesh, t8_locidx_t locid, t8_locidx_t vids_length, const t8_locidx_t *vids);
74 
75 /***************************** construct ************************/
76 
79 void
80 t8_mesh_build (t8_mesh_t *mesh);
81 
82 /****************************** queries *************************/
83 
84 sc_MPI_Comm
85 t8_mesh_get_comm (t8_mesh_t *mesh);
86 
88 t8_mesh_get_element_count (t8_mesh_t *mesh, t8_eclass_t theclass);
89 
99 
101 t8_mesh_get_element_locid (t8_mesh_t *mesh, t8_gloidx_t gloid);
102 
104 t8_mesh_get_element_gloid (t8_mesh_t *mesh, t8_locidx_t locid);
105 
107 t8_mesh_get_element (t8_mesh_t *mesh, t8_locidx_t locid);
108 
109 void
110 t8_mesh_get_element_boundary (t8_mesh_t *mesh, t8_locidx_t locid, int length_boundary, t8_locidx_t *elemid,
111  int *orientation);
112 
115 int
117 
121 void
122 t8_mesh_get_element_support (t8_mesh_t *mesh, t8_locidx_t locid, int *length_support, t8_locidx_t *elemid,
123  int *orientation);
124 
125 /***************************** destruct *************************/
126 
127 void
128 t8_mesh_destroy (t8_mesh_t *mesh);
129 
130 #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:100
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:89
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