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_save.h
921 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_save.h
24
* We define routines to save and load a cmesh to/from the file system.
25
*/
26
27
#ifndef T8_CMESH_SAVE_H
28
#define T8_CMESH_SAVE_H
29
30
#include <t8.h>
31
32
/** Increment this constant each time the file format changes.
33
* We can only read files that were written in the same format. */
34
#define T8_CMESH_FORMAT 0x0002
35
36
/** This enumeration contains all modes in which we can open a saved cmesh.
37
* The cmesh can be loaded with more processes than it was saved and the
38
* mode controls, which of the processes open files and distribute the data.
39
*/
40
typedef enum t8_load_mode {
41
/** First mode. */
42
T8_LOAD_FIRST = 0,
43
/** In simple mode, the first n processes load the file */
44
T8_LOAD_SIMPLE = T8_LOAD_FIRST,
45
/** In BGQ mode, the file is loaded on n nodes and from one process of each node.
46
* This needs MPI Version 3.1 or higher. */
47
T8_LOAD_BGQ,
48
/** Every n-th process loads a file. Handle with care, we introduce
49
* it, since on Juqueen MPI-3 was not available.
50
* The parameter n has to be passed as an extra parameter.
51
* \see t8_cmesh_load_and_distribute */
52
T8_LOAD_STRIDE,
53
/** Number of modes in which we can open a saved cmesh. */
54
T8_LOAD_COUNT
55
} t8_load_mode_t;
56
57
T8_EXTERN_C_BEGIN ();
58
59
T8_EXTERN_C_END ();
60
61
#endif /* !T8_CMESH_SAVE_H */
62
63