#include "cs_defs.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include "bft_mem.h"
#include "bft_printf.h"
#include "fvm_io_num.h"
#include "fvm_periodicity.h"
#include "fvm_selector.h"
#include "cs_base.h"
#include "cs_halo.h"
#include "cs_halo_perio.h"
#include "cs_interface.h"
#include "cs_log.h"
#include "cs_mesh_halo.h"
#include "cs_numbering.h"
#include "cs_order.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_ext_neighborhood.h"
#include "cs_timer.h"
#include "cs_mesh.h"
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_t * | cs_mesh_create (void) |
cs_mesh_t * | cs_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_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_update_b_cells (cs_mesh_t *mesh) |
void | cs_mesh_update_auxiliary (cs_mesh_t *mesh) |
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) |
cs_gnum_t | cs_mesh_n_g_ghost_cells (cs_mesh_t *mesh) |
void | cs_mesh_clean_families (cs_mesh_t *mesh) |
fvm_group_class_set_t * | cs_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_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_get_perio_faces (const cs_mesh_t *mesh, cs_lnum_t **n_perio_face_couples, cs_gnum_t ***perio_face_couples) |
cs_gnum_t * | cs_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_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... | |
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.
[in] | m | pointer to mesh |
[in] | block_size | size of thread blocks (chunks) if > 0, ignored (recomputed) if 0 |
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.
[in] | m | pointer to mesh |
[in] | block_id | block id (usually matches chunk/task) |
[in] | block_count | number of thread blocks |
[in] | block_size | size of thread blocks (chunks) if > 0, ignored (recomputed) if 0 |
[in,out] | s_id | start index for the current block |
[in,out] | e_id | past-the-end index for the current block |
void cs_mesh_clean_families | ( | cs_mesh_t * | mesh | ) |
cs_mesh_t* cs_mesh_create | ( | void | ) |
fvm_group_class_set_t* cs_mesh_create_group_classes | ( | cs_mesh_t * | mesh | ) |
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.
This information is used only for mesh coarsening or post-processing output of the refinement level, so can be discarded in other cases.
[in,out] | mesh | pointer to mesh structure |
void cs_mesh_dump | ( | const cs_mesh_t * | mesh | ) |
void cs_mesh_free_rebuildable | ( | cs_mesh_t * | mesh, |
bool | free_halos | ||
) |
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_get_face_perio_num | ( | const cs_mesh_t * | mesh, |
int | perio_num[] | ||
) |
void cs_mesh_get_perio_faces | ( | const cs_mesh_t * | mesh, |
cs_lnum_t ** | n_perio_face_couples, | ||
cs_gnum_t *** | perio_face_couples | ||
) |
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.
[in] | m | pointer to mesh |
[in] | e2n | associated indexed sum algorithm type. |
[in] | block_size | size of thread blocks (chunks) if > 0, ignored (recomputed) if 0. |
[out] | n_groups | number of associated block groups |
[out] | n_blocks | number of associated blocks |
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.
[in] | m | pointer to mesh |
[in] | e2n | associated indexed sum algorithm type. |
[in] | group_id | group id |
[in] | block_id | block id (relative to group) |
[in] | block_count | number of blocks |
[in] | block_size | size of blocks (chunks) if > 0, ignored (recomputed) if 0 |
[in,out] | s_id | start index for the current block |
[in,out] | e_id | past-the-end index for the current block |
void cs_mesh_init_group_classes | ( | cs_mesh_t * | mesh | ) |
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.
[in,out] | mesh | pointer to mesh structure |
[in,out] | mb | pointer to mesh builder (for periodicity) |
[in] | halo_type | type of halo (standard or extended) |
[in] | verbosity | verbosity |
[in] | rebuild_vtx_interface | also rebuild vertex interfaces ? |
void cs_mesh_init_selectors | ( | void | ) |
void cs_mesh_print_info | ( | const cs_mesh_t * | mesh, |
const char * | name | ||
) |
void cs_mesh_reinit | ( | cs_mesh_t * | mesh | ) |
void cs_mesh_selector_stats | ( | 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_sym_tens | ( | cs_real_6_t * | var | ) |
void cs_mesh_sync_var_tens | ( | 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_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.
[in] | mesh | pointer to a mesh structure |
[out] | cell_b_flag | 1 for cells adjacent to boundary, 0 for others |
void cs_mesh_update_auxiliary | ( | cs_mesh_t * | mesh | ) |
void cs_mesh_update_b_cells | ( | cs_mesh_t * | mesh | ) |
void cs_mesh_update_selectors | ( | cs_mesh_t * | mesh | ) |
void synsca | ( | cs_real_t | var[] | ) |
void synsce | ( | cs_real_t | var[] | ) |
void syntin | ( | cs_real_t | var[] | ) |
void syntis | ( | cs_real_t | var[] | ) |
void synvie | ( | cs_real_t | var[] | ) |
void synvin | ( | cs_real_t | var[] | ) |