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

« back to all changes in this revision

Viewing changes to src/fvm/fvm_to_ensight_case.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __FVM_TO_ENSIGHT_CASE_H__
 
2
#define __FVM_TO_ENSIGHT_CASE_H__
 
3
 
 
4
/*============================================================================
 
5
 * Manage case files associated with the EnSight Gold writer
 
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
 
 
30
/*----------------------------------------------------------------------------
 
31
 *  Local headers
 
32
 *----------------------------------------------------------------------------*/
 
33
 
 
34
#include "fvm_defs.h"
 
35
#include "fvm_nodal.h"
 
36
#include "fvm_writer.h"
 
37
 
 
38
/*----------------------------------------------------------------------------*/
 
39
 
 
40
#ifdef __cplusplus
 
41
extern "C" {
 
42
#if 0
 
43
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
 
44
#endif
 
45
#endif /* __cplusplus */
 
46
 
 
47
/*=============================================================================
 
48
 * Macro definitions
 
49
 *============================================================================*/
 
50
 
 
51
/*============================================================================
 
52
 * Type definitions
 
53
 *============================================================================*/
 
54
 
 
55
/* Opaque structure to manage case file */
 
56
 
 
57
typedef struct _fvm_to_ensight_case_t fvm_to_ensight_case_t;
 
58
 
 
59
/* Geometry or variable file info */
 
60
 
 
61
typedef struct {
 
62
 
 
63
  const char  * name;    /* Pointer to file name */
 
64
  _Bool         queried; /* Indicates if this file name has already been
 
65
                            returned by "fvm_to_ensight_case_get_..._file()"
 
66
                            (so we can decide to create or append to it) */
 
67
 
 
68
} fvm_to_ensight_case_file_info_t;
 
69
 
 
70
/*=============================================================================
 
71
 * Public function prototypes
 
72
 *============================================================================*/
 
73
 
 
74
/*----------------------------------------------------------------------------
 
75
 * Create a new case file structure.
 
76
 *
 
77
 * parameters:
 
78
 *   name            <-- case name
 
79
 *   dir_prefix      <-- associated local or absolute directory name
 
80
 *   time_dependency <-- indicates if and how meshes will change with time
 
81
 *
 
82
 * returns:
 
83
 *   pointer to new case file structure
 
84
 *----------------------------------------------------------------------------*/
 
85
 
 
86
fvm_to_ensight_case_t *
 
87
fvm_to_ensight_case_create(const char                   *const name,
 
88
                           const char                   *const dir_prefix,
 
89
                           const fvm_writer_time_dep_t         time_dependency);
 
90
 
 
91
/*----------------------------------------------------------------------------
 
92
 * Destroy a case file structure.
 
93
 *
 
94
 * parameters:
 
95
 *   this_case  <-- case structure
 
96
 *
 
97
 * returns:
 
98
 *   NULL pointer
 
99
 *----------------------------------------------------------------------------*/
 
100
 
 
101
fvm_to_ensight_case_t *
 
102
fvm_to_ensight_case_destroy(fvm_to_ensight_case_t  *this_case);
 
103
 
 
104
/*----------------------------------------------------------------------------
 
105
 * Return time dependency status of an EnSight geometry.
 
106
 *
 
107
 * parameters:
 
108
 *   this_case  <-- case structure
 
109
 *
 
110
 * returns:
 
111
 *   time dependency status
 
112
 *----------------------------------------------------------------------------*/
 
113
 
 
114
fvm_writer_time_dep_t
 
115
fvm_to_ensight_case_get_time_dep(fvm_to_ensight_case_t  *this_case);
 
116
 
 
117
/*----------------------------------------------------------------------------
 
118
 * Associate new time step with an EnSight geometry.
 
119
 *
 
120
 * parameters:
 
121
 *   this_case  <-- case structure
 
122
 *   time_step  <-- time step number
 
123
 *   time_value <-- time_value number
 
124
 *
 
125
 * returns:
 
126
 *   0 if no time was added, 1 if a new time was added
 
127
 *----------------------------------------------------------------------------*/
 
128
 
 
129
int
 
130
fvm_to_ensight_case_set_geom_time(fvm_to_ensight_case_t  *const this_case,
 
131
                                  const int                     time_step,
 
132
                                  const double                  time_value);
 
133
 
 
134
/*----------------------------------------------------------------------------
 
135
 * Return current file name and "queried" indicator associated with an
 
136
 * EnSight geometry.
 
137
 *
 
138
 * The "queried" flag in the info structure is set to "false" the first
 
139
 * time this function returns a given file name, and to "true" all other
 
140
 * times.
 
141
 *
 
142
 * parameters:
 
143
 *   this_case  <-- case structure
 
144
 *
 
145
 * returns:
 
146
 *   Info structure for geometry file
 
147
 *----------------------------------------------------------------------------*/
 
148
 
 
149
fvm_to_ensight_case_file_info_t
 
150
fvm_to_ensight_case_get_geom_file(fvm_to_ensight_case_t  *const this_case);
 
151
 
 
152
/*----------------------------------------------------------------------------
 
153
 * Associate a part name with a case and return its number.
 
154
 * If the part was already associated, zero is returned.
 
155
 *
 
156
 * parameters:
 
157
 *   this_case  <-- case structure
 
158
 *   part_name  <-- part name
 
159
 *
 
160
 * returns:
 
161
 *   part number in case, or 0 if part already associated
 
162
 *----------------------------------------------------------------------------*/
 
163
 
 
164
int
 
165
fvm_to_ensight_case_add_part(fvm_to_ensight_case_t  *const this_case,
 
166
                             const char             *const part_name);
 
167
 
 
168
/*----------------------------------------------------------------------------
 
169
 * Return the part number associated with a given part name, or 0
 
170
 *
 
171
 * parameters:
 
172
 *   this_case  <-- case structure
 
173
 *   part_name  <-- part name
 
174
 *
 
175
 * returns:
 
176
 *   part number in case, or 0 if part name is not associated with this case
 
177
 *----------------------------------------------------------------------------*/
 
178
 
 
179
int
 
180
fvm_to_ensight_case_get_part_num(fvm_to_ensight_case_t  *const this_case,
 
181
                                 const char             *const part_name);
 
182
 
 
183
/*----------------------------------------------------------------------------
 
184
 * Return current file name and "queried" indicator associated with an
 
185
 * EnSight variable.
 
186
 *
 
187
 * The "queried" flag in the info structure is set to "false" the first
 
188
 * time this function returns a given file name, and to "true" all other
 
189
 * times.
 
190
 *
 
191
 * if the corresponding variable or physical time are not present in the
 
192
 * structure, the necessary elements are added.
 
193
 *
 
194
 * parameters:
 
195
 *   this_case  <-> pointer to structure that should be updated
 
196
 *   name       <-- variable name
 
197
 *   dimension  <-- variable dimension (0: constant, 1: scalar, 3: vector,
 
198
 *                  6: symmetrical tensor, 9: asymmetrical tensor)
 
199
 *   location   <-- variable definition location (nodes, elements, or particles)
 
200
 *   time_step  <-- number of time step to add
 
201
 *   time_value <-- associated time value
 
202
 *
 
203
 * returns:
 
204
 *   Info structure for file associated with the variable
 
205
 *----------------------------------------------------------------------------*/
 
206
 
 
207
fvm_to_ensight_case_file_info_t
 
208
fvm_to_ensight_case_get_var_file(fvm_to_ensight_case_t       *const this_case,
 
209
                                 const char                  *const name,
 
210
                                 const int                          dimension,
 
211
                                 const fvm_writer_var_loc_t         location,
 
212
                                 const int                          time_step,
 
213
                                 const double                       time_value);
 
214
 
 
215
/*----------------------------------------------------------------------------
 
216
 * Write an EnSight Gold case file.
 
217
 *
 
218
 * parameters:
 
219
 *   this_case  <-- case structure
 
220
 *   rank       <-- calling rank in case of parallelism
 
221
 *----------------------------------------------------------------------------*/
 
222
 
 
223
void
 
224
fvm_to_ensight_case_write_case(fvm_to_ensight_case_t  *this_case,
 
225
                               int                     rank);
 
226
 
 
227
/*----------------------------------------------------------------------------*/
 
228
 
 
229
#ifdef __cplusplus
 
230
}
 
231
#endif /* __cplusplus */
 
232
 
 
233
#endif /* __FVM_TO_ENSIGHT_CASE_H__ */