8.0
general documentation
How to access and manage the main mesh entities and mesh quantities ?

Mesh variables

These variables are defined in the files mesh.f90 and cs_mesh.h.

  • The Fortran variables are global in the code, accessible directly by their name.
  • Members of the global C structure cs_glob_mesh are accessed as:
    cs_glob_mesh->name,
    i.e. adding cs_glob_mesh-> in front of the name of the variable.
  • For a more concise syntax, defining a local m or mesh variable is recommended:
    cs_mesh_t * cs_glob_mesh
    Definition: cs_mesh.h:85
    so that the shorter name of the local variable may be used.
  • In functions which have a domain argument, using domain->mesh is recommended, and may be combined with the use of a local argument (as above) for conciseness.
  • Note that the number of elements given here are local to a given rank when running in parallel. Global sizes should only be used in specific instances, though they are available in cs_mesh_t structures.
Fortran code C code Description
ndim cs_glob_mesh->dim Space dimension (always 3)
ncelet cs_glob_mesh->n_cells_with_ghosts Total number of cells on the local rank
(n_cells + n_ghost_cells)
ncel cs_glob_mesh->n_cells Number of cells
nfac cs_glob_mesh->n_i_faces Number of interior faces
nfabor cs_glob_mesh->n_b_faces Number of boundary faces
nnod cs_glob_mesh->n_vertices Number of vertices
- cs_glob_mesh->n_b_cells Number of boundary cells
lndfac cs_glob_mesh->i_face_vtx_connect_size Size of the connectivity
interior faces -> vertices
lndfbr cs_glob_mesh->b_face_vtx_connect_size Size of the connectivity
boundary faces -> vertices
ifacel cs_glob_mesh->i_face_cells Interior faces -> cells connectivity
ifabor cs_glob_mesh->b_face_cells Boundary faces -> cells connectivity
ipnfac cs_glob_mesh->i_face_vtx_idx Interior faces -> vertices index
nodfac cs_glob_mesh->i_face_vtx_lst Interior faces -> vertices connectivity
ipnfbr cs_glob_mesh->b_face_vtx_idx Boundary faces -> vertices index
nodfbr cs_glob_mesh->b_face_vtx_lst Boundary faces -> vertices connectivity
- cs_glob_mesh->b_cells Boundary cell list
xyznod cs_glob_mesh->vtx_coord Vertex coordinates

Note that the faces - vertices connectivity is stored using indexed arrays.

Mesh quantity variables

These variables are defined in the files mesh.f90 and cs_mesh_quantities.h.

  • The Fortran variables are global in the code, accessible directly by their name.
  • Members of the global C structure cs_glob_mesh_quantities are accessed as:
    cs_glob_mesh_quantities->name,
    i.e. adding cs_glob_mesh_quantities-> in front of the name of the variable.
  • For a more concise syntax, defining a local mq variable is recommended:
    cs_mesh_quantities_t * cs_glob_mesh_quantities
    Definition: cs_mesh_quantities.h:92
    so that the shorter name of the local variable may be used.
  • In functions which have a domain argument, using domain->mesh_quantities is recommended, and may be combined with the use of a local argument (as above) for conciseness.
Fortran code C code Description
isympa cs_glob_mesh_quantities->b_sym_flag Symmetry flag for boundary faces
xyzcen cs_glob_mesh_quantities->cell_cen Cell center coordinates
surfac cs_glob_mesh_quantities->i_face_normal Surface normal of interior faces
surfbo cs_glob_mesh_quantities->b_face_normal Surface normal of border faces
cdgfac cs_glob_mesh_quantities->i_face_cog Center of gravity of interior faces
cdgfbo cs_glob_mesh_quantities->b_face_cog Center of gravity of border faces
volume cs_glob_mesh_quantities->cell_vol Cell volume
surfan cs_glob_mesh_quantities->i_face_surf Surface of interior faces
surfbn cs_glob_mesh_quantities->b_face_surf Surface of boundary faces
dist cs_glob_mesh_quantities->i_dist Distance between the cell center and
the center of gravity of interior faces
distb cs_glob_mesh_quantities->b_dist Distance between the cell center and
the center of gravity of border faces
pond cs_glob_mesh_quantities->weight Interior faces weighting factor