t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_cmesh_readmshfile.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 
28 #ifndef T8_CMESH_READMSHFILE_H
29 #define T8_CMESH_READMSHFILE_H
30 
31 #include <t8.h>
32 #include <t8_eclass.h>
33 #include <t8_cmesh.h>
34 
35 /* The supported .msh file versions.
36  * Currently, we support gmsh's file version 2 and 4 in ASCII format.
37  */
38 #define T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS 2
39 
40 const int t8_cmesh_supported_msh_file_versions[T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS] = { 2, 4 };
41 
42 /* put typedefs here */
43 
44 /* The nodes are stored in the .msh file in the format
45  *
46  * $Nodes
47  * n_nodes // The number of nodes
48  * i x_i y_i z_i // the node index and the node coordinates
49  * j x_j y_j z_j
50  * .....
51  * $EndNodes
52  *
53  * The node indices do not need to be in consecutive order.
54  * We thus use a hash table to read all node indices and coordinates.
55  * The hash value is the node index modulo the number of nodes.
56  */
57 typedef struct
58 {
59  t8_locidx_t index;
60  double coordinates[3];
62 
63 typedef struct
64 {
65  t8_locidx_t index;
66  double coordinates[3];
67  double parameters[2];
68  int parametric;
69  int entity_dim;
70  t8_locidx_t entity_tag;
72 
73 T8_EXTERN_C_BEGIN ();
74 
75 /* put declarations here */
76 
96 t8_cmesh_from_msh_file (const char *fileprefix, int partition, sc_MPI_Comm comm, int dim, int master,
97  int use_cad_geometry);
98 
99 T8_EXTERN_C_END ();
100 
101 #endif /* !T8_CMESH_READMSHFILE_H */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:88
Definition: t8_cmesh_readmshfile.h:64
Definition: t8_cmesh_readmshfile.h:58
This is the administrative header file for t8code.
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:89
We define the coarse mesh of trees in this file.
t8_cmesh_t t8_cmesh_from_msh_file(const char *fileprefix, int partition, sc_MPI_Comm comm, int dim, int master, int use_cad_geometry)
Read a .msh file and create a cmesh from it.
Definition: t8_cmesh_readmshfile.cxx:1754
We define all possible element classes that occur in hybrid meshes.