1
#ifndef __CS_COUPLING_H__
2
#define __CS_COUPLING_H__
4
/*============================================================================
5
* Common functionnality for various coupling types.
6
*============================================================================*/
9
This file is part of Code_Saturne, a general-purpose CFD tool.
11
Copyright (C) 1998-2011 EDF S.A.
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
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
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.
28
/*----------------------------------------------------------------------------*/
30
/*----------------------------------------------------------------------------
31
* Standard C library headers
32
*----------------------------------------------------------------------------*/
34
/*----------------------------------------------------------------------------
36
*----------------------------------------------------------------------------*/
38
#include <ple_coupling.h>
40
/*----------------------------------------------------------------------------
42
*----------------------------------------------------------------------------*/
46
/*----------------------------------------------------------------------------*/
50
/*=============================================================================
52
*============================================================================*/
54
/*============================================================================
56
*============================================================================*/
58
/*=============================================================================
59
* Global variable definitions
60
*============================================================================*/
62
/*============================================================================
63
* Public function prototypes for Fortran API
64
*============================================================================*/
66
/*----------------------------------------------------------------------------
67
* Synchronize with applications in the same PLE coupling group.
69
* This function should be called before starting a new time step. The
70
* current time step id is that of the last finished time step, or 0 at
75
* subroutine cplsyn (ntcmabs, ntcabs, dtref)
78
* integer ntmabs : <-> : maximum iteration number
79
* integer ntcabs : <-- : current iteration number
80
* double precision dtref : <-> : reference time step value
81
*----------------------------------------------------------------------------*/
83
void CS_PROCF(cplsyn, CPLSYN)
86
const cs_int_t *ntcabs,
90
/*============================================================================
91
* Public function prototypes
92
*============================================================================*/
96
/*----------------------------------------------------------------------------
97
* Discover other applications in the same MPI root communicator.
100
* app_name <-- name of this instance of Code_Saturne.
101
*----------------------------------------------------------------------------*/
104
cs_coupling_discover_mpi_apps(const char *app_name);
106
/*----------------------------------------------------------------------------
107
* Finalize MPI coupling helper structures.
108
*----------------------------------------------------------------------------*/
111
cs_coupling_finalize(void);
113
/*----------------------------------------------------------------------------
114
* Return info on other applications in the same MPI root communicator.
117
* info on other applications structure.
118
*----------------------------------------------------------------------------*/
120
const ple_coupling_mpi_set_t *
121
cs_coupling_get_mpi_apps(void);
123
#endif /* HAVE_MPI */
125
/*----------------------------------------------------------------------------
126
* Synchronize with applications in the same PLE coupling group.
128
* This function should be called before starting a new time step. The
129
* current time step id is that of the last finished time step, or 0 at
132
* Default synchronization flags indicating a new iteration or end of
133
* calculation are set automatically, but the user may set additional flags
134
* to this function if necessary.
137
* flags <-- optional additional synchronization flags
138
* current_ts_id <-- current time step id
139
* max_ts_id <-> maximum time step id
140
* ts <-> suggested time step value
141
*----------------------------------------------------------------------------*/
144
cs_coupling_sync_apps(int flags,
149
/*----------------------------------------------------------------------------
150
* Compute extents of a mesh representation
153
* mesh <-- pointer to mesh representation structure
154
* n_max_extents <-- maximum number of sub-extents (such as element extents)
155
* to compute, or -1 to query
156
* tolerance <-- addition to local extents of each element:
157
* extent = base_extent * (1 + tolerance)
158
* extents <-> extents associated with mesh:
159
* x_min, y_min, ..., x_max, y_max, ... (size: 2*dim)
162
* the number of extents computed
163
*----------------------------------------------------------------------------*/
166
cs_coupling_mesh_extents(const void *mesh,
167
ple_lnum_t n_max_extents,
171
/*----------------------------------------------------------------------------
172
* Find elements in a given mesh containing points: updates the
173
* location[] and distance[] arrays associated with a set of points
174
* for points that are in an element of this mesh, or closer to one
175
* than to previously encountered elements.
177
* Location is relative to the id of a given element + 1 in
178
* concatenated sections of same element dimension.
181
* mesh <-- pointer to mesh representation structure
182
* tolerance <-- associated tolerance
183
* n_points <-- number of points to locate
184
* point_coords <-- point coordinates
185
* location <-> number of element containing or closest to each
186
* point (size: n_points)
187
* distance <-> distance from point to element indicated by
188
* location[]: < 0 if unlocated, 0 - 1 if inside,
189
* and > 1 if outside a volume element, or absolute
190
* distance to a surface element (size: n_points)
191
*----------------------------------------------------------------------------*/
194
cs_coupling_point_in_mesh(const void *mesh,
197
const ple_coord_t point_coords[],
198
ple_lnum_t location[],
201
/*----------------------------------------------------------------------------
202
* Find elements in a given mesh containing points: updates the
203
* location[] and distance[] arrays associated with a set of points
204
* for points that are in an element of this mesh, or closer to one
205
* than to previously encountered elements.
207
* Location is relative to parent element numbers.
210
* mesh <-- pointer to mesh representation structure
211
* tolerance <-- associated tolerance
212
* n_points <-- number of points to locate
213
* point_coords <-- point coordinates
214
* location <-> number of element containing or closest to each
215
* point (size: n_points)
216
* distance <-> distance from point to element indicated by
217
* location[]: < 0 if unlocated, 0 - 1 if inside,
218
* and > 1 if outside a volume element, or absolute
219
* distance to a surface element (size: n_points)
220
*----------------------------------------------------------------------------*/
223
cs_coupling_point_in_mesh_p(const void *mesh,
226
const ple_coord_t point_coords[],
227
ple_lnum_t location[],
230
/*----------------------------------------------------------------------------
231
* Find elements in a given mesh closest to points: updates the
232
* location[] and distance[] arrays associated with a set of points
233
* for points that are closer to an element of this mesh than to previously
234
* encountered elements.
236
* This function currently only handles elements of lower dimension than
237
* the spatial dimension.
239
* Location is relative to the id of a given element + 1 in
240
* concatenated sections of same element dimension.
243
* mesh <-- pointer to mesh representation structure
244
* n_points <-- number of points to locate
245
* point_coords <-- point coordinates
246
* location <-> number of element containing or closest to each
247
* point (size: n_points)
248
* distance <-> distance from point to element indicated by
249
* location[]: < 0 if unlocated, or absolute
250
* distance to a surface element (size: n_points)
251
*----------------------------------------------------------------------------*/
254
cs_coupling_point_closest_mesh(const void *mesh,
256
const ple_coord_t point_coords[],
257
ple_lnum_t location[],
260
/*----------------------------------------------------------------------------
261
* Find elements in a given mesh closest to points: updates the
262
* location[] and distance[] arrays associated with a set of points
263
* for points that are closer to an element of this mesh than to previously
264
* encountered elements.
266
* This function currently only handles elements of lower dimension than
267
* the spatial dimension.
269
* Location is relative to parent element numbers.
272
* mesh <-- pointer to mesh representation structure
273
* n_points <-- number of points to locate
274
* point_coords <-- point coordinates
275
* location <-> number of element containing or closest to each
276
* point (size: n_points)
277
* distance <-> distance from point to element indicated by
278
* location[]: < 0 if unlocated, or absolute
279
* distance to a surface element (size: n_points)
280
*----------------------------------------------------------------------------*/
283
cs_coupling_point_closest_mesh_p(const void *mesh,
285
const ple_coord_t point_coords[],
286
ple_lnum_t location[],
289
/*----------------------------------------------------------------------------*/
293
#endif /* __CS_COUPLING_H__ */