Code_Saturne
CFD tool
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ecs_comm.h
Go to the documentation of this file.
1 #ifndef __ECS_COMM_H__
2 #define __ECS_COMM_H__
3 
4 /*============================================================================
5  * Base functions for writing Kernel I/O files.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2012 EDF S.A.
12 
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
16  version.
17 
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
21  details.
22 
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.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 #include "ecs_def.h"
31 
33 
34 /*============================================================================
35  * Type definitions
36  *============================================================================*/
37 
38 /* Opaque structure to handle file output */
39 
40 typedef struct _ecs_comm_t ecs_comm_t;
41 
42 /*=============================================================================
43  * Public function prototypes
44  *============================================================================*/
45 
46 /*----------------------------------------------------------------------------
47  * Initialize a Kernel I/O file writer.
48  *
49  * returns:
50  * initialized Kernel I/O file writer
51  *----------------------------------------------------------------------------*/
52 
53 ecs_comm_t *
54 ecs_comm_initialize(const char *file_name);
55 
56 /*----------------------------------------------------------------------------
57  * Close writer.
58  *
59  * arguments:
60  * comm <-- pointer to writer structure pointer
61  *----------------------------------------------------------------------------*/
62 
63 void
65 
66 /*----------------------------------------------------------------------------
67  * Write a section to the Kernel I/O file.
68  *
69  * Grid locations and possibly indexes may be assigned to a section by
70  * specifying a location id; the first time a given location id appears in
71  * the file is considered a declaration. In the same manner, an index id
72  * may be specified. Values of zero indicate no location or index base
73  * is used. It is up to the calling code to ensure that total number of
74  * values, location size, and number of values per location are consistent,
75  * as this my be important for code reading the file.
76  *
77  * arguments:
78  * name <-- section name
79  * location_id <-- id of associated location
80  * index_id <-- id of associated index
81  * n_location_values <-- number of values per location
82  * embed <-- embed values in header
83  * values <-- values to write
84  * value_type <-- type of value to write
85  * comm <-- Kernel I/O file output structure
86  *----------------------------------------------------------------------------*/
87 
88 void
89 ecs_comm_write_section(const char *name,
90  size_t n_values,
91  size_t location_id,
92  size_t index_id,
93  size_t n_location_values,
94  bool embed,
95  const void *values,
96  ecs_type_t value_type,
97  ecs_comm_t *comm);
98 
99 /*----------------------------------------------------------------------------*/
100 
102 
103 #endif /* __ECS_COMM_H__ */
typedefBEGIN_C_DECLS struct _ecs_comm_t ecs_comm_t
Definition: ecs_comm.h:40
ecs_comm_t * ecs_comm_initialize(const char *file_name)
Definition: ecs_comm.c:258
#define BEGIN_C_DECLS
Definition: ecs_def.h:234
Definition: ecs_comm.c:69
char * name
Definition: ecs_comm.c:71
void ecs_comm_write_section(const char *name, size_t n_values, size_t location_id, size_t index_id, size_t n_location_values, bool embed, const void *values, ecs_type_t value_type, ecs_comm_t *comm)
Definition: ecs_comm.c:349
void ecs_comm_finalize(ecs_comm_t **comm)
Definition: ecs_comm.c:307
ecs_type_t
Definition: ecs_def.h:138
#define END_C_DECLS
Definition: ecs_def.h:235