9.1
general documentation
fvm_to_catalyst2.h
Go to the documentation of this file.
1#ifndef __FVM_TO_CATALYST2_H__
2#define __FVM_TO_CATALYST2_H__
3
4#if defined(HAVE_CATALYST2)
5
6/*============================================================================
7 * Write a nodal representation associated with a mesh and associated
8 * variables to Catalyst2 objects
9 *============================================================================*/
10
11/*
12 This file is part of Code_Saturne, a general-purpose CFD tool.
13
14 Copyright (C) 1998-2022 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_defs.h"
40#include "fvm_nodal.h"
41#include "fvm_writer.h"
42
43/*----------------------------------------------------------------------------*/
44
46
47/*=============================================================================
48 * Macro definitions
49 *============================================================================*/
50
51/*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55/*=============================================================================
56 * Public function prototypes
57 *============================================================================*/
58
59/*----------------------------------------------------------------------------
60 * Returns number of library version strings associated with Catalyst-2.
61 *
62 * The first associated version string should corresponds to Catalyst,
63 * The second to the Conduit library.
64 *
65 * returns:
66 * number of library version strings associated with Catalyst output.
67 *----------------------------------------------------------------------------*/
68
69int
70fvm_to_catalyst2_n_version_strings(void);
71
72/*----------------------------------------------------------------------------
73 * Returns a library version string associated with the Catalyst-2 output.
74 *
75 * The first associated version string should correspond to Catalyst info,
76 * The second to conduit info.
77 *
78 * In certain cases, when using dynamic libraries, fvm may be compiled
79 * with one library version, and linked with another. If both run-time
80 * and compile-time version information is available, this function
81 * will return the run-time version string by default.
82 *
83 * Setting the compile_time flag to 1, the compile-time version string
84 * will be returned if this is different from the run-time version.
85 * If the version is the same, or only one of the 2 version strings are
86 * available, a NULL character string will be returned with this flag set.
87 *
88 * parameters:
89 * string_index <-- index in format's version string list (0 to n-1)
90 * compile_time <-- 0 by default, 1 if we want the compile-time version
91 * string, if different from the run-time version.
92 *
93 * returns:
94 * pointer to constant string containing the library's version.
95 *----------------------------------------------------------------------------*/
96
97const char *
98fvm_to_catalyst2_version_string(int string_index,
99 int compile_time_version);
100
101/*----------------------------------------------------------------------------
102 * Initialize FVM to Catalyst-2 object writer.
103 *
104 * Options are:
105 * private_comm use private MPI communicator (default: false)
106 * names=<fmt> use same naming rules as <fmt> format
107 * (default: ensight)
108 * input_name=<name> define input name (default: writer name)
109 *
110 * parameters:
111 * name <-- base output case name.
112 * options <-- whitespace separated, lowercase options list
113 * time_dependecy <-- indicates if and how meshes will change with time
114 * comm <-- associated MPI communicator.
115 *
116 * returns:
117 * pointer to opaque writer structure.
118 *----------------------------------------------------------------------------*/
119
120#if defined(HAVE_MPI)
121void *
122fvm_to_catalyst2_init_writer(const char *name,
123 const char *path,
124 const char *options,
125 fvm_writer_time_dep_t time_dependency,
126 MPI_Comm comm);
127#else
128void *
129fvm_to_catalyst2_init_writer(const char *name,
130 const char *path,
131 const char *options,
132 fvm_writer_time_dep_t time_dependency);
133
134#endif
135
136/*----------------------------------------------------------------------------
137 * Finalize FVM to Catalyst-2 object writer.
138 *
139 * parameters:
140 * this_writer_p <-- pointer to opaque writer structure.
141 *
142 * returns:
143 * NULL pointer
144 *----------------------------------------------------------------------------*/
145
146void *
147fvm_to_catalyst2_finalize_writer(void *this_writer_p);
148
149/*----------------------------------------------------------------------------
150 * Associate new time step with a Catalyst-2 geometry.
151 *
152 * parameters:
153 * this_writer_p <-- pointer to associated writer
154 * time_step <-- time step number
155 * time_value <-- time_value number
156 *----------------------------------------------------------------------------*/
157
158void
159fvm_to_catalyst2_set_mesh_time(void *this_writer_p,
160 int time_step,
161 double time_value);
162
163/*----------------------------------------------------------------------------
164 * Write nodal mesh to a Catalyst-2 object
165 *
166 * parameters:
167 * this_writer_p <-- pointer to associated writer.
168 * mesh <-- pointer to nodal mesh structure that should be written.
169 *----------------------------------------------------------------------------*/
170
171void
172fvm_to_catalyst2_export_nodal(void *this_writer_p,
173 const fvm_nodal_t *mesh);
174
175/*----------------------------------------------------------------------------
176 * Write field associated with a nodal mesh to to a Catalyst-2 object.
177 *
178 * Assigning a negative value to the time step indicates a time-independent
179 * field (in which case the time_value argument is unused).
180 *
181 * parameters:
182 * this_writer_p <-- pointer to associated writer
183 * mesh <-- pointer to associated nodal mesh structure
184 * name <-- variable name
185 * location <-- variable definition location (nodes or elements)
186 * dimension <-- variable dimension (0: constant, 1: scalar,
187 * 3: vector, 6: sym. tensor, 9: asym. tensor)
188 * interlace <-- indicates if variable in memory is interlaced
189 * n_parent_lists <-- indicates if variable values are to be obtained
190 * directly through the local entity index (when 0) or
191 * through the parent entity numbers (when 1 or more)
192 * parent_num_shift <-- parent number to value array index shifts;
193 * size: n_parent_lists
194 * datatype <-- indicates the data type of (source) field values
195 * time_step <-- number of the current time step
196 * time_value <-- associated time value
197 * field_values <-- array of associated field value arrays
198 *----------------------------------------------------------------------------*/
199
200void
201fvm_to_catalyst2_export_field(void *this_writer_p,
202 const fvm_nodal_t *mesh,
203 const char *name,
204 fvm_writer_var_loc_t location,
205 int dimension,
206 cs_interlace_t interlace,
207 int n_parent_lists,
208 const cs_lnum_t parent_num_shift[],
209 cs_datatype_t datatype,
210 int time_step,
211 double time_value,
212 const void *const field_values[]);
213
214/*----------------------------------------------------------------------------
215 * Flush files associated with a given writer.
216 *
217 * In this case, the effective call to coprocessing is done.
218 *
219 * parameters:
220 * this_writer_p <-- pointer to associated writer
221 *----------------------------------------------------------------------------*/
222
223void
224fvm_to_catalyst2_flush(void *this_writer_p);
225
226/*----------------------------------------------------------------------------*/
227
229
230#endif /* defined(HAVE_CATALYST2) */
231
232#endif /* __FVM_TO_CATALYST2_H__ */
cs_datatype_t
Definition: cs_defs.h:315
#define BEGIN_C_DECLS
Definition: cs_defs.h:554
cs_interlace_t
Definition: cs_defs.h:529
#define END_C_DECLS
Definition: cs_defs.h:555
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
fvm_writer_var_loc_t
Definition: fvm_writer.h:69
Definition: mesh.f90:26