8.1
general documentation
cs_mesh_cartesian.h File Reference
#include "cs_defs.h"
+ Include dependency graph for cs_mesh_cartesian.h:

Go to the source code of this file.

Enumerations

enum  cs_mesh_cartesian_law_t {
  CS_MESH_CARTESIAN_CONSTANT_LAW , CS_MESH_CARTESIAN_GEOMETRIC_LAW , CS_MESH_CARTESIAN_PARABOLIC_LAW , CS_MESH_CARTESIAN_USER_LAW ,
  CS_MESH_CARTESIAN_N_LAW_TYPES
}
 

Functions

int cs_mesh_cartesian_get_number_of_meshes (void)
 Return number of structured meshes to build. More...
 
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_id (const int id)
 Return pointer to cartesian mesh parameters structure. More...
 
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_name_try (const char *name)
 Get function for structured mesh based on its name. More...
 
cs_mesh_cartesian_params_t * cs_mesh_cartesian_by_name (const char *name)
 Get function for structured mesh based on its name. More...
 
cs_mesh_cartesian_params_t * cs_mesh_cartesian_create (const char *name)
 Create cartesian mesh structure. More...
 
int cs_mesh_cartesian_define_simple (const char *name, int ncells[3], cs_real_t xyz[6])
 Define a simple cartesian mesh with a constant step in all directions. More...
 
void cs_mesh_cartesian_define_dir_user (cs_mesh_cartesian_params_t *mp, int idir, int ncells, cs_real_t vtx_coord[])
 Define directions parameters based on a user input. More...
 
void cs_mesh_cartesian_define_dir_geom_by_part (cs_mesh_cartesian_params_t *mp, int idir, int n_parts, const cs_real_t part_coords[], const cs_lnum_t n_part_cells[], const cs_real_t amp_factors[])
 Define direction parameters based on a piecewise definition. Each part follows a geometric (or uniform) sequence. To get the uniform sequence, set the amplification factor to 1 in the wanted part. More...
 
void cs_mesh_cartesian_define_from_csv (const char *name, const char *csv_file_name)
 Define a simple cartesian mesh based on a CSV file. CSV file needs to contain : (1) First line which is empty or contains a header (2) Second line containing number of vertices per direction: format is 'nx;ny;nz' (3) Third line is empty or contains a header (4) Fourth line and onwards contains vertices coordinates for each direction. Format is "X1[i];X2[i];X3[i]" for index i. If current vertex index is beyond max value for a given direction, an empty value is expected. For example, if for index 'j' the first direction is empty, format is : ';X2[j];X3[j]'. More...
 
void cs_mesh_cartesian_define_dir_params (cs_mesh_cartesian_params_t *mp, int idim, cs_mesh_cartesian_law_t law, int ncells, cs_real_t smin, cs_real_t smax, cs_real_t progression)
 Define parameters for a given direction. More...
 
int cs_mesh_cartesian_need_build (void)
 Indicate if a cartesian mesh is to be built. More...
 
const char * cs_mesh_cartesian_get_name (int id)
 Get name of structured mesh. More...
 
int cs_mesh_cartesian_get_gc_id_shift (int id)
 Get group class id shift of cartesian mesh. More...
 
void cs_mesh_cartesian_set_gc_id_shift (int id, int shift)
 Set group class id shift of cartesian mesh. More...
 
cs_gnum_t cs_mesh_cartesian_get_n_g_cells (int id)
 Get global number of cells of a cartesian mesh. More...
 
cs_gnum_t cs_mesh_cartesian_get_n_g_faces (int id)
 Get global number of faces of a cartesian mesh. More...
 
cs_gnum_t cs_mesh_cartesian_get_n_g_vtx (int id)
 Get global number of vertices of a cartesian mesh. More...
 
int cs_mesh_cartesian_get_ncells (int id, int idim)
 Get number of cells in a given direction. More...
 
void cs_mesh_cartesian_block_connectivity (int id, cs_mesh_t *m, cs_mesh_builder_t *mb, long echo)
 Build unstructured connectivity needed for partitionning. More...
 
void cs_mesh_cartesian_finalize_definition (void)
 Compute all global values for meshes. More...
 
void cs_mesh_cartesian_params_destroy (void)
 Destroy cartesian mesh parameters. More...
 
void cs_mesh_cartesian_set_max_number_of_blocks (int n_blocks)
 Set maximum number of cartesian blocks (by default is set to None) More...
 

Enumeration Type Documentation

◆ cs_mesh_cartesian_law_t

Enumerator
CS_MESH_CARTESIAN_CONSTANT_LAW 
CS_MESH_CARTESIAN_GEOMETRIC_LAW 
CS_MESH_CARTESIAN_PARABOLIC_LAW 
CS_MESH_CARTESIAN_USER_LAW 
CS_MESH_CARTESIAN_N_LAW_TYPES 

Function Documentation

◆ cs_mesh_cartesian_block_connectivity()

void cs_mesh_cartesian_block_connectivity ( int  id,
cs_mesh_t m,
cs_mesh_builder_t mb,
long  echo 
)

Build unstructured connectivity needed for partitionning.

Parameters
[in]idId of the cartesian mesh
[in]mpointer to cs_mesh_t structure
[in]mbpointer to cs_mesh_builder_t structure
[in]echoverbosity flag

◆ cs_mesh_cartesian_by_id()

cs_mesh_cartesian_params_t* cs_mesh_cartesian_by_id ( const int  id)

Return pointer to cartesian mesh parameters structure.

Parameters
[in]idId of the cartesian mesh
Returns
pointer to cs_mesh_cartesian_params_t structure

◆ cs_mesh_cartesian_by_name()

cs_mesh_cartesian_params_t* cs_mesh_cartesian_by_name ( const char *  name)

Get function for structured mesh based on its name.

Parameters
[in]nameName of mesh
Returns
pointer to corresponding mesh parameters. Raises error if mesh does not exist.

◆ cs_mesh_cartesian_by_name_try()

cs_mesh_cartesian_params_t* cs_mesh_cartesian_by_name_try ( const char *  name)

Get function for structured mesh based on its name.

Parameters
[in]nameName of mesh
Returns
pointer to corresponding mesh parameters, or NULL if mesh does not exist.

◆ cs_mesh_cartesian_create()

cs_mesh_cartesian_params_t* cs_mesh_cartesian_create ( const char *  name)

Create cartesian mesh structure.

Parameters
[in]nameName of mesh to create
Returns
pointer to newly created mesh parameters

◆ cs_mesh_cartesian_define_dir_geom_by_part()

void cs_mesh_cartesian_define_dir_geom_by_part ( cs_mesh_cartesian_params_t *  mp,
int  idir,
int  n_parts,
const cs_real_t  part_coords[],
const cs_lnum_t  n_part_cells[],
const cs_real_t  amp_factors[] 
)

Define direction parameters based on a piecewise definition. Each part follows a geometric (or uniform) sequence. To get the uniform sequence, set the amplification factor to 1 in the wanted part.

A direction is split in several parts. Each part contains a number of cells, its starting and ending position (stored in a compact way) inside part_coords, the amplification factor (f) between the first and last cell size of each part. Notice that if f = 1, this leads to a uniform refinement. If f > 1, (resp f < 1) this leads to a growing (resp. decreasing) geometric progression of the cell size when moving along the direction of increasing coordinates.

Parameters
[in]mpPointer to mesh parameters
[in]idirDirection index. 0->X, 1->Y, 2->Z
[in]n_partsNumber of parts to define the direction
[in]part_coordsPosition delimiting each part (size = n_parts + 1)
[in]n_part_cellsNumber of cells in each part (size = n_parts)
[in]amp_factorsAmplification factor in each part (size = n_parts)

◆ cs_mesh_cartesian_define_dir_params()

void cs_mesh_cartesian_define_dir_params ( cs_mesh_cartesian_params_t *  mp,
int  idim,
cs_mesh_cartesian_law_t  law,
int  ncells,
cs_real_t  smin,
cs_real_t  smax,
cs_real_t  progression 
)

Define parameters for a given direction.

Parameters
[in]mpPointer to mesh parameters
[in]idimGeometrical direction: 0->X, 1->Y, 2->Z
[in]law1D discretization law: constant, geometric or parabolic
[in]ncellsNumber of cells for this direction
[in]sminMin coordinate value for this direction
[in]smaxMax coordinate value for this direction
[in]progressionProgression value, only used for geometric or parabolic laws.

◆ cs_mesh_cartesian_define_dir_user()

void cs_mesh_cartesian_define_dir_user ( cs_mesh_cartesian_params_t *  mp,
int  idir,
int  ncells,
cs_real_t  vtx_coord[] 
)

Define directions parameters based on a user input.

Parameters
[in]mpPointer to mesh parameters
[in]idirDirection index. 0->X, 1->Y, 2->Z
[in]ncellsNumber of cells for the direction
[in]vtx_coordArray of size ncells+1 containing 1D coordinate values for vertices on the given direction

◆ cs_mesh_cartesian_define_from_csv()

void cs_mesh_cartesian_define_from_csv ( const char *  name,
const char *  csv_file_name 
)

Define a simple cartesian mesh based on a CSV file. CSV file needs to contain : (1) First line which is empty or contains a header (2) Second line containing number of vertices per direction: format is 'nx;ny;nz' (3) Third line is empty or contains a header (4) Fourth line and onwards contains vertices coordinates for each direction. Format is "X1[i];X2[i];X3[i]" for index i. If current vertex index is beyond max value for a given direction, an empty value is expected. For example, if for index 'j' the first direction is empty, format is : ';X2[j];X3[j]'.

Parameters
[in]nameName of new mesh
[in]csv_file_namename of CSV file containing mesh information.

◆ cs_mesh_cartesian_define_simple()

int cs_mesh_cartesian_define_simple ( const char *  name,
int  ncells[3],
cs_real_t  xyz[6] 
)

Define a simple cartesian mesh with a constant step in all directions.

Parameters
[in]nameName of mesh to create
[in]ncellsArray of size 3 containing number of cells in each direction
[in]xyzArray of size 6 containing min values, followed by max values for the three directions.

◆ cs_mesh_cartesian_finalize_definition()

void cs_mesh_cartesian_finalize_definition ( void  )

Compute all global values for meshes.

◆ cs_mesh_cartesian_get_gc_id_shift()

int cs_mesh_cartesian_get_gc_id_shift ( int  id)

Get group class id shift of cartesian mesh.

Parameters
[in]idId of the cartesian mesh
Returns
shift value

◆ cs_mesh_cartesian_get_n_g_cells()

cs_gnum_t cs_mesh_cartesian_get_n_g_cells ( int  id)

Get global number of cells of a cartesian mesh.

Parameters
[in]idId of the cartesian mesh
Returns
number of cells

◆ cs_mesh_cartesian_get_n_g_faces()

cs_gnum_t cs_mesh_cartesian_get_n_g_faces ( int  id)

Get global number of faces of a cartesian mesh.

Parameters
[in]idId of the cartesian mesh
Returns
number of faces

◆ cs_mesh_cartesian_get_n_g_vtx()

cs_gnum_t cs_mesh_cartesian_get_n_g_vtx ( int  id)

Get global number of vertices of a cartesian mesh.

Parameters
[in]idId of the cartesian mesh
Returns
number of vertices

◆ cs_mesh_cartesian_get_name()

const char* cs_mesh_cartesian_get_name ( int  id)

Get name of structured mesh.

Parameters
[in]idId of the cartesian mesh
Returns
Name of the mesh

◆ cs_mesh_cartesian_get_ncells()

int cs_mesh_cartesian_get_ncells ( int  id,
int  idim 
)

Get number of cells in a given direction.

Parameters
[in]idId of the cartesian mesh
[in]idimIndex of direction: 0->X, 1->Y, 2->Z
Returns
Number of cells in corresponding direction (int)

◆ cs_mesh_cartesian_get_number_of_meshes()

int cs_mesh_cartesian_get_number_of_meshes ( void  )

Return number of structured meshes to build.

Returns
number of structured meshes to build.

◆ cs_mesh_cartesian_need_build()

int cs_mesh_cartesian_need_build ( void  )

Indicate if a cartesian mesh is to be built.

Returns
1 if mesh needs to be built, 0 otherwise

◆ cs_mesh_cartesian_params_destroy()

void cs_mesh_cartesian_params_destroy ( void  )

Destroy cartesian mesh parameters.

◆ cs_mesh_cartesian_set_gc_id_shift()

void cs_mesh_cartesian_set_gc_id_shift ( int  id,
int  shift 
)

Set group class id shift of cartesian mesh.

Parameters
[in]idId of the cartesian mesh
[in]shiftValue of shift index

◆ cs_mesh_cartesian_set_max_number_of_blocks()

void cs_mesh_cartesian_set_max_number_of_blocks ( int  n_blocks)

Set maximum number of cartesian blocks (by default is set to None)

Parameters
[in]n_blocksmaximum number of cartesian blocks which can be created