1
#ifndef __CS_TIME_PLOT_H__
2
#define __CS_TIME_PLOT_H__
4
/*============================================================================
5
* Time_Plot helper structures
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
*----------------------------------------------------------------------------*/
36
/*----------------------------------------------------------------------------*/
40
/*============================================================================
42
*============================================================================*/
44
/*============================================================================
46
*============================================================================*/
48
typedef struct _cs_time_plot_t cs_time_plot_t;
50
/*============================================================================
51
* Local type definitions
52
*============================================================================*/
54
/* Type of 1D plot file format */
57
CS_TIME_PLOT_DAT, /* .dat file (usable by Qtplot or Grace) */
58
CS_TIME_PLOT_CSV /* .csv file (readable by ParaView or spreadsheat) */
59
} cs_time_plot_format_t;
61
/*============================================================================
63
*============================================================================*/
65
/*=============================================================================
66
* Public function prototypes for Fortran API
67
*============================================================================*/
69
/*----------------------------------------------------------------------------
70
* Create a writer for time plot probe-type data.
72
* This subroutine should only be called by one rank for a given data series.
74
* subroutine tppini (tplnum, tplnam, tplpre, tplfmt, idtvar,
76
* ntflsh, wtflsh, nprb, lstprb, xyzprb,
79
* integer tplnum : <-- : number of plot to create (> 0)
80
* character tplnam : <-- : name of associated plot
81
* character tplpre : <-- : prefix for associated file
82
* integer tplfmt : <-- : associated format
83
* (1: dat, 2: csv, 3: both)
84
* integer idtvar : <-- : calculation time dependency
85
* integer ntflsh : <-- : file write every ntflsh output
86
* time steps if > 0 (file kept
88
* integer wtflsh : <-- : file flush forced every wtflsh
89
* elapsed seconds if > 0
90
* integer nprb : <-- : number of probes
91
* integer lstprb : <-- : list of probes (1 to n)
92
* double precision xyzprb : <-- : probe coordinates
93
* integer lnam : <-- : name length
94
* integer lpre : <-- : prefix length
95
*----------------------------------------------------------------------------*/
97
void CS_PROCF (tppini, TPPINI)
99
const cs_int_t *tplnum,
102
const cs_int_t *tplfmt,
103
const cs_int_t *idtvar,
104
const cs_int_t *ntflsh,
105
const cs_real_t *wtflsh,
106
const cs_int_t *nprb,
107
const cs_int_t *lstprb,
108
const cs_real_t *xyzprb,
109
const cs_int_t *lnam,
111
CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
112
by many Fortran compilers) */
115
/*----------------------------------------------------------------------------
116
* Create a writer for time plot structure-type data.
118
* This subroutine should only be called by one rank for a given data series.
120
* subroutine tpsini (tplnum, tplnam, tplpre, tplfmt, idtvar,
122
* ntflsh, wtflsh, nprb, lstprb, xyzprb,
125
* integer tplnum : <-- : number of plot to create (> 0)
126
* character tplnam : <-- : name of associated plot
127
* character tplpre : <-- : prefix for associated file
128
* integer tplfmt : <-- : associated format
129
* (1: dat, 2: csv, 3: both)
130
* integer idtvar : <-- : calculation time dependency
131
* integer ntflsh : <-- : file write every ntflsh output
132
* time steps if > 0 (file kept
134
* integer wtflsh : <-- : file flush forced every wtflsh
135
* elapsed seconds if > 0
136
* integer nstru : <-- : number of structures
137
* double precision xmstru : <-- : mass matrixes
138
* double precision xcstru : <-- : damping matrixes
139
* double precision xkstru : <-- : stiffness matrixes
140
* integer lnam : <-- : name length
141
* integer lpre : <-- : prefix length
142
*----------------------------------------------------------------------------*/
144
void CS_PROCF (tpsini, TPPINI)
146
const cs_int_t *tplnum,
149
const cs_int_t *tplfmt,
150
const cs_int_t *idtvar,
151
const cs_int_t *ntflsh,
152
const cs_real_t *wtflsh,
153
const cs_int_t *nstru,
154
const cs_real_t *xmstru,
155
const cs_real_t *xcstru,
156
const cs_real_t *xkstru,
157
const cs_int_t *lnam,
159
CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
160
by many Fortran compilers) */
163
/*----------------------------------------------------------------------------
164
* Finalize a writer for time plot data.
166
* This subroutine should only be called by one rank for a given data series.
168
* subroutine tplend (tplnum)
171
* integer tplnum : <-- : number of plot to create (> 0)
172
* integer tplfmt : <-- : associated format
173
* (1: dat, 2: csv, 3: both)
174
*----------------------------------------------------------------------------*/
176
void CS_PROCF (tplend, TPLEND)
178
const cs_int_t *tplnum,
179
const cs_int_t *tplfmt
182
/*----------------------------------------------------------------------------
183
* Write time plot values.
185
* subroutine tplwri (tplnum, tplfmt, nprb, ntcabs, ttcabs, valprb)
188
* integer tplnum : <-- : number of associated plot (> 0)
189
* integer tplfmt : <-- : associated format
190
* (1: dat, 2: csv, 3: both)
191
* integer nprb : <-- : number of probes
192
* integer ntcabs : <-- : current time step number
193
* double precision ttcabs : <-- : current time value
194
* double precision valprb : <-- : probe values
195
*----------------------------------------------------------------------------*/
197
void CS_PROCF (tplwri, TPLWRI)
199
const cs_int_t *tplnum,
200
const cs_int_t *tplfmt,
201
const cs_int_t *nprb,
202
const cs_int_t *ntcabs,
203
const cs_real_t *ttcabs,
204
const cs_real_t *valprb
207
/*----------------------------------------------------------------------------
208
* Return the number of time plots accessible through the Fortran API
210
* This subroutine will only return the number of time plots defined by the
213
* subroutine tplnbr (ntpl)
216
* integer ntpl : --> : number of time plots defined
217
*----------------------------------------------------------------------------*/
219
void CS_PROCF (tplnbr, TPLNBR)
224
/*=============================================================================
225
* Public function prototypes
226
*============================================================================*/
228
/*----------------------------------------------------------------------------
229
* Initialize a plot file writer for probe-type plots
231
* This function should only be called by one rank for a given data series.
234
* plot_name <-- plot (variable) name
235
* file_prefix <-- file name prefix
236
* format <-- associated file format
237
* use_iteration <-- should we use the iteration number instead of the
239
* flush_wtime <-- elapsed time interval between file flushes
240
* (if < 0, no forced flush)
241
* n_buffer_steps <-- number of time steps in output buffer if
242
* file is not to be kept open
243
* n_probes <-- number of probes associated with this plot
244
* probe_list <-- numbers (1 to n) of probes if filtered, or NULL
245
* probe_coords <-- probe coordinates, or NULL
248
* pointer to new time plot writer
249
*----------------------------------------------------------------------------*/
252
cs_time_plot_init_probe(const char *plot_name,
253
const char *file_prefix,
254
cs_time_plot_format_t format,
255
cs_bool_t use_iteration,
259
const int *probe_list,
260
const cs_real_t probe_coords[]);
262
/*----------------------------------------------------------------------------
263
* Initialize a plot file writer for structure-type plots
265
* This function should only be called by one rank for a given data series.
268
* plot_name <-- plot (variable) name
269
* file_prefix <-- file name prefix
270
* format <-- associated file format
271
* use_iteration <-- should we use the iteration number instead of the
273
* flush_wtime <-- elapsed time interval between file flushes
274
* (if < 0, no forced flush)
275
* n_buffer_steps <-- number of time steps in output buffer if
276
* file is not to be kept open
277
* n_structures <-- number of structures associated with this plot
278
* mass_matrixes <-- mass matrix coefficients (3x3 blocks)
279
* damping_matrixes <-- damping matrix coefficients (3x3 blocks)
280
* stiffness_matrixes <-- stiffness matrix coefficients (3x3 blocks)
283
* pointer to new time plot writer
284
*----------------------------------------------------------------------------*/
287
cs_time_plot_init_struct(const char *plot_name,
288
const char *file_prefix,
289
cs_time_plot_format_t format,
290
cs_bool_t use_iteration,
294
const cs_real_t mass_matrixes[],
295
const cs_real_t damping_matrixes[],
296
const cs_real_t stiffness_matrixes[]);
298
/*----------------------------------------------------------------------------
299
* Finalize time plot writer for a given variable
301
* This function should only be called by one rank for a given data series.
304
* p <-> time plot values file handler
305
*----------------------------------------------------------------------------*/
308
cs_time_plot_finalize(cs_time_plot_t **p);
310
/*----------------------------------------------------------------------------
311
* Write time plot values
313
* This function should only be called by one rank for a given data series.
316
* p <-- pointer to associated plot structure
317
* tn <-- associated time step number
318
* t <-- associated time value
319
* n_vals <-- number of associated time values
320
* vals <-- associated time values
321
*----------------------------------------------------------------------------*/
324
cs_time_plot_vals_write(cs_time_plot_t *p,
328
const cs_real_t vals[]);
330
/*----------------------------------------------------------------------------*/
334
#endif /* __CS_PROBE_H__ */