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_tetgen.h
927 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_tetgen.h
24
* We define function here that serve to open a mesh file generated by
25
* TETGEN and constructing a cmesh from it.
26
*/
27
28
#ifndef T8_CMESH_TETGEN_H
29
#define T8_CMESH_TETGEN_H
30
31
#include <t8.h>
32
#include <t8_eclass.h>
33
#include <t8_cmesh/t8_cmesh.h>
34
#include <sc_flops.h>
35
#include <sc_statistics.h>
36
#include <sc_options.h>
37
38
/* put typedefs here */
39
40
T8_EXTERN_C_BEGIN ();
41
42
/* put declarations here */
43
44
/** Open a .node, .ele and .neigh file created by TETGEN to read
45
* and create a cmesh from them. The cmesh will be replicated.
46
* The files are opened and read by one process and the cmesh is then
47
* broadcasted to the other processes.
48
* \param [in] fileprefix A string holding the prefix of the TETGEN files.
49
* The files \a fileprefix.node, \a fileprefix.ele and
50
* \a fileprefix.neigh are read.
51
* \param [in] partition In the future this flag can decide whether the returned
52
* cmesh is partitioned or not. Currently it is always replicated.
53
* \param [in] comm The mpi communicator to be used.
54
* \param [in] do_dup Whether \a comm should be duplicated by cmesh.
55
* \return A committed, replicated cmesh constructed from the info
56
* in the TETGEN files.
57
*/
58
t8_cmesh_t
59
t8_cmesh_from_tetgen_file (char *fileprefix, int partition, sc_MPI_Comm comm, int do_dup);
60
61
/** Same as \ref t8_cmesh_from_tetgen_file but with flop and stat info.
62
* \param [in] fileprefix A string holding the prefix of the TETGEN files.
63
* The files \a fileprefix.node, \a fileprefix.ele and
64
* \a fileprefix.neigh are read.
65
* \param [in] partition In the future this flag can decide whether the returned
66
* cmesh is partitioned or not. Currently it is always replicated.
67
* \param [in] comm The mpi communicator to be used.
68
* \param [in] do_dup Whether \a comm should be duplicated by cmesh.
69
* \param [in,out] fi The flopinfo struct to use for flop counting.
70
* \param [out] snapshot On output is a copy of fi.
71
* \param [in,out] stats The statinfo array to use for statistics.
72
* \param [in] statentry The index in \a stats to use for statistics.
73
* \return A committed, replicated cmesh constructed from the info
74
* in the TETGEN files.
75
*/
76
t8_cmesh_t
77
t8_cmesh_from_tetgen_file_time (char *fileprefix, int partition, sc_MPI_Comm comm, int do_dup, sc_flopinfo_t *fi,
78
sc_flopinfo_t *snapshot, sc_statinfo_t *stats, int statentry);
79
80
T8_EXTERN_C_END ();
81
82
#endif /* !T8_CMESH_TETGEN_H */
83
84