9.2
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-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 * Initialize FVM to Catalyst object writer.
57 *
58 * Options are:
59 * private_comm use private MPI communicator (default: false)
60 * names=<fmt> use same naming rules as <fmt> format
61 * (default: ensight)
62 * input_name=<name> define input name (default: writer name)
63 *
64 * parameters:
65 * name <-- base output case name.
66 * options <-- whitespace separated, lowercase options list
67 * time_dependecy <-- indicates if and how meshes will change with time
68 * comm <-- associated MPI communicator.
69 *
70 * returns:
71 * pointer to opaque Catalyst writer structure.
72 *----------------------------------------------------------------------------*/
73
74#if defined(HAVE_MPI)
75
76extern "C" void *
77fvm_to_catalyst_init_writer(const char *name,
78 const char *path,
79 const char *options,
80 fvm_writer_time_dep_t time_dependency,
81 MPI_Comm comm);
82
83#else
84
85void *
86fvm_to_catalyst_init_writer(const char *name,
87 const char *path,
88 const char *options,
89 fvm_writer_time_dep_t time_dependency);
90
91#endif
92
93/*----------------------------------------------------------------------------
94 * Finalize FVM to Catalyst object writer.
95 *
96 * parameters:
97 * this_writer_p <-- pointer to opaque Catalyst writer structure.
98 *
99 * returns:
100 * null pointer.
101 *----------------------------------------------------------------------------*/
102
103extern "C" void *
104fvm_to_catalyst_finalize_writer(void *this_writer_p);
105
106/*----------------------------------------------------------------------------
107 * Associate new time step with a Catalyst geometry.
108 *
109 * parameters:
110 * this_writer_p <-- pointer to associated writer
111 * time_step <-- time step number
112 * time_value <-- time_value number
113 *----------------------------------------------------------------------------*/
114
115extern "C" void
116fvm_to_catalyst_set_mesh_time(void *this_writer_p,
117 int time_step,
118 double time_value);
119
120/*----------------------------------------------------------------------------
121 * Write nodal mesh to a a Catalyst object
122 *
123 * parameters:
124 * this_writer_p <-- pointer to associated writer.
125 * mesh <-- pointer to nodal mesh structure that should be written.
126 *----------------------------------------------------------------------------*/
127
128extern "C" void
129fvm_to_catalyst_export_nodal(void *this_writer_p,
130 const fvm_nodal_t *mesh);
131
132/*----------------------------------------------------------------------------
133 * Write field associated with a nodal mesh to a Catalyst object.
134 *
135 * Assigning a negative value to the time step indicates a time-independent
136 * field (in which case the time_value argument is unused).
137 *
138 * parameters:
139 * this_writer_p <-- pointer to associated writer
140 * mesh <-- pointer to associated nodal mesh structure
141 * name <-- variable name
142 * location <-- variable definition location (nodes or elements)
143 * dimension <-- variable dimension (0: constant, 1: scalar,
144 * 3: vector, 6: sym. tensor, 9: asym. tensor)
145 * interlace <-- indicates if variable in memory is interlaced
146 * n_parent_lists <-- indicates if variable values are to be obtained
147 * directly through the local entity index (when 0) or
148 * through the parent entity numbers (when 1 or more)
149 * parent_num_shift <-- parent number to value array index shifts;
150 * size: n_parent_lists
151 * datatype <-- indicates the data type of (source) field values
152 * time_step <-- number of the current time step
153 * time_value <-- associated time value
154 * field_values <-- array of associated field value arrays
155 *----------------------------------------------------------------------------*/
156
157extern "C" void
158fvm_to_catalyst_export_field(void *this_writer_p,
159 const fvm_nodal_t *mesh,
160 const char *name,
161 fvm_writer_var_loc_t location,
162 int dimension,
163 cs_interlace_t interlace,
164 int n_parent_lists,
165 const cs_lnum_t parent_num_shift[],
166 cs_datatype_t datatype,
167 int time_step,
168 double time_value,
169 const void *const field_values[]);
170
171/*----------------------------------------------------------------------------
172 * Flush files associated with a given writer.
173 *
174 * In this case, the effective call to coprocessing is done.
175 *
176 * parameters:
177 * this_writer_p <-- pointer to associated writer
178 *----------------------------------------------------------------------------*/
179
180extern "C" void
181fvm_to_catalyst_flush(void *this_writer_p);
182
183/*----------------------------------------------------------------------------*/
184
185#endif /* defined(HAVE_CATALYST) */
186
187#endif /* FVM_TO_CATALYST_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