FMS  v0.2
Field and Mesh Specification
fmsio.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at
3  the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
4  reserved. See files LICENSE and NOTICE for details.
5 
6  This file is part of CEED, a collection of benchmarks, miniapps, software
7  libraries and APIs for efficient high-order finite element and spectral
8  element discretizations for exascale applications. For more information and
9  source code availability see http://github.com/ceed.
10 
11  The CEED research is supported by the Exascale Computing Project (17-SC-20-SC)
12  a collaborative effort of two U.S. Department of Energy organizations (Office
13  of Science and the National Nuclear Security Administration) responsible for
14  the planning and preparation of a capable exascale ecosystem, including
15  software, applications, hardware, advanced system engineering and early
16  testbed platforms, in support of the nation's exascale computing imperative.
17 */
18 
19 /** @file fmsio.h
20  FMS file I/O functions.
21  Header file added in version: v0.2. */
22 
23 #ifndef FMS_IO_HEADER
24 #define FMS_IO_HEADER
25 #include <fms.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /**
32 @brief Writes the provided FmsDataCollection to a file.
33 @param filename The name of the file to save. If the filename does not include
34  an appropriate file extension, one may be added.
35 @param protocol The type of file to be saved. By default, the protocol should be
36  "ascii". If FMS is compiled with Conduit support then the
37  protocol can match the supported Conduit protocols, which can
38  include: "json", "yaml", "conduit_bin", "hdf5".
39 @param dc The FMS object that will be written to the file.
40 @return The function returns 0 on success and non-zero for failure.
41  If Conduit support is enabled then a return value of 2 indicates the
42  given protocol is unsupported by the Conduit runtime.
43 
44 Added in version: v0.2.
45 */
46 int FmsIOWrite(const char *filename, const char *protocol,
48 
49 /**
50 @brief Reads an FmsDataCollection from a file.
51 @param filename The name of the file to read.
52 @param protocol The type of file to be read. By default, the protocol should be
53  "ascii". If FMS is compiled with Conduit support then the
54  protocol can match the supported Conduit protocols, which can
55  include: "json", "yaml", "conduit_bin", "hdf5". Adding a
56  protocol will help FMS and Conduit decide which method is
57  appropriate for reading the file. If Conduit support is enabled
58  and protocol is NULL an educated guess will be made for which
59  protocol to use.
60 @param[out] dc The FMS object that was read from the file.
61 @return The function returns 0 on success and non-zero for failure.
62  If Conduit support is enabled then a return value of 2 indicates the
63  given protocol is unsupported by the Conduit runtime.
64 
65 Added in version: v0.2.
66 */
67 int FmsIORead(const char *filename, const char *protocol,
68  FmsDataCollection *dc);
69 
70 
71 #ifdef __cplusplus
72 } // extern "C"
73 #endif
74 
75 #endif // FMS_IO_HEADER
int FmsIORead(const char *filename, const char *protocol, FmsDataCollection *dc)
Reads an FmsDataCollection from a file.
Definition: fmsio.c:3524
struct FmsDataCollection_private * FmsDataCollection
Data collection type: contains a mesh, discrete fileds, meta-data, etc.
Definition: fms.h:447
int FmsIOWrite(const char *filename, const char *protocol, FmsDataCollection dc)
Writes the provided FmsDataCollection to a file.
Definition: fmsio.c:3471