/usr/include/code_saturne/fvm_nodal.h is in code-saturne-include 3.2.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | #ifndef __FVM_NODAL_H__
#define __FVM_NODAL_H__
/*============================================================================
* Main structure for a nodal representation associated with a mesh
*============================================================================*/
/*
This file is part of Code_Saturne, a general-purpose CFD tool.
Copyright (C) 1998-2013 EDF S.A.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*----------------------------------------------------------------------------*/
#include "cs_defs.h"
/*----------------------------------------------------------------------------
* Local headers
*----------------------------------------------------------------------------*/
#include "fvm_defs.h"
#include "fvm_group.h"
#include "fvm_io_num.h"
/*----------------------------------------------------------------------------*/
BEGIN_C_DECLS
/*=============================================================================
* Macro definitions
*============================================================================*/
/*============================================================================
* Type definitions
*============================================================================*/
/*----------------------------------------------------------------------------
* Structure defining a mesh in nodal definition
*----------------------------------------------------------------------------*/
typedef struct _fvm_nodal_t fvm_nodal_t;
/*=============================================================================
* Static global variables
*============================================================================*/
/* Number of vertices associated with each "nodal" element type */
extern const int fvm_nodal_n_vertices_element[];
/*=============================================================================
* Public function prototypes
*============================================================================*/
/*----------------------------------------------------------------------------
* Creation of a nodal mesh representation structure.
*
* parameters:
* name <-- name that should be assigned to the nodal mesh
* dim <-- spatial dimension
*
* returns:
* pointer to created nodal mesh representation structure
*----------------------------------------------------------------------------*/
fvm_nodal_t *
fvm_nodal_create(const char *name,
int dim);
/*----------------------------------------------------------------------------
* Destruction of a nodal mesh representation structure.
*
* parameters:
* this_nodal <-> pointer to structure that should be destroyed
*
* returns:
* NULL pointer
*----------------------------------------------------------------------------*/
fvm_nodal_t *
fvm_nodal_destroy(fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Copy a nodal mesh representation structure, sharing arrays with the
* original structure.
*
* parameters:
* this_nodal <-> pointer to structure that should be copied
*
* returns:
* pointer to created nodal mesh representation structure
*----------------------------------------------------------------------------*/
fvm_nodal_t *
fvm_nodal_copy(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Reduction of a nodal mesh representation structure: only the associations
* (numberings) necessary to redistribution of fields for output are
* conserved, the full connectivity being in many cases no longer useful
* once it has been output. If the del_vertex_num value is set
* to true, vertex-based values may not be output in parallel mode
* after this function is called.
*
* parameters:
* this_nodal <-> pointer to structure that should be reduced
* del_vertex_num <-- indicates if vertex parent indirection and
* I/O numbering are destroyed (1) or not (0)
*----------------------------------------------------------------------------*/
void
fvm_nodal_reduce(fvm_nodal_t *this_nodal,
int del_vertex_num);
/*----------------------------------------------------------------------------
* Change entity parent numbering; this is useful when entities of the
* parent mesh have been renumbered after a nodal mesh representation
* structure's creation.
*
* parameters:
* this_nodal <-- nodal mesh structure
* new_parent_num <-- pointer to local parent renumbering array
* ({1, ..., n} <-- {1, ..., n})
* entity_dim <-- 3 for cells, 2 for faces, 1 for edges,
* and 0 for vertices
*----------------------------------------------------------------------------*/
void
fvm_nodal_change_parent_num(fvm_nodal_t *this_nodal,
const cs_lnum_t new_parent_num[],
int entity_dim);
/*----------------------------------------------------------------------------
* Remove entity parent numbering; this is useful for example when we
* want to assign coordinates or fields to an extracted mesh using
* arrays relative to the mesh, and not to its parent.
*
* This is equivalent to calling fvm_nodal_change_parent_num(), with
* 'trivial' (1 o n) new_parent_num[] values.
*
* parameters:
* this_nodal <-- nodal mesh structure
* entity_dim <-- 3 for cells, 2 for faces, 1 for edges,
* and 0 for vertices
*----------------------------------------------------------------------------*/
void
fvm_nodal_remove_parent_num(fvm_nodal_t *this_nodal,
int entity_dim);
/*----------------------------------------------------------------------------
* Build external numbering for entities based on global numbers.
*
* parameters:
* this_nodal <-- nodal mesh structure
* parent_global_number <-- pointer to list of global (i.e. domain splitting
* independent) parent entity numbers
* entity_dim <-- 3 for cells, 2 for faces, 1 for edges,
* and 0 for vertices
*----------------------------------------------------------------------------*/
void
fvm_nodal_init_io_num(fvm_nodal_t *this_nodal,
const cs_gnum_t parent_global_numbers[],
int entity_dim);
/*----------------------------------------------------------------------------
* Preset number and list of vertices to assign to a nodal mesh.
*
* If the parent_vertex_num argument is NULL, the list is assumed to
* be {1, 2, ..., n}. If parent_vertex_num is given, it specifies a
* list of n vertices from a larger set (1 to n numbering).
*
* Ownership of the given parent vertex numbering array is
* transferred to the nodal mesh representation structure.
*
* This function should be called before fvm_nodal_set_shared_vertices()
* or fvm_nodal_transfer_vertices() if we want to force certain
* vertices to appear in the mesh (especially if we want to define
* a mesh containing only vertices).
*
* parameters:
* this_nodal <-> nodal mesh structure
* n_vertices <-- number of vertices to assign
* parent_vertex_num <-- parent numbers of vertices to assign
*----------------------------------------------------------------------------*/
void
fvm_nodal_define_vertex_list(fvm_nodal_t *this_nodal,
cs_lnum_t n_vertices,
cs_lnum_t parent_vertex_num[]);
/*----------------------------------------------------------------------------
* Assign shared vertex coordinates to an extracted nodal mesh,
* renumbering vertex numbers based on those really referenced,
* and updating connectivity arrays in accordance.
*
* This function should be called once all element sections have
* been added to a nodal mesh representation.
*
* parameters:
* this_nodal <-> nodal mesh structure
* vertex_coords <-- coordinates of parent vertices (interlaced)
*----------------------------------------------------------------------------*/
void
fvm_nodal_set_shared_vertices(fvm_nodal_t *this_nodal,
const cs_coord_t vertex_coords[]);
/*----------------------------------------------------------------------------
* Assign private vertex coordinates to a nodal mesh,
* renumbering vertex numbers based on those really referenced,
* and updating connectivity arrays in accordance.
*
* Ownership of the given coordinates array is transferred to
* the nodal mesh representation structure.
*
* This function should only be called once all element sections
* have been added to a nodal mesh representation.
*
* parameters:
* this_nodal <-> nodal mesh structure
* vertex_coords <-- coordinates of parent vertices (interlaced)
*
* returns:
* updated pointer to vertex_coords (may be different from initial
* argument if vertices were renumbered).
*----------------------------------------------------------------------------*/
cs_coord_t *
fvm_nodal_transfer_vertices(fvm_nodal_t *this_nodal,
cs_coord_t vertex_coords[]);
/*----------------------------------------------------------------------------
* Make vertex coordinates of a nodal mesh private.
*
* If vertex coordinates were previously shared, those coordinates that
* are actually refernces are copied, and the relation to parent vertices
* is discarded.
*
* If vertices were already private, the mesh is not modified.
*
* parameters:
* this_nodal <-> nodal mesh structure
*----------------------------------------------------------------------------*/
void
fvm_nodal_make_vertices_private(fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Assign group class set descriptions to a nodal mesh.
*
* The structure builds its own copy of the group class sets,
* renumbering them so as to discard those not referenced.
* Empty group classes are also renumbered to zero.
*
* This function should only be called once all element sections
* have been added to a nodal mesh representation.
*
* parameters:
* this_nodal <-> nodal mesh structure
* gc_set <-- group class set descriptions
*----------------------------------------------------------------------------*/
void
fvm_nodal_set_group_class_set(fvm_nodal_t *this_nodal,
const fvm_group_class_set_t *gc_set);
/*----------------------------------------------------------------------------
* Obtain the name of a nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
*
* returns:
* pointer to constant string containing the mesh name
*----------------------------------------------------------------------------*/
const char *
fvm_nodal_get_name(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Return spatial dimension of the nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
*
* returns:
* spatial dimension
*----------------------------------------------------------------------------*/
int
fvm_nodal_get_dim(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Return maximum dimension of entities in a nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
*
* returns:
* maximum dimension of entities in mesh (0 to 3)
*----------------------------------------------------------------------------*/
int
fvm_nodal_get_max_entity_dim(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Return number of entities of a given dimension in a nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
* entity_dim <-- dimension of entities we want to count (0 to 3)
*
* returns:
* number of entities of given dimension in mesh
*----------------------------------------------------------------------------*/
cs_lnum_t
fvm_nodal_get_n_entities(const fvm_nodal_t *this_nodal,
int entity_dim);
/*----------------------------------------------------------------------------
* Return global number of vertices associated with nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
*
* returns:
* global number of vertices associated with nodal mesh
*----------------------------------------------------------------------------*/
cs_gnum_t
fvm_nodal_get_n_g_vertices(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Return global number of elements of a given type associated with nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
* element_type <-- type of elements for query
*
* returns:
* global number of elements of the given type associated with nodal mesh
*----------------------------------------------------------------------------*/
cs_gnum_t
fvm_nodal_get_n_g_elements(const fvm_nodal_t *this_nodal,
fvm_element_t element_type);
/*----------------------------------------------------------------------------
* Return local number of elements of a given type associated with nodal mesh.
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
* element_type <-- type of elements for query
*
* returns:
* local number of elements of the given type associated with nodal mesh
*----------------------------------------------------------------------------*/
cs_lnum_t
fvm_nodal_get_n_elements(const fvm_nodal_t *this_nodal,
fvm_element_t element_type);
/*----------------------------------------------------------------------------
* Return local parent numbering array for all entities of a given
* dimension in a nodal mesh.
*
* The number of entities of the given dimension may be obtained
* through fvm_nodal_get_n_entities(), the parent_num[] array is populated
* with the parent entity numbers of those entities, in order (i.e. in
* local section order, section by section).
*
* parameters:
* this_nodal <-- pointer to nodal mesh structure
* entity_dim <-- dimension of entities we are interested in (0 to 3)
* parent_num --> entity parent numbering (array must be pre-allocated)
*----------------------------------------------------------------------------*/
void
fvm_nodal_get_parent_num(const fvm_nodal_t *this_nodal,
int entity_dim,
cs_lnum_t parent_num[]);
/*----------------------------------------------------------------------------
* Compute tesselation a a nodal mesh's sections of a given type, and add the
* corresponding structure to the mesh representation.
*
* If global element numbers are used (i.e. in parallel mode), this function
* should be only be used after calling fvm_nodal_init_io_num().
*
* If some mesh sections have already been tesselated, their tesselation
* is unchanged.
*
* parameters:
* this_nodal <-> pointer to nodal mesh structure
* type <-> element type that should be tesselated
* error_count --> number of elements with a tesselation error
* counter (optional)
*----------------------------------------------------------------------------*/
void
fvm_nodal_tesselate(fvm_nodal_t *this_nodal,
fvm_element_t type,
cs_lnum_t *error_count);
/*----------------------------------------------------------------------------
* Build a nodal representation structure based on extraction of a
* mesh's edges.
*
* parameters:
* name <-- name to assign to extracted mesh
* this_nodal <-> pointer to nodal mesh structure
*----------------------------------------------------------------------------*/
fvm_nodal_t *
fvm_nodal_copy_edges(const char *name,
const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------
* Dump printout of a nodal representation structure.
*
* parameters:
* this_nodal <-- pointer to structure that should be dumped
*----------------------------------------------------------------------------*/
void
fvm_nodal_dump(const fvm_nodal_t *this_nodal);
/*----------------------------------------------------------------------------*/
END_C_DECLS
#endif /* __FVM_NODAL_H__ */
|