Debian Codegraph @

packages/seacas/libraries/nemesis/ne_nemesisI.h

raw
1 /*
2 * Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8
9 /****************************************************************************
10 * This file contains prototypes for the functions found in the NEMESIS
11 * library.
12 ****************************************************************************/
13 #pragma once
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /* If exodusII.h has been included, then these typedef are already defined */
20 #ifndef EXODUS_VERSION
21 #include <stdint.h>
22 /** Specifies that this argument is the id of an entity: element block, nodeset, sideset, ... */
23 typedef int64_t ex_entity_id;
24
25 /** The mechanism for passing double/float and int/int64_t both use a
26 void*; to avoid some confusion as to whether a function takes an
27 integer or a float/double, the following typedef is used for the
28 integer argument
29 */
30 typedef void void_int;
31 #endif
32
33 /*=============================================================================
34 * Initial Information Routines
35 *===========================================================================*/
36 extern int ne_get_init_info(int neid, /* NemesisI file ID */
37 int *num_proc, /* Number of processors */
38 int *num_proc_in_f, /* Number of procs in this file */
39 char *ftype);
40
41 extern int ne_put_init_info(int neid, /* NemesisI file ID */
42 int num_proc, /* Number of processors */
43 int num_proc_in_f, /* Number of procs in this file */
44 char *ftype);
45
46 extern int ne_get_init_global(int neid, /* NemesisI file ID */
47 void_int *num_nodes_g, /* Number of global FEM nodes */
48 void_int *num_elems_g, /* Number of global FEM elements */
49 void_int *num_elem_blks_g, /* Number of global elem blocks */
50 void_int *num_node_sets_g, /* Number of global node sets */
51 void_int *num_side_sets_g /* Number of global side sets */
52 );
53 extern int ne_put_init_global(int neid, /* NemesisI file ID */
54 int64_t num_nodes_g, /* Number of global FEM nodes */
55 int64_t num_elems_g, /* Number of global FEM elements */
56 int64_t num_elem_blks_g, /* Number of global elem blocks */
57 int64_t num_node_sets_g, /* Number of global node sets */
58 int64_t num_side_sets_g /* Number of global side sets */
59 );
60
61 extern int ne_put_version(int neid);
62
63 /*=============================================================================
64 * Loadbalance Parameter Routines
65 *===========================================================================*/
66 extern int ne_get_loadbal_param(int neid, /* NetCDF/Exodus file ID */
67 void_int *num_int_nodes, /* Number of internal FEM nodes */
68 void_int *num_bor_nodes, /* Number of border FEM nodes */
69 void_int *num_ext_nodes, /* Number of external FEM nodes */
70 void_int *num_int_elems, /* Number of internal FEM elems */
71 void_int *num_bor_elems, /* Number of border FEM elems */
72 void_int *num_node_cmaps, /* Number of nodal comm maps */
73 void_int *num_elem_cmaps, /* Number of elemental comm maps */
74 int processor /* Processor ID */
75 );
76
77 extern int ne_put_loadbal_param(int neid, /* NemesisI file ID */
78 int64_t num_int_nodes, /* Number of internal FEM nodes */
79 int64_t num_bor_nodes, /* Number of border FEM nodes */
80 int64_t num_ext_nodes, /* Number of external FEM nodes */
81 int64_t num_int_elems, /* Number of internal FEM elems */
82 int64_t num_bor_elems, /* Number of border FEM elems */
83 int64_t num_node_cmaps, /* Number of nodal comm maps */
84 int64_t num_elem_cmaps, /* Number of elemental comm maps */
85 int processor /* Processor ID */
86 );
87
88 extern int ne_put_loadbal_param_cc(int neid, /* NetCDF/Exodus file ID */
89 void_int *num_int_nodes, /* Number of internal node IDs */
90 void_int *num_bor_nodes, /* Number of border node IDs */
91 void_int *num_ext_nodes, /* Number of external node IDs */
92 void_int *num_int_elems, /* Number of internal elem IDs */
93 void_int *num_bor_elems, /* Number of border elem IDs */
94 void_int *num_node_cmaps, /* Number of nodal comm maps */
95 void_int *num_elem_cmaps /* Number of elem comm maps */
96 );
97
98 /*=============================================================================
99 * NS, SS & EB Global Parameter Routines
100 *===========================================================================*/
101 extern int ne_get_ns_param_global(int neid, /* NetCDF/Exodus file ID */
102 void_int *ns_ids_glob, /* Global IDs of node sets */
103 void_int *ns_n_cnt_glob, /* Count of nodes in node sets */
104 void_int *ns_df_cnt_glob /* Count of dist. factors in ns */
105 );
106
107 extern int
108 ne_put_ns_param_global(int neid, /* NemesisI file ID */
109 void_int *global_ids, /* Vector of global node-set IDs */
110 void_int *global_n_cnts, /* Vector of node counts in node-sets */
111 void_int *global_df_cnts /* Vector of dist factor counts in node-sets */
112 );
113
114 extern int ne_get_ss_param_global(int neid, /* NetCDF/Exodus file ID */
115 void_int *ss_ids_glob, /* Global side-set IDs */
116 void_int *ss_s_cnt_glob, /* Global side count */
117 void_int *ss_df_cnt_glob /* Global dist. factor count */
118 );
119
120 extern int ne_put_ss_param_global(int neid, /* NemesisI file ID */
121 void_int *global_ids, /* Vector of global side-set IDs */
122 void_int *global_el_cnts, /* Vector of element/side */
123 /* counts in each side set */
124 void_int *global_df_cnts /* Vector of dist. factor */
125 /* counts in each side set */
126 );
127
128 extern int ne_get_eb_info_global(int neid, /* NemesisI file ID */
129 void_int *el_blk_ids, /* Vector of global element IDs */
130 void_int *el_blk_cnts /* Vector of global element counts */
131 );
132
133 extern int ne_put_eb_info_global(int neid, /* NemesisI file ID */
134 void_int *el_blk_ids, /* Vector of global element IDs */
135 void_int *el_blk_cnts /* Vector of global element counts */
136 );
137
138 /*=============================================================================
139 * NS, SS & EB Subset Routines
140 *===========================================================================*/
141 extern int ne_get_n_side_set(int neid, /* NetCDF/Exodus file ID */
142 ex_entity_id side_set_id, /* Side-set ID to read */
143 int64_t start_side_num, /* Starting element number */
144 int64_t num_sides, /* Number of sides to read */
145 void_int *side_set_elem_list, /* List of element IDs */
146 void_int *side_set_side_list /* List of side IDs */
147 );
148
149 extern int ne_put_n_side_set(int neid, /* NetCDF/Exodus file ID */
150 ex_entity_id side_set_id, /* Side-set ID to write */
151 int64_t start_side_num, /* Starting element number */
152 int64_t num_sides, /* Number of sides to write */
153 const void_int *side_set_elem_list, /* List of element IDs */
154 const void_int *side_set_side_list /* List of side IDs */
155 );
156
157 extern int ne_get_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
158 ex_entity_id side_set_id, /* Side-set ID */
159 int64_t start_num, /* Starting df number */
160 int64_t num_df_to_get, /* Number of df's to read */
161 void *side_set_df /* Distribution factors */
162 );
163
164 extern int ne_put_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
165 ex_entity_id side_set_id, /* Side-set ID */
166 int64_t start_num, /* Starting df number */
167 int64_t num_df_to_get, /* Number of df's to write */
168 void *side_set_df /* Distribution factors */
169 );
170
171 extern int ne_get_n_node_set(int neid, /* NetCDF/Exodus file ID */
172 ex_entity_id node_set_id, /* Node set ID */
173 int64_t start_node_num, /* Node index to start reading at */
174 int64_t num_node, /* Number of nodes to read */
175 void_int *node_set_node_list /* List of nodes in node set */
176 );
177
178 extern int ne_put_n_node_set(int neid, /* NetCDF/Exodus file ID */
179 ex_entity_id node_set_id, /* Node set ID */
180 int64_t start_node_num, /* Node index to start writing at */
181 int64_t num_node, /* Number of nodes to write */
182 const void_int *node_set_node_list /* List of nodes in node set */
183 );
184
185 extern int ne_get_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
186 ex_entity_id node_set_id, /* Node-set ID */
187 int64_t start_num, /* Starting df number */
188 int64_t num_df_to_get, /* Number of df's to read */
189 void *node_set_df /* Distribution factors */
190 );
191
192 extern int ne_put_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
193 ex_entity_id node_set_id, /* Node-set ID */
194 int64_t start_num, /* Starting df number */
195 int64_t num_df_to_get, /* Number of df's to write */
196 void *node_set_df /* Distribution factors */
197 );
198
199 extern int ne_get_n_coord(int neid, /* NetCDF/Exodus file ID */
200 int64_t start_node_num, /* Starting position to read from */
201 int64_t num_nodes, /* Number of coords to read */
202 void *x_coor, /* Vector of X coordinates */
203 void *y_coor, /* Vector of Y coordinates */
204 void *z_coor /* Vector of Z coordinates */
205 );
206
207 extern int ne_put_n_coord(int neid, /* NetCDF/Exodus file ID */
208 int64_t start_node_num, /* Starting position to write to */
209 int64_t num_nodes, /* Number of coords to write */
210 void *x_coor, /* Vector of X coordinates */
211 void *y_coor, /* Vector of Y coordinates */
212 void *z_coor /* Vector of Z coordinates */
213 );
214
215 extern int ne_get_n_elem_conn(int neid, /* NetCDF/Exodus file ID */
216 ex_entity_id elem_blk_id, /* Element block ID */
217 int64_t start_elem_num, /* Starting position to read from */
218 int64_t num_elems, /* Number of elements to read */
219 void_int *connect /* Connectivity vector */
220 );
221
222 extern int ne_put_n_elem_conn(int neid, /* NetCDF/Exodus file ID */
223 ex_entity_id elem_blk_id, /* Element block ID */
224 int64_t start_elem_num, /* Starting position to write to */
225 int64_t num_elems, /* Number of elements to write */
226 const void_int *connect /* Connectivity vector */
227 );
228
229 extern int ne_get_n_elem_attr(int neid, /* NetCDF/Exodus file ID */
230 ex_entity_id elem_blk_id, /* Element block ID */
231 int64_t start_elem_num, /* Starting position to read from */
232 int64_t num_elems, /* Number of elements to read */
233 void *attrib /* Attribute */
234 );
235
236 extern int ne_put_n_elem_attr(int neid, /* NetCDF/Exodus file ID */
237 ex_entity_id elem_blk_id, /* Element block ID */
238 int64_t start_elem_num, /* Starting position to write to */
239 int64_t num_elems, /* Number of elements to write */
240 void *attrib /* Attribute */
241 );
242
243 extern int ne_get_elem_type(int neid, /* NetCDF/Exodus file ID */
244 ex_entity_id elem_blk_id, /* Element block ID */
245 char *elem_type /* The name of the element type */
246 );
247
248 /*=============================================================================
249 * Variable Routines
250 *===========================================================================*/
251 extern int ne_get_n_elem_var(int neid, /* NetCDF/Exodus file ID */
252 int time_step, /* time index */
253 int elem_var_index, /* elemental variable index */
254 ex_entity_id elem_blk_id, /* elemental block id */
255 int64_t num_elem_this_blk, /* number of elements in block */
256 int64_t start_elem_num, /* Starting position for read */
257 int64_t num_elem, /* Number of elements to read */
258 void *elem_var_vals /* variable values */
259 );
260
261 extern int ne_put_elem_var_slab(int neid, /* NetCDF/Exodus file ID */
262 int time_step, /* time index */
263 int elem_var_index, /* elemental variable index */
264 ex_entity_id elem_blk_id, /* elemental block id */
265 int64_t start_pos, /* Starting position to write to */
266 int64_t num_vals, /* Number of elements to write */
267 void *elem_var_vals /* variable values */
268 );
269
270 extern int ne_get_n_nodal_var(int neid, /* NetCDF/Exodus file ID */
271 int time_step, /* whole time step number */
272 int nodal_var_index, /* index of desired nodal var */
273 int64_t start_node_num, /* starting node number */
274 int64_t num_nodes, /* number of nodes to read */
275 void *nodal_vars /* array of nodal var values */
276 );
277
278 extern int ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file ID */
279 int time_step, /* The time step index */
280 int nodal_var_index, /* Nodal variable index */
281 int64_t start_pos, /* Start position for write */
282 int64_t num_vals, /* Number of nodal variables */
283 void *nodal_var_vals /* Nodal variable values */
284 );
285
286 /*=============================================================================
287 * Number Map Routines
288 *===========================================================================*/
289 extern int ne_get_n_elem_num_map(int neid, /* NetCDF/Exodus file ID */
290 int64_t start_ent, /* Starting position to read from */
291 int64_t num_ents, /* Number of elements to read */
292 void_int *elem_map /* element map numbers */
293 );
294
295 extern int ne_put_n_elem_num_map(int neid, /* NetCDF/Exodus file ID */
296 int64_t start_ent, /* Starting position to read from */
297 int64_t num_ents, /* Number of elements to read */
298 const void_int *elem_map /* element map numbers */
299 );
300
301 extern int ne_get_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
302 int64_t start_ent, /* starting node number */
303 int64_t num_ents, /* number of nodes to read */
304 void_int *node_map /* vector for node map */
305 );
306
307 extern int ne_put_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
308 int64_t start_ent, /* starting node number */
309 int64_t num_ents, /* number of nodes to read */
310 const void_int *node_map /* vector for node map */
311 );
312
313 extern int ne_get_node_map(int neid, /* NetCDF/Exodus file ID */
314 void_int *node_mapi, /* Internal FEM node IDs */
315 void_int *node_mapb, /* Border FEM node IDs */
316 void_int *node_mape, /* External FEM node IDs */
317 int processor /* Processor IDs */
318 );
319
320 extern int ne_put_node_map(int neid, /* NetCDF/Exodus file ID */
321 void_int *node_mapi, /* Internal FEM node IDs */
322 void_int *node_mapb, /* Border FEM node IDs */
323 void_int *node_mape, /* External FEM node IDs */
324 int processor /* This processor ID */
325 );
326
327 extern int ne_get_elem_map(int neid, /* NetCDF/Exodus file ID */
328 void_int *elem_mapi, /* Internal element IDs */
329 void_int *elem_mapb, /* Border element IDs */
330 int processor /* Processor ID */
331 );
332
333 extern int ne_put_elem_map(int neid, /* NetCDF/Exodus file ID */
334 void_int *elem_mapi, /* Internal FEM element IDs */
335 void_int *elem_mapb, /* Border FEM element IDs */
336 int processor /* This processor ID */
337 );
338
339 /*=============================================================================
340 * Communications Maps Routines
341 *===========================================================================*/
342
343 extern int ne_get_cmap_params(int neid, /* NetCDF/Exodus file ID */
344 void_int *node_cmap_ids, /* Nodal comm. map IDs */
345 void_int *node_cmap_node_cnts, /* Number of nodes in each map */
346 void_int *elem_cmap_ids, /* Elemental comm. map IDs */
347 void_int *elem_cmap_elem_cnts, /* Number of elems in each map */
348 int processor /* This processor ID */
349 );
350
351 extern int ne_put_cmap_params(int neid, /* NetCDF/Exodus file ID */
352 void_int *node_map_ids, /* Node map IDs */
353 void_int *node_map_node_cnts, /* Nodes in nodal comm */
354 void_int *elem_map_ids, /* Elem map IDs */
355 void_int *elem_map_elem_cnts, /* Elems in elemental comm */
356 int64_t processor /* This processor ID */
357 );
358
359 extern int ne_put_cmap_params_cc(int neid, /* NetCDF/Exodus file ID */
360 void_int *node_map_ids, /* Node map IDs */
361 void_int *node_map_node_cnts, /* Nodes in nodal comm */
362 void_int *node_proc_ptrs, /* Pointer into array for */
363 /* node maps */
364 void_int *elem_map_ids, /* Elem map IDs */
365 void_int *elem_map_elem_cnts, /* Elems in elemental comm */
366 void_int *elem_proc_ptrs /* Pointer into array for */
367 /* elem maps */
368 );
369
370 extern int ne_get_node_cmap(int neid, /* NetCDF/Exodus file ID */
371 ex_entity_id map_id, /* Map ID */
372 void_int *node_ids, /* FEM node IDs */
373 void_int *proc_ids, /* Processor IDs */
374 int processor /* This processor ID */
375 );
376
377 extern int ne_put_node_cmap(int neid, /* NetCDF/Exodus file ID */
378 ex_entity_id map_id, /* Nodal comm map ID */
379 void_int *node_ids, /* FEM node IDs */
380 void_int *proc_ids, /* Processor IDs */
381 int processor /* This processor ID */
382 );
383
384 extern int ne_get_elem_cmap(int neid, /* NetCDF/Exodus file ID */
385 ex_entity_id map_id, /* Elemental comm map ID */
386 void_int *elem_ids, /* Element IDs */
387 void_int *side_ids, /* Element side IDs */
388 void_int *proc_ids, /* Processor IDs */
389 int processor /* This processor ID */
390 );
391
392 extern int ne_put_elem_cmap(int neid, /* NetCDF/Exodus file ID */
393 ex_entity_id map_id, /* Elemental comm map ID */
394 void_int *elem_ids, /* Vector of element IDs */
395 void_int *side_ids, /* Vector of side IDs */
396 void_int *proc_ids, /* Vector of processor IDs */
397 int processor /* This processor ID */
398 );
399
400 /* Should be internal use only, but was in external include file for
401 nemesis and some codes are using the function
402 */
403 int ne_get_idx(int neid, /* NetCDF/Exodus file ID */
404 const char *ne_var_name, /* Nemesis index variable name */
405 int64_t *index, /* array of length 2 to hold results */
406 int pos /* position of this proc/cmap in index */
407 );
408
409 #ifdef __cplusplus
410 }
411 #endif