9.0
general documentation
Loading...
Searching...
No Matches
cs_block_to_part.h File Reference
#include "base/cs_defs.h"
#include "base/cs_block_dist.h"
Include dependency graph for cs_block_to_part.h:

Go to the source code of this file.

Functions

void cs_block_to_part_global_to_local (cs_lnum_t n_ents, cs_lnum_t base, cs_lnum_t global_list_size, bool global_list_is_sorted, const cs_gnum_t global_list[], const cs_gnum_t global_number[], cs_lnum_t local_number[])
 Determine local references from references to global numbers.

Function Documentation

◆ cs_block_to_part_global_to_local()

void cs_block_to_part_global_to_local ( cs_lnum_t n_ents,
cs_lnum_t base,
cs_lnum_t global_list_size,
bool global_list_is_sorted,
const cs_gnum_t global_list[],
const cs_gnum_t global_number[],
cs_lnum_t local_number[] )

Determine local references from references to global numbers.

This is based on finding the local id of a given global number using a binary search.

Global numbers use a 1 to n numbering, while local numbers use a 0+base to n-1+base numbering. If an entity's global number does not appear in the global list, base-1 is assigned for that entity's local list.

If list contains duplicate values, any local id having a multiple global number (i.e not necessarily the smallest one) may be assigned to the corresponding local_number[] entry.

Parameters
[in]n_entsnumber of entities
[in]basebase numbering (typically 0 or 1)
[in]global_list_sizesize of global entity list
[in]global_list_is_sortedtrue if global entity list is guaranteed to be sorted
[in]global_listglobal entity list
[in]global_numberentity global numbers (size: n_ents)
[out]local_numberentity local numbers (size: n_ents)