1
#ifndef __FVM_TO_ENSIGHT_CASE_H__
2
#define __FVM_TO_ENSIGHT_CASE_H__
4
/*============================================================================
5
* Manage case files associated with the EnSight Gold writer
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
/*----------------------------------------------------------------------------
32
*----------------------------------------------------------------------------*/
35
#include "fvm_nodal.h"
36
#include "fvm_writer.h"
38
/*----------------------------------------------------------------------------*/
43
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
45
#endif /* __cplusplus */
47
/*=============================================================================
49
*============================================================================*/
51
/*============================================================================
53
*============================================================================*/
55
/* Opaque structure to manage case file */
57
typedef struct _fvm_to_ensight_case_t fvm_to_ensight_case_t;
59
/* Geometry or variable file info */
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) */
68
} fvm_to_ensight_case_file_info_t;
70
/*=============================================================================
71
* Public function prototypes
72
*============================================================================*/
74
/*----------------------------------------------------------------------------
75
* Create a new case file structure.
79
* dir_prefix <-- associated local or absolute directory name
80
* time_dependency <-- indicates if and how meshes will change with time
83
* pointer to new case file structure
84
*----------------------------------------------------------------------------*/
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);
91
/*----------------------------------------------------------------------------
92
* Destroy a case file structure.
95
* this_case <-- case structure
99
*----------------------------------------------------------------------------*/
101
fvm_to_ensight_case_t *
102
fvm_to_ensight_case_destroy(fvm_to_ensight_case_t *this_case);
104
/*----------------------------------------------------------------------------
105
* Return time dependency status of an EnSight geometry.
108
* this_case <-- case structure
111
* time dependency status
112
*----------------------------------------------------------------------------*/
114
fvm_writer_time_dep_t
115
fvm_to_ensight_case_get_time_dep(fvm_to_ensight_case_t *this_case);
117
/*----------------------------------------------------------------------------
118
* Associate new time step with an EnSight geometry.
121
* this_case <-- case structure
122
* time_step <-- time step number
123
* time_value <-- time_value number
126
* 0 if no time was added, 1 if a new time was added
127
*----------------------------------------------------------------------------*/
130
fvm_to_ensight_case_set_geom_time(fvm_to_ensight_case_t *const this_case,
132
const double time_value);
134
/*----------------------------------------------------------------------------
135
* Return current file name and "queried" indicator associated with an
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
143
* this_case <-- case structure
146
* Info structure for geometry file
147
*----------------------------------------------------------------------------*/
149
fvm_to_ensight_case_file_info_t
150
fvm_to_ensight_case_get_geom_file(fvm_to_ensight_case_t *const this_case);
152
/*----------------------------------------------------------------------------
153
* Associate a part name with a case and return its number.
154
* If the part was already associated, zero is returned.
157
* this_case <-- case structure
158
* part_name <-- part name
161
* part number in case, or 0 if part already associated
162
*----------------------------------------------------------------------------*/
165
fvm_to_ensight_case_add_part(fvm_to_ensight_case_t *const this_case,
166
const char *const part_name);
168
/*----------------------------------------------------------------------------
169
* Return the part number associated with a given part name, or 0
172
* this_case <-- case structure
173
* part_name <-- part name
176
* part number in case, or 0 if part name is not associated with this case
177
*----------------------------------------------------------------------------*/
180
fvm_to_ensight_case_get_part_num(fvm_to_ensight_case_t *const this_case,
181
const char *const part_name);
183
/*----------------------------------------------------------------------------
184
* Return current file name and "queried" indicator associated with an
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
191
* if the corresponding variable or physical time are not present in the
192
* structure, the necessary elements are added.
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
204
* Info structure for file associated with the variable
205
*----------------------------------------------------------------------------*/
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,
211
const fvm_writer_var_loc_t location,
213
const double time_value);
215
/*----------------------------------------------------------------------------
216
* Write an EnSight Gold case file.
219
* this_case <-- case structure
220
* rank <-- calling rank in case of parallelism
221
*----------------------------------------------------------------------------*/
224
fvm_to_ensight_case_write_case(fvm_to_ensight_case_t *this_case,
227
/*----------------------------------------------------------------------------*/
231
#endif /* __cplusplus */
233
#endif /* __FVM_TO_ENSIGHT_CASE_H__ */