4
/*============================================================================
5
* Base functions for writing Kernel I/O files.
6
*============================================================================*/
9
This file is part of Code_Saturne, a general-purpose CFD tool.
11
Copyright (C) 1998-2011 EDF S.A.
13
This program is free software; you can redistribute it and/or modify it under
14
the terms of the GNU General Public License as published by the Free Software
15
Foundation; either version 2 of the License, or (at your option) any later
18
This program is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23
You should have received a copy of the GNU General Public License along with
24
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25
Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
/*----------------------------------------------------------------------------
30
*----------------------------------------------------------------------------*/
34
/*----------------------------------------------------------------------------*/
39
} /* Fake brace to force Emacs auto-indentation back to column 0 */
41
#endif /* __cplusplus */
43
/*============================================================================
45
*============================================================================*/
47
/* Opaque structure to handle file output */
49
typedef struct _ecs_comm_t ecs_comm_t ;
51
/*=============================================================================
52
* Public function prototypes
53
*============================================================================*/
55
/*----------------------------------------------------------------------------
56
* Initialize a Kernel I/O file writer.
59
* initialized Kernel I/O file writer
60
*----------------------------------------------------------------------------*/
63
ecs_comm_initialize(const char *file_name);
65
/*----------------------------------------------------------------------------
69
* comm <-- pointer to writer structure pointer
70
*----------------------------------------------------------------------------*/
73
ecs_comm_finalize(ecs_comm_t **comm);
75
/*----------------------------------------------------------------------------
76
* Write a section to the Kernel I/O file.
78
* Grid locations and possibly indexes may be assigned to a section by
79
* specifying a location id; the first time a given location id appears in
80
* the file is considered a declaration. In the same manner, an index id
81
* may be specified. Values of zero indicate no location or index base
82
* is used. It is up to the calling code to ensure that total number of
83
* values, location size, and number of values per location are consistent,
84
* as this my be important for code reading the file.
87
* name <-- section name
88
* location_id <-- id of associated location
89
* index_id <-- id of associated index
90
* n_location_values <-- number of values per location
91
* embed <-- embed values in header
92
* values <-- values to write
93
* value_type <-- type of value to write
94
* comm <-- Kernel I/O file output structure
95
*----------------------------------------------------------------------------*/
98
ecs_comm_write_section(const char *name,
102
size_t n_location_values,
105
ecs_type_t value_type,
108
/*----------------------------------------------------------------------------*/
112
#endif /* __cplusplus */
114
#endif /* __ECS_COMM_H__ */