9.2
general documentation
fvm_to_ccm.h
Go to the documentation of this file.
1#ifndef FVM_TO_CCM_H
2#define FVM_TO_CCM_H
3
4#if defined(HAVE_CCM)
5
6/*============================================================================
7 * Write a nodal representation associated with a mesh and associated
8 * variables to CCM-IO files
9 *============================================================================*/
10
11/*
12 This file is part of code_saturne, a general-purpose CFD tool.
13
14 Copyright (C) 1998-2026 EDF S.A.
15
16 This program is free software; you can redistribute it and/or modify it under
17 the terms of the GNU General Public License as published by the Free Software
18 Foundation; either version 2 of the License, or (at your option) any later
19 version.
20
21 This program is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
24 details.
25
26 You should have received a copy of the GNU General Public License along with
27 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
28 Street, Fifth Floor, Boston, MA 02110-1301, USA.
29*/
30
31/*----------------------------------------------------------------------------*/
32
33#include "base/cs_defs.h"
34
35/*----------------------------------------------------------------------------
36 * Local headers
37 *----------------------------------------------------------------------------*/
38
39#include "fvm/fvm_defs.h"
40#include "fvm/fvm_nodal.h"
41#include "fvm/fvm_writer.h"
42
43/*=============================================================================
44 * Macro definitions
45 *============================================================================*/
46
47/*============================================================================
48 * Type definitions
49 *============================================================================*/
50
51/*=============================================================================
52 * Public function prototypes
53 *============================================================================*/
54
55/*----------------------------------------------------------------------------
56 * Returns number of library version strings associated with the CCM-IO format.
57 *
58 * returns:
59 * number of library version strings associated with the CCM-IO format.
60 *----------------------------------------------------------------------------*/
61
62int
63fvm_to_ccm_n_version_strings(void);
64
65/*----------------------------------------------------------------------------
66 * Returns a library version string associated with the CCM-IO format.
67 *
68 * In certain cases, when using dynamic libraries, fvm may be compiled
69 * with one library version, and linked with another. If both run-time
70 * and compile-time version information is available, this function
71 * will return the run-time version string by default.
72 *
73 * Setting the compile_time flag to 1, the compile-time version string
74 * will be returned if this is different from the run-time version.
75 * If the version is the same, or only one of the 2 version strings are
76 * available, a NULL character string will be returned with this flag set.
77 *
78 * parameters:
79 * string_index <-- index in format's version string list (0 to n-1)
80 * compile_time <-- 0 by default, 1 if we want the compile-time version
81 * string, if different from the run-time version.
82 *
83 * returns:
84 * pointer to constant string containing the library's version.
85 *----------------------------------------------------------------------------*/
86
87const char *
88fvm_to_ccm_version_string(int string_index,
89 int compile_time_version);
90
91/*----------------------------------------------------------------------------
92 * Initialize FVM to CCM-IO file writer.
93 *
94 * parameters:
95 * name <-- base output case name.
96 * options <-- whitespace separated, lowercase options list
97 * time_dependecy <-- indicates if and how meshes will change with time
98 * comm <-- associated MPI communicator.
99 *
100 * returns:
101 * pointer to opaque CCM-IO writer structure.
102 *----------------------------------------------------------------------------*/
103
104#if defined(HAVE_MPI)
105
106void *
107fvm_to_ccm_init_writer(const char *name,
108 const char *path,
109 const char *options,
110 fvm_writer_time_dep_t time_dependency,
111 MPI_Comm comm);
112
113#else
114
115void *
116fvm_to_ccm_init_writer(const char *name,
117 const char *path,
118 const char *options,
119 fvm_writer_time_dep_t time_dependency);
120
121#endif
122
123/*----------------------------------------------------------------------------
124 * Finalize FVM to CCM-IO file writer.
125 *
126 * parameters:
127 * this_writer_p <-- pointer to opaque CCM-IO writer structure.
128 *
129 * returns:
130 * null pointer.
131 *----------------------------------------------------------------------------*/
132
133void *
134fvm_to_ccm_finalize_writer(void *this_writer_p);
135
136/*----------------------------------------------------------------------------
137 * Associate new time step with a CCM-IO geometry.
138 *
139 * parameters:
140 * this_writer_p <-- pointer to associated writer
141 * time_step <-- time step number
142 * time_value <-- time_value number
143 *----------------------------------------------------------------------------*/
144
145void
146fvm_to_ccm_set_mesh_time(void *this_writer_p,
147 int time_step,
148 double time_value);
149
150/*----------------------------------------------------------------------------
151 * Write nodal mesh to a CCM-IO file
152 *
153 * parameters:
154 * this_writer_p <-- pointer to associated writer.
155 * mesh <-- pointer to nodal mesh structure that should be written.
156 *----------------------------------------------------------------------------*/
157
158void
159fvm_to_ccm_export_nodal(void *this_writer_p,
160 const fvm_nodal_t *mesh);
161
162/*----------------------------------------------------------------------------
163 * Write field associated with a nodal mesh to a CCM-IO file.
164 *
165 * Assigning a negative value to the time step indicates a time-independent
166 * field (in which case the time_value argument is unused).
167 *
168 * parameters:
169 * this_writer_p <-- pointer to associated writer
170 * mesh <-- pointer to associated nodal mesh structure
171 * name <-- variable name
172 * location <-- variable definition location (nodes or elements)
173 * dimension <-- variable dimension (0: constant, 1: scalar,
174 * 3: vector, 6: sym. tensor, 9: asym. tensor)
175 * interlace <-- indicates if variable in memory is interlaced
176 * n_parent_lists <-- indicates if variable values are to be obtained
177 * directly through the local entity index (when 0) or
178 * through the parent entity numbers (when 1 or more)
179 * parent_num_shift <-- parent number to value array index shifts;
180 * size: n_parent_lists
181 * datatype <-- indicates the data type of (source) field values
182 * time_step <-- number of the current time step
183 * time_value <-- associated time value
184 * field_values <-- array of associated field value arrays
185 *----------------------------------------------------------------------------*/
186
187void
188fvm_to_ccm_export_field(void *this_writer_p,
189 const fvm_nodal_t *mesh,
190 const char *name,
191 fvm_writer_var_loc_t location,
192 int dimension,
193 cs_interlace_t interlace,
194 int n_parent_lists,
195 const cs_lnum_t parent_num_shift[],
196 cs_datatype_t datatype,
197 int time_step,
198 double time_value,
199 const void *const field_values[]);
200
201/*----------------------------------------------------------------------------*/
202
203#endif /* HAVE_CCM */
204
205#endif /* FVM_TO_CCM_H */
cs_datatype_t
Definition: cs_defs.h:290
cs_interlace_t
Definition: cs_defs.h:504
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
Definition: mesh.f90:26