src/mesh/cs_mesh_bad_cells.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
Macros | Functions
cs_mesh_bad_cells.c File Reference
`#include "cs_defs.h"`
`#include <math.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <assert.h>`
`#include <float.h>`
`#include "bft_mem.h"`
`#include "bft_error.h"`
`#include "bft_printf.h"`
`#include "cs_halo.h"`
`#include "cs_mesh.h"`
`#include "cs_mesh_quantities.h"`
`#include "cs_parall.h"`
`#include "cs_post.h"`
`#include "cs_mesh_bad_cells.h"`
Include dependency graph for cs_mesh_bad_cells.c:

## Macros
#define | CS_MESH_QUALITY_N_SUBS 10
#define | _CROSS_PRODUCT_3D(cross_v1_v2, v1, v2)
#define | _DOT_PRODUCT_3D(v1, v2)
#define | _MODULE_3D(v) sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2])
#define | _COSINE_3D(v1, v2)

## Functions
void | cs_mesh_bad_cells_set_options (int type_flag_mask, int compute, int visualize)
| Define which cell quality indicators are used and when. More...
void | cs_mesh_bad_cells_get_options (int compute[2], int visualize[2])
| Indicate which cell quality indicators are used and when. More...
void | cs_mesh_bad_cells_detect (const cs_mesh_t *mesh, cs_mesh_quantities_t *mesh_quantities)
| Compute bad cell quality indicators. More...
void | cs_mesh_bad_cells_postprocess (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
| Post-process time-independent bad cell quality indicators. More...

## Macro Definition Documentation

#define _COSINE_3D | ( |  | v1,
|  |  | v2
| ) |  |

Value:
(\
_DOT_PRODUCT_3D(v1, v2) / (_MODULE_3D(v1) * _MODULE_3D(v2)) )

#define _CROSS_PRODUCT_3D | ( |  | cross_v1_v2,
|  |  | v1,
|  |  | v2
| ) |  |

Value:
( \
cross_v1_v2[0] = v1[1]*v2[2] - v1[2]*v2[1], \
cross_v1_v2[1] = v1[2]*v2[0] - v1[0]*v2[2], \
cross_v1_v2[2] = v1[0]*v2[1] - v1[1]*v2[0] )

#define _DOT_PRODUCT_3D | ( |  | v1,
|  |  | v2
| ) |  |

Value:
( \
v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2])

#define _MODULE_3D | ( |  | v | ) | sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2])

#define CS_MESH_QUALITY_N_SUBS 10

## Function Documentation

void cs_mesh_bad_cells_detect | ( | const cs_mesh_t * | mesh,
|  | cs_mesh_quantities_t * | mesh_quantities
| ) |  |

Compute bad cell quality indicators.

Parameters

  [in] | mesh | pointer to associated mesh structure
  [in,out] | mesh_quantities | pointer to associated mesh quantities structure

void cs_mesh_bad_cells_get_options | ( | int | compute[2],
|  | int | visualize[2]
| ) |  |

Indicate which cell quality indicators are used and when.

Each array is optional, and returns 2 flags; the first flag is used at initialization, the second one at each time step.

A flag is a mask to be compared using an "and" (&) operation with a given criteria type mask (CS_BAD_CELL_ORTHO_NORM, CS_BAD_CELL_OFFSET, ...).

Parameters

  [out] | compute | computation mask (initialization, per time step), or NULL
  [out] | visualize | visualization mask (initialization, per time step), or NULL

void cs_mesh_bad_cells_postprocess | ( | const cs_mesh_t * | mesh,
|  | const cs_mesh_quantities_t * | mesh_quantities
| ) |  |

Post-process time-independent bad cell quality indicators.

Parameters

  [in] | mesh | pointer to associated mesh structure
  [in] | mesh_quantities | pointer to associated mesh quantities structure

void cs_mesh_bad_cells_set_options | ( | int | type_flag_mask,
|  | int | compute,
|  | int | visualize
| ) |  |

Define which cell quality indicators are used and when.

Note
  We assume that if a given criterion is computed at each time step, it is also computed at initialization, but for visualization, it is either one or the other, as visualization formats and tools may not always accept both a fixed and time-varying instance of a given variable.

Parameters

  [in] | type_flag_mask | criterion type mask (0 for all)
  [in] | compute | 0: never compute; 1: compute at initialization; 2: compute at each time step
  [in] | visualize | 0: never visualize 1: visualize at initialization; 2: visualize at each time step