9.2
general documentation
cs_paramedmem_coupling.h
Go to the documentation of this file.
1#ifndef CS_PARAMEDMEM_HXX
2#define CS_PARAMEDMEM_HXX
3
4/*============================================================================
5 * MEDCoupling ParaMESH/ParaFIELD wrapper functions.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------
29 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "base/cs_defs.h"
33
34#include "base/cs_field.h"
35#include "base/cs_zone.h"
36
37/*============================================================================
38 * Structure definitions
39 *============================================================================*/
40
42typedef struct _cs_paramedmem_coupling_t cs_paramedmem_coupling_t;
43
44#ifdef __cplusplus
45
46namespace cs {
47using paramedmem_coupling_t = cs_paramedmem_coupling_t;
48}
49
50#endif
51
52/*============================================================================
53 * Global variable definitions
54 *============================================================================*/
55
56typedef enum {
61
62typedef enum {
67
68typedef enum {
75
76typedef enum {
80
81/*============================================================================
82 * Public C++ function prototypes
83 *============================================================================*/
84
85/*----------------------------------------------------------------------------*/
86/*
87 * \brief Retrieve coupling struct pointer by id
88 *
89 * \param[in] cpl_id index of the sought coupling
90 *
91 * \return pointer to cs_paramedmem_coupling_t struct. Raise an error if
92 * the coupling does not exist.
93 */
94/*----------------------------------------------------------------------------*/
95
96cs_paramedmem_coupling_t *
98
99/*----------------------------------------------------------------------------*/
100/*
101 * \brief Retrieve coupling struct pointer by name
102 *
103 * \param[in] name name of the coupling
104 *
105 * \return pointer to cs_paramedmem_coupling_t struct or NULL if not found.
106 */
107/*----------------------------------------------------------------------------*/
108
109cs_paramedmem_coupling_t *
110cs_paramedmem_coupling_by_name(const char *name);
111
112/*----------------------------------------------------------------------------*/
113/*
114 * \brief Create a new ParaMEDMEM coupling
115 *
116 * \param[in] app1_name Name of app n°1 or NULL if calling app is app1
117 * \param[in] app2_name Name of app n°2 or NULL if calling app is app2
118 * \param[in] cpl_name Name of the coupling.
119 * If NULL an automatic name is generated.
120 * \param[in] type_dec Type of DEC used for Data exchange
121 *
122 * \return pointer to newly created cs_paramedmem_coupling_t structure.
123 */
124/*----------------------------------------------------------------------------*/
125
126cs_paramedmem_coupling_t *
127cs_paramedmem_coupling_create(const char *app1_name,
128 const char *app2_name,
129 const char *cpl_name,
130 cs_medcpl_dec_t type_dec);
131
132/*----------------------------------------------------------------------------*/
133/*
134 * \brief Create a new ParaMEDMEM handler structure with no actual coupling.
135 *
136 * This can be useful for a "dry run" when setting up a coupling, so as to
137 * first debug local commands before actually running in coupled mode.
138 *
139 * In this case, data "received" matches the initialized values.
140 *
141 * \param[in] cpl_name Name of the coupling.
142 * If NULL an automatic name is generated.
143 *
144 * \return pointer to newly created cs_paramedmem_coupling_t structure.
145 */
146/*----------------------------------------------------------------------------*/
147
148cs_paramedmem_coupling_t *
149cs_paramedmem_coupling_create_uncoupled(const char *cpl_name);
150
151/*----------------------------------------------------------------------------*/
152/*
153 * \brief Destroy a given ParaMEDMEM coupling structure
154 *
155 * \param[in] c pointer to cs_paramedmem_coupling_t structure
156 */
157/*----------------------------------------------------------------------------*/
158
159void
160cs_paramedmem_coupling_destroy(cs_paramedmem_coupling_t *c);
161
162/*----------------------------------------------------------------------------*/
163/*
164 * \brief Destroy all coupling structures
165 */
166/*----------------------------------------------------------------------------*/
167
168void
170
171/*----------------------------------------------------------------------------*/
172/*
173 * \brief Get number of defined couplings
174 *
175 * \return number of defined couplings (int)
176 */
177/*----------------------------------------------------------------------------*/
178
179int
181
182/*----------------------------------------------------------------------------*/
183/*
184 * \brief initialize couplings based on user functions
185 */
186/*----------------------------------------------------------------------------*/
187
188void
190
191/*----------------------------------------------------------------------------*/
192/*
193 * \brief initialize coupled mesh and fields based on user functions
194 */
195/*----------------------------------------------------------------------------*/
196
197void
199
200/*----------------------------------------------------------------------------*/
201/*
202 * \brief Log ParaMEDMEM coupling setup information
203 */
204/*----------------------------------------------------------------------------*/
205
206void
208
209/*----------------------------------------------------------------------------*/
210
211#endif /* CS_PARAMEDMEM_HXX */
void cs_paramedmem_coupling_destroy(cs_paramedmem_coupling_t *c)
Destroy a given ParaMEDMEM coupling structure.
Definition: cs_paramedmem_coupling.cxx:496
void cs_paramedmem_coupling_define_mesh_fields(void)
initialize coupled mesh and fields based on user functions.
Definition: cs_paramedmem_coupling.cxx:635
cs_paramedmem_coupling_t * cs_paramedmem_coupling_by_name(const char *name)
Retrieve coupling struct pointer by name.
Definition: cs_paramedmem_coupling.cxx:319
cs_medcpl_field_nature_t
Definition: cs_paramedmem_coupling.h:68
@ CS_MEDCPL_FIELD_EXT_CONSERVATION
Definition: cs_paramedmem_coupling.h:71
@ CS_MEDCPL_FIELD_EXT_MAXIMUM
Definition: cs_paramedmem_coupling.h:72
@ CS_MEDCPL_FIELD_INT_CONSERVATION
Definition: cs_paramedmem_coupling.h:69
@ CS_MEDCPL_FIELD_INT_MAXIMUM
Definition: cs_paramedmem_coupling.h:70
@ CS_MEDCPL_FIELD_N_NATURE
Definition: cs_paramedmem_coupling.h:73
cs_paramedmem_coupling_t * cs_paramedmem_coupling_create(const char *app1_name, const char *app2_name, const char *cpl_name, cs_medcpl_dec_t type_dec)
Create a new ParaMEDMEM coupling.
Definition: cs_paramedmem_coupling.cxx:360
int cs_paramedmem_get_number_of_couplings(void)
Get number of defined couplings.
Definition: cs_paramedmem_coupling.cxx:564
cs_paramedmem_coupling_t * cs_paramedmem_coupling_by_id(int cpl_id)
Retrieve coupling struct pointer by id.
Definition: cs_paramedmem_coupling.cxx:284
cs_paramedmem_coupling_t * cs_paramedmem_coupling_create_uncoupled(const char *cpl_name)
Create a new ParaMEDMEM handler structure with no actual coupling.
Definition: cs_paramedmem_coupling.cxx:461
void cs_paramedmem_coupling_all_finalize(void)
Destroy all coupling structures.
Definition: cs_paramedmem_coupling.cxx:545
void cs_paramedmem_coupling_all_init(void)
initialize couplings based on user functions.
Definition: cs_paramedmem_coupling.cxx:623
cs_medcpl_time_discr_t
Definition: cs_paramedmem_coupling.h:62
@ CS_MEDCPL_NO_TIME
Definition: cs_paramedmem_coupling.h:63
@ CS_MEDCPL_ONE_TIME
Definition: cs_paramedmem_coupling.h:64
@ CS_MEDCPL_LINEAR_TIME
Definition: cs_paramedmem_coupling.h:65
cs_medcpl_space_discr_t
Definition: cs_paramedmem_coupling.h:56
@ CS_MEDCPL_ON_NODES
Definition: cs_paramedmem_coupling.h:58
@ CS_MEDCPL_ON_NODES_FE
Definition: cs_paramedmem_coupling.h:59
@ CS_MEDCPL_ON_CELLS
Definition: cs_paramedmem_coupling.h:57
cs_medcpl_dec_t
Definition: cs_paramedmem_coupling.h:76
@ CS_MEDCPL_CFEMDEC
Definition: cs_paramedmem_coupling.h:78
@ CS_MEDCPL_INTERPKERNELDEC
Definition: cs_paramedmem_coupling.h:77
void cs_paramedmem_coupling_log_setup(void)
Log ParaMEDMEM coupling setup information.
Definition: cs_paramedmem_coupling.cxx:591
Definition: cs_algorithm.h:51
cs_paramedmem_coupling_t paramedmem_coupling_t
Definition: cs_paramedmem_coupling.h:47
Definition: cs_paramedmem_coupling_utils.h:68