8.3
general documentation
fvm_to_time_plot.h
Go to the documentation of this file.
1#ifndef __FVM_TO_TIME_PLOT_H__
2#define __FVM_TO_TIME_PLOT_H__
3
4/*============================================================================
5 * Write a nodal representation associated with a mesh and associated
6 * variables to time plot (whitepace-separated or csv) files
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2024 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------*/
30
31#include "cs_defs.h"
32
33/*----------------------------------------------------------------------------
34 * Local headers
35 *----------------------------------------------------------------------------*/
36
37#include "fvm_defs.h"
38#include "fvm_nodal.h"
39#include "fvm_writer.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*=============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Type definitions
51 *============================================================================*/
52
53/*=============================================================================
54 * Public function prototypes
55 *============================================================================*/
56
57/*----------------------------------------------------------------------------
58 * Initialize FVM to time plot file writer.
59 *
60 * Options are:
61 * csv output CSV (comma-separated-values) files
62 * dat output dat (space-separated) files
63 * use_iteration use time step id instead of time value for
64 * first column
65 * flush_wtime=<wt> flush output file every 'wt' seconds
66 * n_buf_steps=<n> write output to file every 'n' output steps
67 *
68 * parameters:
69 * name <-- base output case name.
70 * options <-- whitespace separated, lowercase options list
71 * time_dependecy <-- indicates if and how meshes will change with time
72 * comm <-- associated MPI communicator.
73 *
74 * returns:
75 * pointer to opaque time plot writer structure.
76 *----------------------------------------------------------------------------*/
77
78#if defined(HAVE_MPI)
79
80void *
81fvm_to_time_plot_init_writer(const char *name,
82 const char *path,
83 const char *options,
84 fvm_writer_time_dep_t time_dependency,
85 MPI_Comm comm);
86
87#else
88
89void *
90fvm_to_time_plot_init_writer(const char *name,
91 const char *path,
92 const char *options,
93 fvm_writer_time_dep_t time_dependency);
94
95#endif
96
97/*----------------------------------------------------------------------------
98 * Finalize FVM to time plot file writer.
99 *
100 * parameters:
101 * writer <-- pointer to opaque time plot writer structure.
102 *
103 * returns:
104 * null pointer.
105 *----------------------------------------------------------------------------*/
106
107void *
109
110/*----------------------------------------------------------------------------
111 * Associate new time step with a time plot geometry.
112 *
113 * parameters:
114 * writer <-- pointer to associated writer
115 * time_step <-- time step number
116 * time_value <-- time_value number
117 *----------------------------------------------------------------------------*/
118
119void
121 const int time_step,
122 const double time_value);
123
124/*----------------------------------------------------------------------------
125 * Write nodal mesh to a time plot file
126 *
127 * parameters:
128 * writer <-- pointer to associated writer.
129 * mesh <-- pointer to nodal mesh structure that should be written.
130 *----------------------------------------------------------------------------*/
131
132void
134 const fvm_nodal_t *mesh);
135
136/*----------------------------------------------------------------------------
137 * Write field associated with a nodal mesh to a time plot file.
138 *
139 * Assigning a negative value to the time step indicates a time-independent
140 * field (in which case the time_value argument is unused).
141 *
142 * parameters:
143 * writer <-- pointer to associated writer
144 * mesh <-- pointer to associated nodal mesh structure
145 * name <-- variable name
146 * location <-- variable definition location (nodes or elements)
147 * dimension <-- variable dimension (0: constant, 1: scalar,
148 * 3: vector, 6: sym. tensor, 9: asym. tensor)
149 * interlace <-- indicates if variable in memory is interlaced
150 * n_parent_lists <-- indicates if variable values are to be obtained
151 * directly through the local entity index (when 0) or
152 * through the parent entity numbers (when 1 or more)
153 * parent_num_shift <-- parent number to value array index shifts;
154 * size: n_parent_lists
155 * datatype <-- indicates the data type of (source) field values
156 * time_step <-- number of the current time step
157 * time_value <-- associated time value
158 * field_values <-- array of associated field value arrays
159 *----------------------------------------------------------------------------*/
160
161void
163 const fvm_nodal_t *mesh,
164 const char *name,
165 fvm_writer_var_loc_t location,
166 int dimension,
167 cs_interlace_t interlace,
168 int n_parent_lists,
169 const cs_lnum_t parent_num_shift[],
170 cs_datatype_t datatype,
171 int time_step,
172 double time_value,
173 const void *const field_values[]);
174
175/*----------------------------------------------------------------------------*/
176
178
179#endif /* __FVM_TO_TIME_PLOT_H__ */
cs_datatype_t
Definition: cs_defs.h:300
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
cs_interlace_t
Definition: cs_defs.h:514
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void fvm_to_time_plot_export_nodal(void *writer, const fvm_nodal_t *mesh)
Definition: fvm_to_time_plot.cpp:592
void * fvm_to_time_plot_finalize_writer(void *writer)
Definition: fvm_to_time_plot.cpp:544
void * fvm_to_time_plot_init_writer(const char *name, const char *path, const char *options, fvm_writer_time_dep_t time_dependency)
Definition: fvm_to_time_plot.cpp:427
void fvm_to_time_plot_export_field(void *writer, const fvm_nodal_t *mesh, const char *name, fvm_writer_var_loc_t location, int dimension, cs_interlace_t interlace, int n_parent_lists, const cs_lnum_t parent_num_shift[], cs_datatype_t datatype, int time_step, double time_value, const void *const field_values[])
Definition: fvm_to_time_plot.cpp:666
void fvm_to_time_plot_set_mesh_time(void *writer, const int time_step, const double time_value)
Definition: fvm_to_time_plot.cpp:573
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
Definition: mesh.f90:26