8.1
general documentation
cs_internal_coupling.h File Reference
#include <ple_locator.h>
#include "cs_defs.h"
#include "cs_base.h"
#include "cs_field.h"
#include "cs_matrix_assembler.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_parameters.h"
+ Include dependency graph for cs_internal_coupling.h:

Go to the source code of this file.

Data Structures

struct  cs_internal_coupling_t
 

Functions

int cs_internal_coupling_n_couplings (void)
 Return number of defined internal couplings. More...
 
void cs_internal_coupling_add (const char criteria_cells[], const char criteria_faces[])
 Define coupling volume using given selection criteria. More...
 
void cs_internal_coupling_add_volume (const char criteria_cells[])
 Define coupling volume using given criteria. Then, this volume will be separated from the rest of the domain with thin walls. More...
 
void cs_internal_coupling_add_volume_zone (const cs_zone_t *z)
 Define coupling volume using a cs_zone_t. Then, this volume will be separated from the rest of the domain with thin walls. More...
 
void cs_internal_coupling_add_volume_zones (int n_zones, const int zone_ids[])
 Define coupling volume using given cs_zone_t. Then, this volume will be separated from the rest of the domain with thin walls. More...
 
void cs_internal_coupling_add_boundary_groups (cs_internal_coupling_t *cpl, const char *interior_name, const char *exterior_name)
 Define internal coupling volume boundary group names. More...
 
void cs_internal_coupling_bcs (int bc_type[])
 Impose wall BCs to internal coupled faces if not yet defined. More...
 
void cs_internal_coupling_finalize (void)
 Destruction of all internal coupling related structures. More...
 
cs_internal_coupling_tcs_internal_coupling_by_id (int coupling_id)
 Return the coupling associated with a given coupling_id. More...
 
void cs_internal_coupling_exchange_var (const cs_internal_coupling_t *cpl, int stride, cs_real_t distant[], cs_real_t local[])
 Exchange quantities from distant to local (update local using distant). More...
 
void cs_internal_coupling_exchange_by_cell_id (const cs_internal_coupling_t *cpl, int stride, const cs_real_t tab[], cs_real_t local[])
 Exchange variable between groups using cell id. More...
 
void cs_internal_coupling_exchange_by_face_id (const cs_internal_coupling_t *cpl, int stride, const cs_real_t tab[], cs_real_t local[])
 Exchange variable between groups using face id. More...
 
void cs_internal_coupling_it_cocg_contribution (const cs_internal_coupling_t *cpl, cs_real_33_t cocg[])
 
void cs_internal_coupling_setup (void)
 Setup internal coupling related parameters. More...
 
void cs_internal_coupling_initialize (void)
 Initialize internal coupling related structures. More...
 
void cs_internal_coupling_iterative_scalar_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], cs_real_3_t *restrict grad, const cs_real_t pvar[], cs_real_3_t rhs[])
 Add internal coupling rhs contribution for iterative gradient calculation. More...
 
void cs_internal_coupling_iterative_vector_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], cs_real_33_t *restrict grad, const cs_real_3_t pvar[], cs_real_33_t rhs[])
 Add internal coupling rhs contribution for iterative vector gradient calculation. More...
 
void cs_internal_coupling_iterative_tensor_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], cs_real_63_t *restrict grad, const cs_real_6_t pvar[], cs_real_63_t rhs[])
 Add internal coupling rhs contribution for iterative tensor gradient calculation. More...
 
void cs_internal_coupling_reconstruct_scalar_gradient (const cs_internal_coupling_t *cpl, cs_real_3_t *restrict r_grad, cs_real_3_t grad[])
 Add internal coupling contribution for reconstruction of the gradient of a scalar. More...
 
void cs_internal_coupling_reconstruct_vector_gradient (const cs_internal_coupling_t *cpl, cs_real_33_t *restrict r_grad, cs_real_33_t grad[])
 Add internal coupling contribution for reconstruction of the gradient of a vector. More...
 
void cs_internal_coupling_reconstruct_tensor_gradient (const cs_internal_coupling_t *cpl, cs_real_63_t *restrict r_grad, cs_real_63_t grad[])
 Add internal coupling contribution for reconstruction of the gradient of a symmetric tensor. More...
 
void cs_internal_coupling_update_bc_coeff_s (cs_field_bc_coeffs_t *bc_coeffs, const cs_internal_coupling_t *cpl, cs_halo_type_t halo_type, int w_stride, double clip_coeff, cs_real_t *bc_coeff_a, cs_real_t *bc_coeff_b, const cs_real_t *var, const cs_real_t *c_weight)
 Compute scalar boundary condition coefficients for internal coupling. More...
 
void cs_internal_coupling_update_bc_coeff_v (cs_field_bc_coeffs_t *bc_coeffs, const cs_internal_coupling_t *cpl, cs_halo_type_t halo_type, double clip_coeff, cs_real_t bc_coeff_a[][3], cs_real_t bc_coeff_b[][3][3], const cs_real_3_t *var, const cs_real_t *c_weight)
 Update vector boundary condition coefficients for internal coupling. More...
 
void cs_internal_coupling_spmv_contribution (bool exclude_diag, const cs_field_t *f, const cs_real_t *restrict x, cs_real_t *restrict y)
 
void cs_internal_coupling_matrix_add_ids (int coupling_id, const cs_gnum_t *r_g_id, cs_matrix_assembler_t *ma)
 
void cs_internal_coupling_matrix_add_values (const cs_field_t *f, cs_lnum_t db_size, cs_lnum_t eb_size, const cs_gnum_t r_g_id[], cs_matrix_assembler_values_t *mav)
 
void cs_internal_coupling_coupled_faces (const cs_internal_coupling_t *cpl, cs_lnum_t *n_local, const cs_lnum_t *faces_local[], cs_lnum_t *n_distant, const cs_lnum_t *faces_distant[])
 
void cs_internal_coupling_log (const cs_internal_coupling_t *cpl)
 
void cs_internal_coupling_dump (void)
 
void cs_internal_coupling_preprocess (cs_mesh_t *mesh)
 
void cs_internal_coupling_map (cs_mesh_t *mesh)
 
void cs_internal_coupling_add_entity (int f_id)
 
void cs_internal_coupling_initialize_scalar_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], const cs_real_t pvar[], cs_real_3_t *restrict grad)
 Add contribution from coupled faces (internal coupling) to initialisation for iterative scalar gradient calculation. More...
 
void cs_internal_coupling_initialize_vector_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], const cs_real_3_t pvar[], cs_real_33_t *restrict grad)
 Add contribution from coupled faces (internal coupling) to initialisation for iterative vector gradient calculation. More...
 
void cs_internal_coupling_initialize_tensor_gradient (const cs_internal_coupling_t *cpl, const cs_real_t c_weight[], const cs_real_6_t pvar[], cs_real_63_t *restrict grad)
 Add contribution from coupled faces (internal coupling) to initialisation for iterative symmetric tensor gradient calculation. More...
 
void cs_ic_field_set_exchcoeff (const cs_field_t *f, const cs_real_t *hbnd)
 Update internal coupling coefficients of the field of the given id using given boundary exchange coefficients passed by face id. More...
 
void cs_ic_field_dist_data_by_face_id (const int field_id, int stride, const cs_real_t tab_distant[], cs_real_t tab_local[])
 Get distant data using face id at all coupling faces for a given field id. More...
 

Function Documentation

◆ cs_ic_field_dist_data_by_face_id()

void cs_ic_field_dist_data_by_face_id ( const int  field_id,
int  stride,
const cs_real_t  tab_distant[],
cs_real_t  tab_local[] 
)

Get distant data using face id at all coupling faces for a given field id.

Parameters
[in]field_idfield id
[in]stridenumber of values (interlaced) by entity
[in]tab_distantexchanged data by face id
[out]tab_locallocal data by face id

◆ cs_ic_field_set_exchcoeff()

void cs_ic_field_set_exchcoeff ( const cs_field_t f,
const cs_real_t hbnd 
)

Update internal coupling coefficients of the field of the given id using given boundary exchange coefficients passed by face id.

Parameters
[in]fpointer to field
[in]hbndboundary exchange coefficients passed by face id

◆ cs_internal_coupling_add()

void cs_internal_coupling_add ( const char  criteria_cells[],
const char  criteria_faces[] 
)

Define coupling volume using given selection criteria.

Then, this volume must be separated from the rest of the domain with a wall.

Parameters
[in]criteria_cellscriteria for the first group of cells
[in]criteria_facescriteria for faces to be joined

◆ cs_internal_coupling_add_boundary_groups()

void cs_internal_coupling_add_boundary_groups ( cs_internal_coupling_t cpl,
const char *  interior_name,
const char *  exterior_name 
)

Define internal coupling volume boundary group names.

This is used only for internal couplings based on a separation of volumes (cs_internal_coupling_add_volume, cs_internal_coupling_add_volume_zone, cs_internal_coupling_add_volume_zones).

The interior name is used for faces adjacent to the main volume, and the exterio name for faces adjacent to the selected (exterior) volume.

This allows filtering faces on each side of the boundary in a simpler manner.

Parameters
[in,out]cplpointer to mesh structure to modify
[in]criteria_cellscriteria for the first group of cells

◆ cs_internal_coupling_add_entity()

void cs_internal_coupling_add_entity ( int  f_id)

◆ cs_internal_coupling_add_volume()

void cs_internal_coupling_add_volume ( const char  criteria_cells[])

Define coupling volume using given criteria. Then, this volume will be separated from the rest of the domain with thin walls.

Parameters
[in]criteria_cellscriteria for the first group of cells

◆ cs_internal_coupling_add_volume_zone()

void cs_internal_coupling_add_volume_zone ( const cs_zone_t z)

Define coupling volume using a cs_zone_t. Then, this volume will be separated from the rest of the domain with thin walls.

Parameters
[in]zpointer to cs_volume_zone_t

Define coupling volume using a cs_zone_t. Then, this volume will be separated from the rest of the domain with thin walls.

Parameters
[in]zpointer to cs_volume_zone_t

◆ cs_internal_coupling_add_volume_zones()

void cs_internal_coupling_add_volume_zones ( int  n_zones,
const int  zone_ids[] 
)

Define coupling volume using given cs_zone_t. Then, this volume will be separated from the rest of the domain with thin walls.

Parameters
[in]n_zonesnumber of associated volume zones
[in]zone_idsids of associated volume zones

◆ cs_internal_coupling_bcs()

void cs_internal_coupling_bcs ( int  bc_type[])

Impose wall BCs to internal coupled faces if not yet defined.

Parameters
[in,out]bc_typeface boundary condition type

◆ cs_internal_coupling_by_id()

cs_internal_coupling_t* cs_internal_coupling_by_id ( int  coupling_id)

Return the coupling associated with a given coupling_id.

Parameters
[in]coupling_idassociated with a coupling entity
Returns
pointer to associated coupling structure

◆ cs_internal_coupling_coupled_faces()

void cs_internal_coupling_coupled_faces ( const cs_internal_coupling_t cpl,
cs_lnum_t n_local,
const cs_lnum_t faces_local[],
cs_lnum_t n_distant,
const cs_lnum_t faces_distant[] 
)

◆ cs_internal_coupling_dump()

void cs_internal_coupling_dump ( void  )

◆ cs_internal_coupling_exchange_by_cell_id()

void cs_internal_coupling_exchange_by_cell_id ( const cs_internal_coupling_t cpl,
int  stride,
const cs_real_t  tab[],
cs_real_t  local[] 
)

Exchange variable between groups using cell id.

Parameters
[in]cplpointer to coupling entity
[in]stridenumber of values (non interlaced) by entity
[in]tabvariable exchanged
[out]locallocal data

◆ cs_internal_coupling_exchange_by_face_id()

void cs_internal_coupling_exchange_by_face_id ( const cs_internal_coupling_t cpl,
int  stride,
const cs_real_t  tab[],
cs_real_t  local[] 
)

Exchange variable between groups using face id.

Parameters
[in]cplpointer to coupling entity
[in]stridenumber of values (non interlaced) by entity
[in]tabvariable exchanged
[out]locallocal data

◆ cs_internal_coupling_exchange_var()

void cs_internal_coupling_exchange_var ( const cs_internal_coupling_t cpl,
int  stride,
cs_real_t  distant[],
cs_real_t  local[] 
)

Exchange quantities from distant to local (update local using distant).

Parameters
[in]cplpointer to coupling entity
[in]stridestride (e.g. 1 for double, 3 for interleaved coordinates)
[in]distantdistant values, size coupling->n_distant
[out]locallocal values, size coupling->n_local

◆ cs_internal_coupling_finalize()

void cs_internal_coupling_finalize ( void  )

Destruction of all internal coupling related structures.

◆ cs_internal_coupling_initialize()

void cs_internal_coupling_initialize ( void  )

Initialize internal coupling related structures.

◆ cs_internal_coupling_initialize_scalar_gradient()

void cs_internal_coupling_initialize_scalar_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
const cs_real_t  pvar[],
cs_real_3_t *restrict  grad 
)

Add contribution from coupled faces (internal coupling) to initialisation for iterative scalar gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in]pvarvariable
[in,out]gradgradient

◆ cs_internal_coupling_initialize_tensor_gradient()

void cs_internal_coupling_initialize_tensor_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
const cs_real_6_t  pvar[],
cs_real_63_t *restrict  grad 
)

Add contribution from coupled faces (internal coupling) to initialisation for iterative symmetric tensor gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in,out]pvarvariable
[in,out]gradgradient

◆ cs_internal_coupling_initialize_vector_gradient()

void cs_internal_coupling_initialize_vector_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
const cs_real_3_t  pvar[],
cs_real_33_t *restrict  grad 
)

Add contribution from coupled faces (internal coupling) to initialisation for iterative vector gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in]pvarvariable
[in,out]gradgradient

◆ cs_internal_coupling_it_cocg_contribution()

void cs_internal_coupling_it_cocg_contribution ( const cs_internal_coupling_t cpl,
cs_real_33_t  cocg[] 
)

◆ cs_internal_coupling_iterative_scalar_gradient()

void cs_internal_coupling_iterative_scalar_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
cs_real_3_t *restrict  grad,
const cs_real_t  pvar[],
cs_real_3_t  rhs[] 
)

Add internal coupling rhs contribution for iterative gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in]gradpointer to gradient
[in]pvarpointer to variable
[in,out]rhspointer to rhs contribution

◆ cs_internal_coupling_iterative_tensor_gradient()

void cs_internal_coupling_iterative_tensor_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
cs_real_63_t *restrict  grad,
const cs_real_6_t  pvar[],
cs_real_63_t  rhs[] 
)

Add internal coupling rhs contribution for iterative tensor gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in]gradpointer to gradient
[in]pvarpointer to variable
[in,out]rhspointer to rhs contribution

◆ cs_internal_coupling_iterative_vector_gradient()

void cs_internal_coupling_iterative_vector_gradient ( const cs_internal_coupling_t cpl,
const cs_real_t  c_weight[],
cs_real_33_t *restrict  grad,
const cs_real_3_t  pvar[],
cs_real_33_t  rhs[] 
)

Add internal coupling rhs contribution for iterative vector gradient calculation.

Parameters
[in]cplpointer to coupling entity
[in]c_weightweighted gradient coefficient variable, or NULL
[in]gradpointer to gradient
[in]pvarpointer to variable
[in,out]rhspointer to rhs contribution

◆ cs_internal_coupling_log()

void cs_internal_coupling_log ( const cs_internal_coupling_t cpl)

◆ cs_internal_coupling_map()

void cs_internal_coupling_map ( cs_mesh_t mesh)

◆ cs_internal_coupling_matrix_add_ids()

void cs_internal_coupling_matrix_add_ids ( int  coupling_id,
const cs_gnum_t r_g_id,
cs_matrix_assembler_t ma 
)

◆ cs_internal_coupling_matrix_add_values()

void cs_internal_coupling_matrix_add_values ( const cs_field_t f,
cs_lnum_t  db_size,
cs_lnum_t  eb_size,
const cs_gnum_t  r_g_id[],
cs_matrix_assembler_values_t mav 
)

◆ cs_internal_coupling_n_couplings()

int cs_internal_coupling_n_couplings ( void  )

Return number of defined internal couplings.

Returns
number of internal couplings

◆ cs_internal_coupling_preprocess()

void cs_internal_coupling_preprocess ( cs_mesh_t mesh)

◆ cs_internal_coupling_reconstruct_scalar_gradient()

void cs_internal_coupling_reconstruct_scalar_gradient ( const cs_internal_coupling_t cpl,
cs_real_3_t *restrict  r_grad,
cs_real_3_t  grad[] 
)

Add internal coupling contribution for reconstruction of the gradient of a scalar.

Parameters
[in]cplpointer to coupling entity
[in]r_gradpointer to reconstruction gradient
[in,out]gradpointer to gradient to be reconstructed var

◆ cs_internal_coupling_reconstruct_tensor_gradient()

void cs_internal_coupling_reconstruct_tensor_gradient ( const cs_internal_coupling_t cpl,
cs_real_63_t *restrict  r_grad,
cs_real_63_t  grad[] 
)

Add internal coupling contribution for reconstruction of the gradient of a symmetric tensor.

Parameters
[in]cplpointer to coupling entity
[in]r_gradpointer to reconstruction gradient
[in,out]gradpointer to gradient to be reconstructed var

◆ cs_internal_coupling_reconstruct_vector_gradient()

void cs_internal_coupling_reconstruct_vector_gradient ( const cs_internal_coupling_t cpl,
cs_real_33_t *restrict  r_grad,
cs_real_33_t  grad[] 
)

Add internal coupling contribution for reconstruction of the gradient of a vector.

Parameters
[in]cplpointer to coupling entity
[in]r_gradpointer to reconstruction gradient
[in,out]gradpointer to gradient to be reconstructed var

◆ cs_internal_coupling_setup()

void cs_internal_coupling_setup ( void  )

Setup internal coupling related parameters.

◆ cs_internal_coupling_spmv_contribution()

void cs_internal_coupling_spmv_contribution ( bool  exclude_diag,
const cs_field_t f,
const cs_real_t *restrict  x,
cs_real_t *restrict  y 
)

◆ cs_internal_coupling_update_bc_coeff_s()

void cs_internal_coupling_update_bc_coeff_s ( cs_field_bc_coeffs_t bc_coeffs,
const cs_internal_coupling_t cpl,
cs_halo_type_t  halo_type,
int  w_stride,
double  clip_coeff,
cs_real_t bc_coeff_a,
cs_real_t bc_coeff_b,
const cs_real_t var,
const cs_real_t c_weight 
)

Compute scalar boundary condition coefficients for internal coupling.

Parameters
[in]bc_coeffsassociated BC coefficients structure
[in]cplstructure associated with internal coupling
[in]halo_typehalo type
[in]w_stridestride for weighting coefficient
[in]clip_coeffclipping coefficient
[out]bc_coeff_aboundary condition term a
[out]bc_coeff_bboundary condition term b
[in]vargradient's base variable
[in]c_weightweighted gradient coefficient variable, or NULL

Compute scalar boundary condition coefficients for internal coupling.

Parameters
[in]bc_coeffsassociated BC coefficients structure
[in]cplstructure associated with internal coupling
[in]halo_typehalo type
[in]w_stridestride for weighting coefficient
[in]clip_coeffclipping coefficient
[out]bc_coeff_aboundary condition term a
[out]bc_coeff_bboundary condition term b
[in]vargradient's base variable
[in]c_weightweighted gradient coefficient variable, or NULL

◆ cs_internal_coupling_update_bc_coeff_v()

void cs_internal_coupling_update_bc_coeff_v ( cs_field_bc_coeffs_t bc_coeffs,
const cs_internal_coupling_t cpl,
cs_halo_type_t  halo_type,
double  clip_coeff,
cs_real_t  bc_coeff_a[][3],
cs_real_t  bc_coeff_b[][3][3],
const cs_real_3_t var,
const cs_real_t c_weight 
)

Update vector boundary condition coefficients for internal coupling.

Parameters
[in]bc_coeffsassociated BC coefficients structure
[in]cplstructure associated with internal coupling
[in]halo_typehalo type
[in]clip_coeffclipping coefficient
[out]bc_coeff_aboundary condition term a
[out]bc_coeff_bboundary condition term b
[in]vargradient's base variable
[in]c_weightweighted gradient coefficient variable, or NULL