Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/src/t8_cmesh/t8_cmesh_io/t8_cmesh_readmshfile.h
926 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) 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
23
/** \file t8_cmesh_readmshfile.h
24
* We define a function here that serves to open a mesh file generated by
25
* GMSH and constructing a cmesh from it.
26
*/
27
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/t8_cmesh.h>
34
35
/** The supported .msh file versions.
36
* Currently, we only support gmsh's file version 4 in ASCII format.
37
*/
38
#define T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS 1
39
40
/** The gmsh file versions that are supported. Currently version 4 in ASCII format */
41
const int t8_cmesh_supported_msh_file_versions[T8_CMESH_N_SUPPORTED_MSH_FILE_VERSIONS] = { 4 };
42
43
T8_EXTERN_C_BEGIN ();
44
45
/* put declarations here */
46
47
/** Read a .msh file and create a cmesh from it.
48
* \param [in] fileprefix The prefix of the mesh file.
49
* The file fileprefix.msh is read.
50
* \param [in] partition If true the file is only opened on one process
51
* specified by the \a master argument and saved as
52
* a partitioned cmesh where each other process does not
53
* have any trees.
54
* \param [in] comm The MPI communicator with which the cmesh is to be committed.
55
* \param [in] dim The dimension to read from the .msh files. The .msh format
56
* can store several dimensions of the mesh and therefore the
57
* dimension to read has to be set manually.
58
* \param [in] master If partition is true, a valid MPI rank that will
59
* read the file and store all the trees alone.
60
* \param [in] use_cad_geometry Read the parameters of a parametric msh file and use the
61
* cad geometry.
62
* \return A committed cmesh holding the mesh of dimension \a dim in the
63
* specified .msh file.
64
*/
65
t8_cmesh_t
66
t8_cmesh_from_msh_file (const char *fileprefix, int partition, sc_MPI_Comm comm, int dim, int master,
67
int use_cad_geometry);
68
69
T8_EXTERN_C_END ();
70
71
#endif /* !T8_CMESH_READMSHFILE_H */
72
73