src/alge/cs_gradient.c File Reference

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
cs_gradient.c File Reference
`#include "cs_defs.h"`
`#include <assert.h>`
`#include <errno.h>`
`#include <stdio.h>`
`#include <stdarg.h>`
`#include <string.h>`
`#include <math.h>`
`#include <float.h>`
`#include "bft_error.h"`
`#include "bft_mem.h"`
`#include "bft_printf.h"`
`#include "cs_blas.h"`
`#include "cs_halo.h"`
`#include "cs_halo_perio.h"`
`#include "cs_log.h"`
`#include "cs_mesh.h"`
`#include "cs_ext_neighborhood.h"`
`#include "cs_mesh_quantities.h"`
`#include "cs_prototypes.h"`
`#include "cs_timer.h"`
`#include "cs_gradient.h"`
Include dependency graph for cs_gradient.c:

## Functions
void | cgdcel (const cs_int_t *const ivar, const cs_int_t *const imrgra, const cs_int_t *const ilved, const cs_int_t *const inc, const cs_int_t *const iccocg, const cs_int_t *const nswrgp, const cs_int_t *const idimtr, const cs_int_t *const iphydp, const cs_int_t *const ipond, const cs_int_t *const iwarnp, const cs_int_t *const imligp, const cs_real_t *const epsrgp, const cs_real_t *const extrap, const cs_real_t *const climgp, cs_real_3_t fext[], const cs_real_t coefap[], const cs_real_t coefbp[], cs_real_t pvar[], cs_real_t ktvar[], cs_real_t grad[])
void | cgdvec (const cs_int_t *const ivar, const cs_int_t *const imrgra, const cs_int_t *const inc, const cs_int_t *const nswrgp, const cs_int_t *const iwarnp, const cs_int_t *const imligp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_3_t coefav[], const cs_real_33_t coefbv[], cs_real_3_t pvar[], cs_real_33_t gradv[])
void | cs_gradient_initialize (void)
| Initialize gradient computation API. More...
void | cs_gradient_finalize (void)
| Finalize gradient computation API. More...
void | cs_gradient_scalar (const char *var_name, cs_gradient_type_t gradient_type, cs_halo_type_t halo_type, int inc, bool recompute_cocg, int n_r_sweeps, int tr_dim, int hyd_p_flag, int verbosity, int clip_mode, double epsilon, double extrap, double clip_coeff, cs_real_3_t f_ext[], const cs_real_t bc_coeff_a[], const cs_real_t bc_coeff_b[], cs_real_t *restrict var, cs_real_t *restrict weight_var, cs_real_3_t *restrict grad)
| Compute cell gradient of scalar field or component of vector or tensor field. More...
void | cs_gradient_vector (const char *var_name, cs_gradient_type_t gradient_type, cs_halo_type_t halo_type, int inc, int n_r_sweeps, int verbosity, int clip_mode, double epsilon, double clip_coeff, const cs_real_3_t bc_coeff_a[], const cs_real_33_t bc_coeff_b[], cs_real_3_t *restrict var, cs_real_33_t *restrict gradv)
| Compute cell gradient of vector field. More...
void | cs_gradient_type_by_imrgra (int imrgra, cs_gradient_type_t *gradient_type, cs_halo_type_t *halo_type)

## Variables
const char * | cs_gradient_type_name []

## Detailed Description

Gradient reconstruction.

## Function Documentation

void cgdcel | ( | const cs_int_t *const | ivar,
|  | const cs_int_t *const | imrgra,
|  | const cs_int_t *const | ilved,
|  | const cs_int_t *const | inc,
|  | const cs_int_t *const | iccocg,
|  | const cs_int_t *const | nswrgp,
|  | const cs_int_t *const | idimtr,
|  | const cs_int_t *const | iphydp,
|  | const cs_int_t *const | ipond,
|  | const cs_int_t *const | iwarnp,
|  | const cs_int_t *const | imligp,
|  | const cs_real_t *const | epsrgp,
|  | const cs_real_t *const | extrap,
|  | const cs_real_t *const | climgp,
|  | cs_real_3_t | fext[],
|  | const cs_real_t | coefap[],
|  | const cs_real_t | coefbp[],
|  | cs_real_t | pvar[],
|  | cs_real_t | ktvar[],
|  | cs_real_t | grad[]
| ) |  |

void cgdvec | ( | const cs_int_t *const | ivar,
|  | const cs_int_t *const | imrgra,
|  | const cs_int_t *const | inc,
|  | const cs_int_t *const | nswrgp,
|  | const cs_int_t *const | iwarnp,
|  | const cs_int_t *const | imligp,
|  | const cs_real_t *const | epsrgp,
|  | const cs_real_t *const | climgp,
|  | const cs_real_3_t | coefav[],
|  | const cs_real_33_t | coefbv[],
|  | cs_real_3_t | pvar[],
|  | cs_real_33_t | gradv[]
| ) |  |

void cs_gradient_finalize | ( | void |  | ) |

Finalize gradient computation API.

void cs_gradient_initialize | ( | void |  | ) |

Initialize gradient computation API.

void cs_gradient_scalar | ( | const char * | var_name,
|  | cs_gradient_type_t | gradient_type,
|  | cs_halo_type_t | halo_type,
|  | int | inc,
|  | bool | recompute_cocg,
|  | int | n_r_sweeps,
|  | int | tr_dim,
|  | int | hyd_p_flag,
|  | int | verbosity,
|  | int | clip_mode,
|  | double | epsilon,
|  | double | extrap,
|  | double | clip_coeff,
|  | cs_real_3_t | f_ext[],
|  | const cs_real_t | bc_coeff_a[],
|  | const cs_real_t | bc_coeff_b[],
|  | cs_real_t *restrict | var,
|  | cs_real_t *restrict | weight_var,
|  | cs_real_3_t *restrict | grad
| ) |  |

Compute cell gradient of scalar field or component of vector or tensor field.

Parameters

  [in] | var_name | variable name
  [in] | gradient_type | gradient type
  [in] | halo_type | halo type
  [in] | inc | if 0, solve on increment; 1 otherwise
  [in] | recompute_cocg | should COCG FV quantities be recomputed ?
  [in] | n_r_sweeps | if > 1, number of reconstruction sweeps
  [in] | tr_dim | 2 for tensor with periodicity of rotation, 0 otherwise
  [in] | hyd_p_flag | flag for hydrostatic pressure
  [in] | verbosity | verbosity level
  [in] | clip_mode | clipping mode
  [in] | epsilon | precision for iterative gradient calculation
  [in] | extrap | boundary gradient extrapolation coefficient
  [in] | clip_coeff | clipping coefficient
  [in] | f_ext | exterior force generating the hydrostatic pressure
  [in] | bc_coeff_a | boundary condition term a
  [in] | bc_coeff_b | boundary condition term b
  [in,out] | var | gradient's base variable
  [in,out] | weight_var | weighted gradient coefficient variable, or NULL
  [out] | grad | gradient

void cs_gradient_type_by_imrgra | ( | int | imrgra,
|  | cs_gradient_type_t * | gradient_type,
|  | cs_halo_type_t * | halo_type
| ) |  |

void cs_gradient_vector | ( | const char * | var_name,
|  | cs_gradient_type_t | gradient_type,
|  | cs_halo_type_t | halo_type,
|  | int | inc,
|  | int | n_r_sweeps,
|  | int | verbosity,
|  | int | clip_mode,
|  | double | epsilon,
|  | double | clip_coeff,
|  | const cs_real_3_t | bc_coeff_a[],
|  | const cs_real_33_t | bc_coeff_b[],
|  | cs_real_3_t *restrict | var,
|  | cs_real_33_t *restrict | gradv
| ) |  |

Compute cell gradient of vector field.

Parameters

  [in] | var_name | variable name
  [in] | gradient_type | gradient type
  [in] | halo_type | halo type
  [in] | inc | if 0, solve on increment; 1 otherwise
  [in] | n_r_sweeps | if > 1, number of reconstruction sweeps
  [in] | verbosity | verbosity level
  [in] | clip_mode | clipping mode
  [in] | epsilon | precision for iterative gradient calculation
  [in] | clip_coeff | clipping coefficient
  [in] | bc_coeff_a | boundary condition term a
  [in] | bc_coeff_b | boundary condition term b
  [in,out] | var | gradient's base variable
  [out] | gradv | gradient ( is gradv[][i][j])

## Variable Documentation

const char* cs_gradient_type_name[]

Initial value:
= {N_("Iterative reconstruction"),
N_("Least-squares (standard)"),
N_("Least-squares (extended)"),
N_("Least-squares (partially extended)"),
N_("Least-squares then iterative")}