9.1
general documentation
fvm_to_catalyst.h
Go to the documentation of this file.
1#ifndef __FVM_TO_CATALYST_H__
2#define __FVM_TO_CATALYST_H__
3
4#if defined(HAVE_CATALYST)
5
6/*============================================================================
7 * Write a nodal representation associated with a mesh and associated
8 * variables to Catalyst objects
9 *============================================================================*/
10
11/*
12 This file is part of code_saturne, a general-purpose CFD tool.
13
14 Copyright (C) 1998-2025 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
46
47/*=============================================================================
48 * Macro definitions
49 *============================================================================*/
50
51/*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55/*=============================================================================
56 * Public function prototypes
57 *============================================================================*/
58
59/*----------------------------------------------------------------------------
60 * Initialize FVM to Catalyst object writer.
61 *
62 * Options are:
63 * private_comm use private MPI communicator (default: false)
64 * names=<fmt> use same naming rules as <fmt> format
65 * (default: ensight)
66 * input_name=<name> define input name (default: writer name)
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 Catalyst writer structure.
76 *----------------------------------------------------------------------------*/
77
78#if defined(HAVE_MPI)
79
80void *
81fvm_to_catalyst_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_catalyst_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 Catalyst object writer.
99 *
100 * parameters:
101 * this_writer_p <-- pointer to opaque Catalyst writer structure.
102 *
103 * returns:
104 * null pointer.
105 *----------------------------------------------------------------------------*/
106
107void *
108fvm_to_catalyst_finalize_writer(void *this_writer_p);
109
110/*----------------------------------------------------------------------------
111 * Associate new time step with a Catalyst geometry.
112 *
113 * parameters:
114 * this_writer_p <-- pointer to associated writer
115 * time_step <-- time step number
116 * time_value <-- time_value number
117 *----------------------------------------------------------------------------*/
118
119void
120fvm_to_catalyst_set_mesh_time(void *this_writer_p,
121 int time_step,
122 double time_value);
123
124/*----------------------------------------------------------------------------
125 * Write nodal mesh to a a Catalyst object
126 *
127 * parameters:
128 * this_writer_p <-- pointer to associated writer.
129 * mesh <-- pointer to nodal mesh structure that should be written.
130 *----------------------------------------------------------------------------*/
131
132void
133fvm_to_catalyst_export_nodal(void *this_writer_p,
134 const fvm_nodal_t *mesh);
135
136/*----------------------------------------------------------------------------
137 * Write field associated with a nodal mesh to a Catalyst object.
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 * this_writer_p <-- 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
162fvm_to_catalyst_export_field(void *this_writer_p,
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 * Flush files associated with a given writer.
177 *
178 * In this case, the effective call to coprocessing is done.
179 *
180 * parameters:
181 * this_writer_p <-- pointer to associated writer
182 *----------------------------------------------------------------------------*/
183
184void
185fvm_to_catalyst_flush(void *this_writer_p);
186
187/*----------------------------------------------------------------------------*/
188
190
191#endif /* defined(HAVE_CATALYST) */
192
193#endif /* __FVM_TO_CATALYST_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