My Project
programmer's documentation
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
cs_defs.h File Reference
#include "cs_config.h"
#include <libintl.h>
#include <mpi.h>
#include <omp.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdbool.h>
Include dependency graph for cs_defs.h:

Go to the source code of this file.

Data Structures

struct  cs_double_int_t
 
struct  cs_nvec3_t
 

Macros

#define _(String)   dgettext(PACKAGE, String)
 
#define N_(String)   String
 
#define MPI_VERSION   1
 
#define MPI_Info   int
 
#define MPI_INFO_NULL   0
 
#define __STDC_VERSION__   1989
 
#define inline
 
#define restrict
 
#define CS_MPI_INT   MPI_INT /* If cs_int_t is an int */
 
#define CS_MPI_REAL   MPI_DOUBLE /* If cs_real_t is a double */
 
#define CS_MPI_GNUM   MPI_UNSIGNED_LONG
 
#define CS_MPI_FLAG   MPI_UNSIGNED_SHORT /* MPI type for cs_flag_t type */
 
#define CS_MPI_LNUM   MPI_INT /* MPI type for cs_lnum_t type */
 
#define CS_MPI_COORD   MPI_DOUBLE /* MPI type for cs_coord_t type */
 
#define CS_GNUM_TYPE   CS_UINT64
 
#define CS_LNUM_TYPE   CS_INT32
 
#define CS_INT_TYPE   CS_INT32
 
#define CS_FLAG_TYPE   CS_UINT16
 
#define CS_REAL_TYPE   CS_DOUBLE
 
#define CS_COORD_TYPE   CS_DOUBLE
 
#define CS_THR_MIN   128
 
#define CS_CL_SIZE   64
 
#define CS_ABS(a)   ((a) < 0 ? -(a) : (a)) /* Absolute value of a */
 
#define CS_MIN(a, b)   ((a) < (b) ? (a) : (b)) /* Minimum of a et b */
 
#define CS_MAX(a, b)   ((a) > (b) ? (a) : (b)) /* Maximum of a et b */
 
#define CS_UNUSED(x)   (void)(x)
 
#define CS_NO_WARN_IF_UNUSED(x)   (void)(x)
 
#define BEGIN_C_DECLS
 
#define END_C_DECLS
 
#define CS_PROCF(x, y)   x##_
 
#define CS_ARGF_SUPP_CHAINE   , ...
 

Typedefs

typedef unsigned long cs_gnum_t
 global mesh entity number More...
 
typedef int cs_lnum_t
 local mesh entity id More...
 
typedef double cs_coord_t
 
typedef int cs_int_t
 Fortran-compatible integer. More...
 
typedef double cs_real_t
 Floating-point value. More...
 
typedef char cs_byte_t
 
typedef unsigned short int cs_flag_t
 
typedef int cs_lnum_2_t[2]
 vector of 2 local mesh-entity ids More...
 
typedef int cs_lnum_3_t[3]
 
typedef double cs_coord_3_t[3]
 
typedef cs_real_t cs_real_2_t[2]
 vector of 2 floating-point values More...
 
typedef cs_real_t cs_real_3_t[3]
 vector of 3 floating-point values More...
 
typedef cs_real_t cs_real_4_t[4]
 vector of 4 floating-point values More...
 
typedef cs_real_t cs_real_6_t[6]
 vector of 6 floating-point values More...
 
typedef cs_real_t cs_real_9_t[9]
 
typedef cs_real_t cs_real_33_t[3][3]
 3x3 matrix of floating-point values More...
 
typedef cs_real_t cs_real_66_t[6][6]
 6x6 matrix of floating-point values More...
 
typedef cs_real_t cs_real_99_t[9][9]
 
typedef cs_real_t cs_real_34_t[3][4]
 
typedef cs_real_t cs_real_63_t[6][3]
 
typedef cs_real_33_t cs_real_332_t[2]
 vector of 2 3x3 matrices of floating-point values More...
 
typedef cs_real_66_t cs_real_662_t[2]
 

Enumerations

enum  cs_datatype_t {
  CS_DATATYPE_NULL, CS_CHAR, CS_FLOAT, CS_DOUBLE,
  CS_UINT16, CS_INT32, CS_INT64, CS_UINT32,
  CS_UINT64
}
 
enum  cs_interlace_t { CS_INTERLACE, CS_NO_INTERLACE }
 

Functions

static cs_lnum_t cs_align (cs_lnum_t i, cs_lnum_t m)
 Given a base index i, return the next index aligned with a size m. More...
 

Variables

const size_t cs_datatype_size []
 
const char * cs_datatype_name []
 
MPI_Datatype cs_datatype_to_mpi []
 
int cs_glob_n_threads
 
int cs_glob_rank_id
 
int cs_glob_n_ranks
 
MPI_Comm cs_glob_mpi_comm
 

Macro Definition Documentation

◆ _

#define _ (   String)    dgettext(PACKAGE, String)

◆ __STDC_VERSION__

#define __STDC_VERSION__   1989

◆ BEGIN_C_DECLS

#define BEGIN_C_DECLS

◆ CS_ABS

#define CS_ABS (   a)    ((a) < 0 ? -(a) : (a)) /* Absolute value of a */

◆ CS_ARGF_SUPP_CHAINE

void int *len CS_ARGF_SUPP_CHAINE   , ...

◆ CS_CL_SIZE

#define CS_CL_SIZE   64

◆ CS_COORD_TYPE

#define CS_COORD_TYPE   CS_DOUBLE

◆ CS_FLAG_TYPE

#define CS_FLAG_TYPE   CS_UINT16

◆ CS_GNUM_TYPE

#define CS_GNUM_TYPE   CS_UINT64

◆ CS_INT_TYPE

#define CS_INT_TYPE   CS_INT32

◆ CS_LNUM_TYPE

#define CS_LNUM_TYPE   CS_INT32

◆ CS_MAX

#define CS_MAX (   a,
 
)    ((a) > (b) ? (a) : (b)) /* Maximum of a et b */

◆ CS_MIN

#define CS_MIN (   a,
 
)    ((a) < (b) ? (a) : (b)) /* Minimum of a et b */

◆ CS_MPI_COORD

#define CS_MPI_COORD   MPI_DOUBLE /* MPI type for cs_coord_t type */

◆ CS_MPI_FLAG

#define CS_MPI_FLAG   MPI_UNSIGNED_SHORT /* MPI type for cs_flag_t type */

◆ CS_MPI_GNUM

#define CS_MPI_GNUM   MPI_UNSIGNED_LONG

◆ CS_MPI_INT

#define CS_MPI_INT   MPI_INT /* If cs_int_t is an int */

◆ CS_MPI_LNUM

#define CS_MPI_LNUM   MPI_INT /* MPI type for cs_lnum_t type */

◆ CS_MPI_REAL

#define CS_MPI_REAL   MPI_DOUBLE /* If cs_real_t is a double */

◆ CS_NO_WARN_IF_UNUSED

#define CS_NO_WARN_IF_UNUSED (   x)    (void)(x)

◆ CS_PROCF

#define CS_PROCF (   x,
  y 
)    x##_

◆ CS_REAL_TYPE

#define CS_REAL_TYPE   CS_DOUBLE

◆ CS_THR_MIN

#define CS_THR_MIN   128

◆ CS_UNUSED

#define CS_UNUSED (   x)    (void)(x)

◆ END_C_DECLS

#define END_C_DECLS

◆ inline

#define inline

◆ MPI_Info

#define MPI_Info   int

◆ MPI_INFO_NULL

#define MPI_INFO_NULL   0

◆ MPI_VERSION

#define MPI_VERSION   1

◆ N_

#define N_ (   String)    String

◆ restrict

#define restrict

Typedef Documentation

◆ cs_byte_t

typedef char cs_byte_t

◆ cs_coord_3_t

typedef double cs_coord_3_t[3]

◆ cs_coord_t

typedef double cs_coord_t

◆ cs_flag_t

typedef unsigned short int cs_flag_t

◆ cs_gnum_t

global mesh entity number

Global mesh-entity numbers are strictly positive (1 to n based) integers, so they are declared as a form of unsigned integer. Such a number is unique across MPI ranks; 2 mesh elements on different ranks share the same number if and only if they are local instances of the same global element (such as shared faces or vertices on rank boundaries). A value of 0 is commonly used to mark undefined (or not yet defined) element ids in various pre or post-processing stages.

◆ cs_int_t

Fortran-compatible integer.

Deprecated:
Currently, this integer type is necessarily of the same type as cs_lnum_t, but it should only be used in Fortran wrapper function definitions. Moving to ISO_C_BINDINGS, and converting more code to C, this type should eventually disappear.

◆ cs_lnum_2_t

cs_lnum_2_t

vector of 2 local mesh-entity ids

◆ cs_lnum_3_t

typedef int cs_lnum_3_t[3]

◆ cs_lnum_t

local mesh entity id

Local mesh-entity ids are signed integers, and be either 0 to n-1 or 1 to n based. When 0-based, the id prefix or postfix is preferred for associated variable names, while num is preferred when 1-based. In C code, using this type is recommended over using simple int integers, as 64-bit variants could be used in the future for shared-memory machines with large memory. This type should not be used to declare identifiers which are not mesh entities, such as groups, fields, or any other entity whose count does not depend on mesh size, so as not to pollute the readability and comprehensibility of the code.

◆ cs_real_2_t

cs_real_2_t

vector of 2 floating-point values

◆ cs_real_332_t

cs_real_332_t

vector of 2 3x3 matrices of floating-point values

◆ cs_real_33_t

cs_real_33_t

3x3 matrix of floating-point values

◆ cs_real_34_t

typedef cs_real_t cs_real_34_t[3][4]

◆ cs_real_3_t

cs_real_3_t

vector of 3 floating-point values

◆ cs_real_4_t

cs_real_4_t

vector of 4 floating-point values

◆ cs_real_63_t

typedef cs_real_t cs_real_63_t[6][3]

◆ cs_real_662_t

typedef cs_real_66_t cs_real_662_t[2]

◆ cs_real_66_t

cs_real_66_t

6x6 matrix of floating-point values

◆ cs_real_6_t

cs_real_6_t

vector of 6 floating-point values

◆ cs_real_99_t

typedef cs_real_t cs_real_99_t[9][9]

◆ cs_real_9_t

typedef cs_real_t cs_real_9_t[9]

◆ cs_real_t

Floating-point value.

Enumeration Type Documentation

◆ cs_datatype_t

Enumerator
CS_DATATYPE_NULL 
CS_CHAR 
CS_FLOAT 
CS_DOUBLE 
CS_UINT16 
CS_INT32 
CS_INT64 
CS_UINT32 
CS_UINT64 

◆ cs_interlace_t

Enumerator
CS_INTERLACE 
CS_NO_INTERLACE 

Function Documentation

◆ cs_align()

static cs_lnum_t cs_align ( cs_lnum_t  i,
cs_lnum_t  m 
)
inlinestatic

Given a base index i, return the next index aligned with a size m.

Parameters
[in]ibase index
[in]mblock size to align with
Returns
aligned index

This index is computed as follows:

if i > 0: ((i - 1) / m + 1) * m if i = 0: 0

Parameters
[in]ibase index
[in]mblock size to align with
Returns
aligned index

Variable Documentation

◆ cs_datatype_name

const char* cs_datatype_name[]

◆ cs_datatype_size

const size_t cs_datatype_size[]

◆ cs_datatype_to_mpi

MPI_Datatype cs_datatype_to_mpi[]

◆ cs_glob_mpi_comm

MPI_Comm cs_glob_mpi_comm

◆ cs_glob_n_ranks

int cs_glob_n_ranks

◆ cs_glob_n_threads

int cs_glob_n_threads

◆ cs_glob_rank_id

int cs_glob_rank_id