9.2
general documentation
cs_meg_xdef_wrapper.h
Go to the documentation of this file.
1#ifndef CS_MEG_XDEF_WRAPPER_H
2#define CS_MEG_XDEF_WRAPPER_H
3
4/*============================================================================
5 * MEG (Mathematical Expression Generator) functions xdef wrapper
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
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_base.h"
36
37/*----------------------------------------------------------------------------*/
38
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
47typedef enum {
57
60
61typedef struct {
62 /* type of meg function */
64
65 /* cs_zone_t id */
66 int z_id;
67
68 /* values stride size */
69 int stride;
70
71 /* Input name used for function */
72 char name[512];
73
74 /* boundary or source term data */
75 char additional_data[512];
76
77 /* LOCATION */
79
80 /* constant data */
82
84
85/*============================================================================
86 * Public function prototypes
87 *============================================================================*/
88
89/*----------------------------------------------------------------------------*/
90/*
91 * \brief Add a MEG function xdef wrapper input data. Allocated memory is
92 * deleted by cs_meg_xdef_wrapper_finalize
93 *
94 * \returns pointer to newly allocated input data structure
95 */
96/*----------------------------------------------------------------------------*/
97
100 const int z_id,
101 const cs_mesh_location_type_t location,
102 const int stride,
103 const char *name,
104 const char *additional_data);
105
106/*----------------------------------------------------------------------------*/
107/*
108 * \brief Wrapper function allowing to call MEG functions by xdef structres.
109 * This is done by using the cs_xdef_analytic_function type.
110 *
111 */
112/*----------------------------------------------------------------------------*/
113
114void
116 cs_lnum_t n_elts,
117 const cs_lnum_t *elt_ids,
118 const cs_real_t *coords,
119 bool dense_output,
120 void *input,
121 cs_real_t *retval);
122
123/*----------------------------------------------------------------------------*/
124/*
125 * \brief Wrapper function allowing to call MEG functions by xdef structres.
126 * This is done by using the cs_xdef_function type.
127 *
128 */
129/*----------------------------------------------------------------------------*/
130
131void
132cs_meg_xdef_eval_func_wrapper(int location_id,
133 cs_lnum_t n_elts,
134 const cs_lnum_t *elt_ids,
135 void *input,
136 void *retval);
137
138/*----------------------------------------------------------------------------*/
139
141
142#endif
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:529
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_meg_function_type_t
Definition: cs_meg_xdef_wrapper.h:47
@ CS_MEG_BOUNDARY_FUNC
Definition: cs_meg_xdef_wrapper.h:48
@ CS_MEG_POST_ACTIVATE_FUNC
Definition: cs_meg_xdef_wrapper.h:54
@ CS_MEG_CALCULATOR_FUNC
Definition: cs_meg_xdef_wrapper.h:56
@ CS_MEG_IBM_FUNC
Definition: cs_meg_xdef_wrapper.h:52
@ CS_MEG_VOLUME_FUNC
Definition: cs_meg_xdef_wrapper.h:49
@ CS_MEG_INITIALIZATION_FUNC
Definition: cs_meg_xdef_wrapper.h:50
@ CS_MEG_FSI_STRUCT_FUNC
Definition: cs_meg_xdef_wrapper.h:53
@ CS_MEG_N_FUNC_TYPES
Definition: cs_meg_xdef_wrapper.h:58
@ CS_MEG_POST_PROFILES_FUNC
Definition: cs_meg_xdef_wrapper.h:55
@ CS_MEG_SOURCE_TERM_FUNC
Definition: cs_meg_xdef_wrapper.h:51
void cs_meg_xdef_eval_func_wrapper(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *retval)
Wrapper function allowing to call MEG functions by xdef structres. This is done by using the cs_xdef_...
Definition: cs_meg_xdef_wrapper.cxx:354
void cs_meg_xdef_wrapper(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool dense_output, void *input, cs_real_t *retval)
Wrapper function allowing to call MEG functions by xdef structres. This is done by using the cs_xdef_...
Definition: cs_meg_xdef_wrapper.cxx:185
cs_meg_xdef_input_t * cs_meg_xdef_wrapper_add_input(const cs_meg_function_type_t type, const int z_id, const cs_mesh_location_type_t location, const int stride, const char *name, const char *additional_data)
Add a MEG function xdef wrapper input data. Allocated memory is deleted by cs_meg_xdef_wrapper_finali...
Definition: cs_meg_xdef_wrapper.cxx:125
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60
Definition: cs_meg_xdef_wrapper.h:61
int stride
Definition: cs_meg_xdef_wrapper.h:69
cs_real_t constant_value
Definition: cs_meg_xdef_wrapper.h:81
cs_meg_function_type_t type
Definition: cs_meg_xdef_wrapper.h:63
cs_mesh_location_type_t location
Definition: cs_meg_xdef_wrapper.h:78
int z_id
Definition: cs_meg_xdef_wrapper.h:66