9.2
general documentation
cs_redistribute.h File Reference
+ Include dependency graph for cs_redistribute.h:

Go to the source code of this file.

Classes

struct  cs_distributor_t
 

Functions

template<typename T >
void cs_distribute_buffer (const cs_distributor_t *db, const int stride, T *buffer[])
 Distribute a buffer using the distributor structure. More...
 
template<typename T >
void cs_distribute_buffer_allocated (const cs_distributor_t *db, const int stride, const T send_buf[], T recv_buf[])
 Distribute a buffer using the distributor structure. More...
 
template<typename T >
void cs_distribute_buffer_indexed (const cs_distributor_t *db, cs_lnum_t *idx[], T *buffer[])
 Distribute an indexed array and its corresponding index array using the distributor structure. More...
 
void cs_distributor_destroy (cs_distributor_t **db)
 Destroy a distributor structure. More...
 
void cs_redistribute (const int cell_dest_rank[], cs_distributor_t **cd, cs_distributor_t **ifd, cs_distributor_t **bfd, cs_distributor_t **vd)
 Redistribute mesh and field data based on a cell destination rank map. More...
 

Function Documentation

◆ cs_distribute_buffer()

void cs_distribute_buffer ( const cs_distributor_t db,
const int  stride,
T *  buffer[] 
)

Distribute a buffer using the distributor structure.

This function guarantees the uniqueness of the elements post-redistribution.

Parameters
[in]dbpointer to the distributor
[in]stridestride of the array to distribute
[in,out]bufferpointer to the array to redistribute

◆ cs_distribute_buffer_allocated()

void cs_distribute_buffer_allocated ( const cs_distributor_t db,
const int  stride,
const T  send_buf[],
recv_buf[] 
)

Distribute a buffer using the distributor structure.

Unlike cs_distribute_buffer, the distribution is not in-place, and the recv_buf array must be allocated to the correct size by the caller.

This function guarantees the uniqueness of the elements post-redistribution.

Parameters
[in]dbpointer to the distributor
[in]stridestride of the array to distribute
[in]send_bufpointer to the array to redistribute
[out]recv_bufpointer to the redistributed array

◆ cs_distribute_buffer_indexed()

void cs_distribute_buffer_indexed ( const cs_distributor_t db,
cs_lnum_t idx[],
T *  buffer[] 
)

Distribute an indexed array and its corresponding index array using the distributor structure.

This function guarantees the uniqueness of the elements post-redistribution.

Parameters
[in]dbpointer to the distributor
[in,out]idxpointer to the index array to redistribute
[in,out]bufferpointer to the indexed array to redistribute

◆ cs_distributor_destroy()

void cs_distributor_destroy ( cs_distributor_t **  db)

Destroy a distributor structure.

Parameters
[in,out]dbpointer of pointer to a cs_distributor_structure

◆ cs_redistribute()

void cs_redistribute ( const int  cell_dest_rank[],
cs_distributor_t **  cell_db,
cs_distributor_t **  i_face_db,
cs_distributor_t **  b_face_db,
cs_distributor_t **  vertex_db 
)

Redistribute mesh and field data based on a cell destination rank map.

If no cell map is given, a random one is created internally.

The different distributors are returned if any of the pointers are not null. In this case, it is up to the caller to free them whenever they are no longer needed.

Parameters
[in]cell_dest_rankdestination rank for each cell
[out]cell_dbpointer of pointer to cell redistributor
[out]i_face_dbpointer of pointer to interior face redistributor
[out]b_face_dbpointer of pointer to boundary face redistributor
[out]vertex_dbpointer of pointer to vertex redistributor