8.1
general documentation
cs_mesh.h File Reference
#include "cs_defs.h"
#include "fvm_group.h"
#include "fvm_selector.h"
#include "fvm_periodicity.h"
#include "cs_base.h"
#include "cs_halo.h"
#include "cs_interface.h"
#include "cs_numbering.h"
#include "cs_parall.h"
#include "cs_range_set.h"
#include "cs_mesh_builder.h"
+ Include dependency graph for cs_mesh.h:

Go to the source code of this file.

Data Structures

struct  cs_mesh_t
 

Macros

#define CS_MESH_MODIFIED   (1 << 0)
 
#define CS_MESH_MODIFIED_BALANCE   (1 << 1)
 

Enumerations

enum  cs_mesh_time_dep_t { CS_MESH_FIXED , CS_MESH_TRANSIENT_COORDS , CS_MESH_TRANSIENT_CONNECT }
 

Functions

void synsca (cs_real_t var[])
 
void synsce (cs_real_t var[])
 
void synvin (cs_real_t var[])
 
void synvie (cs_real_t var[])
 
void syntin (cs_real_t var[])
 
void syntis (cs_real_t var[])
 
cs_mesh_tcs_mesh_create (void)
 
cs_mesh_tcs_mesh_destroy (cs_mesh_t *mesh)
 
void cs_mesh_reinit (cs_mesh_t *mesh)
 
cs_gnum_t cs_mesh_compact_gnum (cs_lnum_t n_elts, cs_gnum_t *elt_gnum)
 
void cs_mesh_free_rebuildable (cs_mesh_t *mesh, bool free_halos)
 
void cs_mesh_discard_free_faces (cs_mesh_t *mesh)
 
void cs_mesh_discard_free_vertices (cs_mesh_t *mesh)
 
void cs_mesh_discard_refinement_info (cs_mesh_t *mesh)
 Discard mesh refinement info. More...
 
void cs_mesh_update_b_cells (cs_mesh_t *mesh)
 
void cs_mesh_update_auxiliary (cs_mesh_t *mesh)
 
void cs_mesh_init_interfaces (cs_mesh_t *mesh, cs_mesh_builder_t *mb)
 
void cs_mesh_init_halo (cs_mesh_t *mesh, cs_mesh_builder_t *mb, cs_halo_type_t halo_type, int verbosity, bool rebuild_vtx_interace)
 
cs_gnum_t cs_mesh_n_g_ghost_cells (cs_mesh_t *mesh)
 
void cs_mesh_sync_var_scal (cs_real_t *var)
 
void cs_mesh_sync_var_scal_ext (cs_real_t *var)
 
void cs_mesh_sync_var_vect (cs_real_t *var)
 
void cs_mesh_sync_var_vect_ext (cs_real_t *var)
 
void cs_mesh_sync_var_tens (cs_real_t *var)
 
void cs_mesh_sync_var_sym_tens (cs_real_6_t *var)
 
void cs_mesh_clean_families (cs_mesh_t *mesh)
 
fvm_group_class_set_tcs_mesh_create_group_classes (cs_mesh_t *mesh)
 
void cs_mesh_init_group_classes (cs_mesh_t *mesh)
 
void cs_mesh_init_selectors (void)
 
void cs_mesh_update_selectors (cs_mesh_t *mesh)
 
void cs_mesh_get_perio_faces (const cs_mesh_t *mesh, cs_lnum_t **n_perio_face_couples, cs_gnum_t ***perio_face_couples)
 
cs_gnum_tcs_mesh_get_cell_gnum (const cs_mesh_t *mesh, int blank_perio)
 
void cs_mesh_get_face_perio_num (const cs_mesh_t *mesh, int perio_num[])
 
void cs_mesh_tag_boundary_cells (cs_mesh_t *mesh, int cell_b_flag[])
 Mark cells adjacent to boundary, through faces or vertices. More...
 
void cs_mesh_print_info (const cs_mesh_t *mesh, const char *name)
 
void cs_mesh_g_face_vertices_sizes (const cs_mesh_t *mesh, cs_gnum_t *g_i_face_vertices_size, cs_gnum_t *g_b_face_vertices_size)
 
void cs_mesh_selector_stats (cs_mesh_t *mesh)
 
void cs_mesh_dump (const cs_mesh_t *mesh)
 
void cs_mesh_i_faces_thread_block_count (const cs_mesh_t *m, const cs_e2n_sum_t e2n, int block_size, int *n_groups, int *n_blocks)
 Determine number of blocks and associated groups to be used for loops on interior faces. More...
 
void cs_mesh_i_faces_thread_block_range (const cs_mesh_t *m, const cs_e2n_sum_t e2n, int group_id, int block_id, int block_count, int block_size, cs_lnum_t *s_id, cs_lnum_t *e_id)
 Compute array index bounds for a block of interior faces associated to a thread or task. More...
 
int cs_mesh_b_faces_thread_block_count (const cs_mesh_t *m, int block_size)
 Return number of boundary face blocks associated to threads or tasks. More...
 
void cs_mesh_b_faces_thread_block_range (const cs_mesh_t *m, int block_id, int block_count, int block_size, cs_lnum_t *s_id, cs_lnum_t *e_id)
 Compute array index bounds for a block of boundary faces associated to a thread or task. More...
 

Variables

cs_mesh_tcs_glob_mesh
 

Macro Definition Documentation

◆ CS_MESH_MODIFIED

#define CS_MESH_MODIFIED   (1 << 0)

Any type of mesh modification

◆ CS_MESH_MODIFIED_BALANCE

#define CS_MESH_MODIFIED_BALANCE   (1 << 1)

Mesh modification has changed mesh distribution balance

Enumeration Type Documentation

◆ cs_mesh_time_dep_t

Mesh time dependency

Enumerator
CS_MESH_FIXED 

Mesh definitions do not change with time

CS_MESH_TRANSIENT_COORDS 

Vertex coordinates may change with time

CS_MESH_TRANSIENT_CONNECT 

Mesh connectivity may change with time

Function Documentation

◆ cs_mesh_b_faces_thread_block_count()

int cs_mesh_b_faces_thread_block_count ( const cs_mesh_t m,
int  block_size 
)

Return number of boundary face blocks associated to threads or tasks.

Parameters
[in]mpointer to mesh
[in]block_sizesize of thread blocks (chunks) if > 0, ignored (recomputed) if 0
Returns
number of associated blocks if block_size > 0, number of threads if block_size = 0.

◆ cs_mesh_b_faces_thread_block_range()

void cs_mesh_b_faces_thread_block_range ( const cs_mesh_t m,
int  block_id,
int  block_count,
int  block_size,
cs_lnum_t s_id,
cs_lnum_t e_id 
)

Compute array index bounds for a block of boundary faces associated to a thread or task.

When the mesh boundary faces are renumbered for threads (lexicographical ordering based on cell adjacency), the start and past-the-end indexes for the array range assigned to that block are adjusted so as to ensure all boundary faces adjacent to a given cell are assigned to the same block, so that no other block (task) thread references the same cell.

Parameters
[in]mpointer to mesh
[in]block_idblock id (usually matches chunk/task)
[in]block_countnumber of thread blocks
[in]block_sizesize of thread blocks (chunks) if > 0, ignored (recomputed) if 0
[in,out]s_idstart index for the current block
[in,out]e_idpast-the-end index for the current block

◆ cs_mesh_clean_families()

void cs_mesh_clean_families ( cs_mesh_t mesh)

◆ cs_mesh_compact_gnum()

cs_gnum_t cs_mesh_compact_gnum ( cs_lnum_t  n_elts,
cs_gnum_t elt_gnum 
)

◆ cs_mesh_create()

cs_mesh_t* cs_mesh_create ( void  )

◆ cs_mesh_create_group_classes()

fvm_group_class_set_t* cs_mesh_create_group_classes ( cs_mesh_t mesh)

◆ cs_mesh_destroy()

cs_mesh_t* cs_mesh_destroy ( cs_mesh_t mesh)

◆ cs_mesh_discard_free_faces()

void cs_mesh_discard_free_faces ( cs_mesh_t mesh)

◆ cs_mesh_discard_free_vertices()

void cs_mesh_discard_free_vertices ( cs_mesh_t mesh)

◆ cs_mesh_discard_refinement_info()

void cs_mesh_discard_refinement_info ( cs_mesh_t mesh)

Discard mesh refinement info.

This information is used only for mesh coarsening or post-processing output of the refinement level, so can be discarded in other cases.

Parameters
[in,out]meshpointer to mesh structure

◆ cs_mesh_dump()

void cs_mesh_dump ( const cs_mesh_t mesh)

◆ cs_mesh_free_rebuildable()

void cs_mesh_free_rebuildable ( cs_mesh_t mesh,
bool  free_halos 
)

◆ cs_mesh_g_face_vertices_sizes()

void cs_mesh_g_face_vertices_sizes ( const cs_mesh_t mesh,
cs_gnum_t g_i_face_vertices_size,
cs_gnum_t g_b_face_vertices_size 
)

◆ cs_mesh_get_cell_gnum()

cs_gnum_t* cs_mesh_get_cell_gnum ( const cs_mesh_t mesh,
int  blank_perio 
)

◆ cs_mesh_get_face_perio_num()

void cs_mesh_get_face_perio_num ( const cs_mesh_t mesh,
int  perio_num[] 
)

◆ cs_mesh_get_perio_faces()

void cs_mesh_get_perio_faces ( const cs_mesh_t mesh,
cs_lnum_t **  n_perio_face_couples,
cs_gnum_t ***  perio_face_couples 
)

◆ cs_mesh_i_faces_thread_block_count()

void cs_mesh_i_faces_thread_block_count ( const cs_mesh_t m,
const cs_e2n_sum_t  e2n,
int  block_size,
int *  n_groups,
int *  n_blocks 
)

Determine number of blocks and associated groups to be used for loops on interior faces.

Blocks from a same group may be processed in parallel, while blocks from separate groups must not run simultaneously to avoid race conditions.

Parameters
[in]mpointer to mesh
[in]e2nassociated indexed sum algorithm type.
[in]block_sizesize of thread blocks (chunks) if > 0, ignored (recomputed) if 0.
[out]n_groupsnumber of associated block groups
[out]n_blocksnumber of associated blocks

◆ cs_mesh_i_faces_thread_block_range()

void cs_mesh_i_faces_thread_block_range ( const cs_mesh_t m,
const cs_e2n_sum_t  e2n,
int  group_id,
int  block_id,
int  block_count,
int  block_size,
cs_lnum_t s_id,
cs_lnum_t e_id 
)

Compute array index bounds for a block of interior faces associated to a thread or task.

When the CS_E2N_SUM_SCATTER indexed sum algorithmm is used and mesh interior faces are renumbered for threads, the bounds provided are those based on the matching group and thread.

In other cases, if block_size < 1 (i.e. not specified), the start and past-the-end indexes are defined so as to evenly distribute values to threads, in a manner similar to OpenMP schedule(static). With a block size larger than zero, indexes will be simply based on the block's start and past-the end index.

Parameters
[in]mpointer to mesh
[in]e2nassociated indexed sum algorithm type.
[in]group_idgroup id
[in]block_idblock id (relative to group)
[in]block_countnumber of blocks
[in]block_sizesize of blocks (chunks) if > 0, ignored (recomputed) if 0
[in,out]s_idstart index for the current block
[in,out]e_idpast-the-end index for the current block

◆ cs_mesh_init_group_classes()

void cs_mesh_init_group_classes ( cs_mesh_t mesh)

◆ cs_mesh_init_halo()

void cs_mesh_init_halo ( cs_mesh_t mesh,
cs_mesh_builder_t mb,
cs_halo_type_t  halo_type,
int  verbosity,
bool  rebuild_vtx_interface 
)

Creation and initialization of halo structures.

Treatment of parallel and/or periodic halos for standard and extended ghost cells according to halo type requested by global options.

Parameters
[in,out]meshpointer to mesh structure
[in,out]mbpointer to mesh builder (for periodicity)
[in]halo_typetype of halo (standard or extended)
[in]verbosityverbosity
[in]rebuild_vtx_interfacealso rebuild vertex interfaces ?

◆ cs_mesh_init_interfaces()

void cs_mesh_init_interfaces ( cs_mesh_t mesh,
cs_mesh_builder_t mb 
)

◆ cs_mesh_init_selectors()

void cs_mesh_init_selectors ( void  )

◆ cs_mesh_n_g_ghost_cells()

cs_gnum_t cs_mesh_n_g_ghost_cells ( cs_mesh_t mesh)

◆ cs_mesh_print_info()

void cs_mesh_print_info ( const cs_mesh_t mesh,
const char *  name 
)

◆ cs_mesh_reinit()

void cs_mesh_reinit ( cs_mesh_t mesh)

◆ cs_mesh_selector_stats()

void cs_mesh_selector_stats ( cs_mesh_t mesh)

◆ cs_mesh_sync_var_scal()

void cs_mesh_sync_var_scal ( cs_real_t var)

◆ cs_mesh_sync_var_scal_ext()

void cs_mesh_sync_var_scal_ext ( cs_real_t var)

◆ cs_mesh_sync_var_sym_tens()

void cs_mesh_sync_var_sym_tens ( cs_real_6_t var)

◆ cs_mesh_sync_var_tens()

void cs_mesh_sync_var_tens ( cs_real_t var)

◆ cs_mesh_sync_var_vect()

void cs_mesh_sync_var_vect ( cs_real_t var)

◆ cs_mesh_sync_var_vect_ext()

void cs_mesh_sync_var_vect_ext ( cs_real_t var)

◆ cs_mesh_tag_boundary_cells()

void cs_mesh_tag_boundary_cells ( cs_mesh_t mesh,
int  cell_b_flag[] 
)

Mark cells adjacent to boundary, through faces or vertices.

Note that cells adjacent through a boundary face can be accessed directly through the mesh->b_cells member, but the set of cells flagged by this function is more complete.

Parameters
[in]meshpointer to a mesh structure
[out]cell_b_flag1 for cells adjacent to boundary, 0 for others

◆ cs_mesh_update_auxiliary()

void cs_mesh_update_auxiliary ( cs_mesh_t mesh)

◆ cs_mesh_update_b_cells()

void cs_mesh_update_b_cells ( cs_mesh_t mesh)

◆ cs_mesh_update_selectors()

void cs_mesh_update_selectors ( cs_mesh_t mesh)

◆ synsca()

void synsca ( cs_real_t  var[])

◆ synsce()

void synsce ( cs_real_t  var[])

◆ syntin()

void syntin ( cs_real_t  var[])

◆ syntis()

void syntis ( cs_real_t  var[])

◆ synvie()

void synvie ( cs_real_t  var[])

◆ synvin()

void synvin ( cs_real_t  var[])

Variable Documentation

◆ cs_glob_mesh

cs_mesh_t* cs_glob_mesh
extern