~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to preprocessor/util/ecs_comm.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
 *  Local headers
 
30
 *----------------------------------------------------------------------------*/
 
31
 
 
32
#include "ecs_def.h"
 
33
 
 
34
/*----------------------------------------------------------------------------*/
 
35
 
 
36
#ifdef __cplusplus
 
37
extern "C" {
 
38
#if 0
 
39
} /* Fake brace to force Emacs auto-indentation back to column 0 */
 
40
#endif
 
41
#endif /* __cplusplus */
 
42
 
 
43
/*============================================================================
 
44
 * Type definitions
 
45
 *============================================================================*/
 
46
 
 
47
/* Opaque structure to handle file output */
 
48
 
 
49
typedef struct _ecs_comm_t ecs_comm_t ;
 
50
 
 
51
/*=============================================================================
 
52
 * Public function prototypes
 
53
 *============================================================================*/
 
54
 
 
55
/*----------------------------------------------------------------------------
 
56
 * Initialize a Kernel I/O file writer.
 
57
 *
 
58
 * returns:
 
59
 *   initialized Kernel I/O file writer
 
60
 *----------------------------------------------------------------------------*/
 
61
 
 
62
ecs_comm_t *
 
63
ecs_comm_initialize(const char  *file_name);
 
64
 
 
65
/*----------------------------------------------------------------------------
 
66
 * Close writer.
 
67
 *
 
68
 * arguments:
 
69
 *   comm <-- pointer to writer structure pointer
 
70
 *----------------------------------------------------------------------------*/
 
71
 
 
72
void
 
73
ecs_comm_finalize(ecs_comm_t **comm);
 
74
 
 
75
/*----------------------------------------------------------------------------
 
76
 * Write a section to the Kernel I/O file.
 
77
 *
 
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.
 
85
 *
 
86
 * arguments:
 
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
 *----------------------------------------------------------------------------*/
 
96
 
 
97
void
 
98
ecs_comm_write_section(const char  *name,
 
99
                       size_t       n_values,
 
100
                       size_t       location_id,
 
101
                       size_t       index_id,
 
102
                       size_t       n_location_values,
 
103
                       bool         embed,
 
104
                       const void  *values,
 
105
                       ecs_type_t   value_type,
 
106
                       ecs_comm_t  *comm);
 
107
 
 
108
/*----------------------------------------------------------------------------*/
 
109
 
 
110
#ifdef __cplusplus
 
111
}
 
112
#endif /* __cplusplus */
 
113
 
 
114
#endif /* __ECS_COMM_H__ */