My Project
programmer's documentation
Functions
cs_renumber.c File Reference
#include "cs_defs.h"
#include <float.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <mpi.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "fvm_morton.h"
#include "fvm_hilbert.h"
#include "cs_halo.h"
#include "cs_join.h"
#include "cs_mesh.h"
#include "cs_mesh_adjacencies.h"
#include "cs_order.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_sort.h"
#include "cs_prototypes.h"
#include "cs_renumber.h"
Include dependency graph for cs_renumber.c:

Functions

void cs_renumber_set_n_threads (int n_threads)
 Set the target number of threads for mesh renumbering. More...
 
int cs_renumber_get_n_threads (void)
 Return the target number of threads for mesh renumbering. More...
 
void cs_renumber_set_min_subset_size (cs_lnum_t min_i_subset_size, cs_lnum_t min_b_subset_size)
 Set the minimum sunset sizes when renumbering for threads. More...
 
void cs_renumber_get_min_subset_size (cs_lnum_t *min_i_subset_size, cs_lnum_t *min_b_subset_size)
 Get the minimum sunset sizes when renumbering for threads. More...
 
void cs_renumber_set_algorithm (bool halo_adjacent_cells_last, bool halo_adjacent_faces_last, cs_renumber_ordering_t i_faces_base_ordering, cs_renumber_cells_type_t cells_pre_numbering, cs_renumber_cells_type_t cells_numbering, cs_renumber_i_faces_type_t i_faces_numbering, cs_renumber_b_faces_type_t b_faces_numbering, cs_renumber_vertices_type_t vertices_numbering)
 Select the algorithm for mesh renumbering. More...
 
void cs_renumber_get_algorithm (bool *halo_adjacent_cells_last, bool *halo_adjacent_faces_last, cs_renumber_ordering_t *i_faces_base_ordering, cs_renumber_cells_type_t *cells_pre_numbering, cs_renumber_cells_type_t *cells_numbering, cs_renumber_i_faces_type_t *i_faces_numbering, cs_renumber_b_faces_type_t *b_faces_numbering, cs_renumber_vertices_type_t *vertices_numbering)
 Return the algorithms for mesh renumbering. More...
 
void cs_renumber_mesh (cs_mesh_t *mesh)
 Renumber mesh elements for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_cells (cs_mesh_t *mesh)
 Renumber cells depending on code options and target machine. More...
 
void cs_renumber_i_faces (cs_mesh_t *mesh)
 Renumber interior faces for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_i_faces_by_gnum (cs_mesh_t *mesh)
 
void cs_renumber_b_faces (cs_mesh_t *mesh)
 Renumber boundary faces for vectorization or threading depending on code options and target machine. More...
 
void cs_renumber_b_faces_by_gnum (cs_mesh_t *mesh)
 
void cs_renumber_vertices (cs_mesh_t *mesh)
 Renumber vertices depending on code options and target machine. More...
 

Detailed Description

Optional mesh renumbering.

Function Documentation

◆ cs_renumber_b_faces()

void cs_renumber_b_faces ( cs_mesh_t mesh)

Renumber boundary faces for vectorization or threading depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_b_faces_by_gnum()

void cs_renumber_b_faces_by_gnum ( cs_mesh_t mesh)

◆ cs_renumber_cells()

void cs_renumber_cells ( cs_mesh_t mesh)

Renumber cells depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_get_algorithm()

void cs_renumber_get_algorithm ( bool *  halo_adjacent_cells_last,
bool *  halo_adjacent_faces_last,
cs_renumber_ordering_t i_faces_base_ordering,
cs_renumber_cells_type_t cells_pre_numbering,
cs_renumber_cells_type_t cells_numbering,
cs_renumber_i_faces_type_t i_faces_numbering,
cs_renumber_b_faces_type_t b_faces_numbering,
cs_renumber_vertices_type_t vertices_numbering 
)

Return the algorithms for mesh renumbering.

Any argument may be passed NULL if this option is not queried.

Parameters
[out]halo_adjacent_cells_lastif true, cells adjacent to ghost cells will be placed last (after pre-numbering)
[out]halo_adjacent_faces_lastif true, interior faces adjacent to ghost cells will be placed last (after pre-numbering)
[out]i_faces_base_orderingpre-ordering of interior faces by lowest or highest adjacent cell id
[out]cells_pre_numberingalgorithm for cells pre-numbering
[out]cells_numberingalgorithm for cells numbering
[out]i_faces_numberingalgorithm for interior faces numbering
[out]b_faces_numberingalgorithm for boundary faces numbering
[out]vertices_numberingalgorithm for vertices numbering

◆ cs_renumber_get_min_subset_size()

void cs_renumber_get_min_subset_size ( cs_lnum_t min_i_subset_size,
cs_lnum_t min_b_subset_size 
)

Get the minimum sunset sizes when renumbering for threads.

Parameters
[out]min_i_subset_sizeminimum number of interior faces per thread per group, or NULL
[out]min_b_subset_sizeminimum number of boundary faces per thread per group, or NULL

◆ cs_renumber_get_n_threads()

int cs_renumber_get_n_threads ( void  )

Return the target number of threads for mesh renumbering.

Returns
the target number of threads for mesh numbering

◆ cs_renumber_i_faces()

void cs_renumber_i_faces ( cs_mesh_t mesh)

Renumber interior faces for vectorization or threading depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_i_faces_by_gnum()

void cs_renumber_i_faces_by_gnum ( cs_mesh_t mesh)

◆ cs_renumber_mesh()

void cs_renumber_mesh ( cs_mesh_t mesh)

Renumber mesh elements for vectorization or threading depending on code options and target machine.

Renumbering cells may also allow improving locality (and favor faces renumbering). It is also possible to place cells connected to ghost cells last, which may be useful to enable computation/communication overlap.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure

◆ cs_renumber_set_algorithm()

void cs_renumber_set_algorithm ( bool  halo_adjacent_cells_last,
bool  halo_adjacent_faces_last,
cs_renumber_ordering_t  i_faces_base_ordering,
cs_renumber_cells_type_t  cells_pre_numbering,
cs_renumber_cells_type_t  cells_numbering,
cs_renumber_i_faces_type_t  i_faces_numbering,
cs_renumber_b_faces_type_t  b_faces_numbering,
cs_renumber_vertices_type_t  vertices_numbering 
)

Select the algorithm for mesh renumbering.

Parameters
[in]halo_adjacent_cells_lastif true, cells adjacent to ghost cells will be placed last (after pre-numbering)
[in]halo_adjacent_faces_lastif true, interior faces adjacent to ghost cells will be placed last (after pre-numbering)
[in]i_faces_base_orderingpre-ordering of interior faces by lowest or highest adjacent cell id
[in]cells_pre_numberingalgorithm for cells pre-numbering
[in]cells_numberingalgorithm for cells numbering
[in]i_faces_numberingalgorithm for interior faces numbering
[in]b_faces_numberingalgorithm for boundary faces numbering
[in]vertices_numberingalgorithm for vertices numbering

◆ cs_renumber_set_min_subset_size()

void cs_renumber_set_min_subset_size ( cs_lnum_t  min_i_subset_size,
cs_lnum_t  min_b_subset_size 
)

Set the minimum sunset sizes when renumbering for threads.

Parameters
[in]min_i_subset_sizeminimum number of interior faces per thread per group
[in]min_b_subset_sizeminimum number of boundary faces per thread per group

◆ cs_renumber_set_n_threads()

void cs_renumber_set_n_threads ( int  n_threads)

Set the target number of threads for mesh renumbering.

By default, the target number of threads is set to cs_glob_n_threads, but the value may be forced using this function. This is mainly useful for testing purposes.

Parameters
[in]n_threadstarget number of threads for mesh numbering

◆ cs_renumber_vertices()

void cs_renumber_vertices ( cs_mesh_t mesh)

Renumber vertices depending on code options and target machine.

parameters: mesh <-> pointer to global mesh structure

Parameters
[in,out]meshpointer to global mesh structure