t8  1.2.0
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 /* *INDENT-OFF* */
41 const int
42 t8_cmesh_supported_msh_file_versions[T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS] =
43 {
44  2, 4
45 };
46 /* *INDENT-ON* */
47 
48 /* put typedefs here */
49 
50 /* The nodes are stored in the .msh file in the format
51  *
52  * $Nodes
53  * n_nodes // The number of nodes
54  * i x_i y_i z_i // the node index and the node coordinates
55  * j x_j y_j z_j
56  * .....
57  * $EndNodes
58  *
59  * The node indices do not need to be in consecutive order.
60  * We thus use a hash table to read all node indices and coordinates.
61  * The hash value is the node index modulo the number of nodes.
62  */
63 typedef struct
64 {
65  t8_locidx_t index;
66  double coordinates[3];
68 
69 typedef struct
70 {
71  t8_locidx_t index;
72  double coordinates[3];
73  double parameters[2];
74  int parametric;
75  int entity_dim;
76  t8_locidx_t entity_tag;
78 
79 T8_EXTERN_C_BEGIN ();
80 
81 /* put declarations here */
82 
101 /* *INDENT-OFF* */
103 t8_cmesh_from_msh_file (const char *fileprefix, int partition,
104  sc_MPI_Comm comm, int dim, int master,
105  int use_occ_geometry);
106 /* *INDENT-ON* */
107 
108 T8_EXTERN_C_END ();
109 
110 #endif /* !T8_CMESH_READMSHFILE_H */
This structure holds the connectivity data of the coarse mesh.
Definition: t8_cmesh_types.h:83
Definition: t8_cmesh_readmshfile.h:70
Definition: t8_cmesh_readmshfile.h:64
This is the administrative header file for t8code.
int32_t t8_locidx_t
A type for processor-local indexing.
Definition: t8.h:94
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_occ_geometry)
Read a .msh file and create a cmesh from it.
Definition: t8_cmesh_readmshfile.cxx:1804
We define all possible element classes that occur in hybrid meshes.