#include "cs_defs.h"#include <float.h>#include <assert.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <limits.h>#include <math.h>#include "bft_mem.h"#include "bft_error.h"#include "bft_printf.h"#include "fvm_io_num.h"#include "fvm_triangulate.h"#include "cs_math.h"#include "cs_mesh.h"#include "cs_mesh_adjacencies.h"#include "cs_mesh_quantities.h"#include "cs_order.h"#include "cs_parall.h"#include "cs_mesh_refine.h"Functions | |
| void | cs_mesh_refine_simple (cs_mesh_t *m, bool conforming, const int cell_flag[]) |
| Refine flagged mesh cells. | |
| void | cs_mesh_refine_simple_selected (cs_mesh_t *m, bool conforming, cs_lnum_t n_cells, const cs_lnum_t cells[]) |
| Refine selected mesh cells. | |
| void | cs_mesh_refine_set_option (const char *key, const char *value) |
| Set refinement options, using key/value pairs. | |
Mesh refinement.
Cells are refined based on predefined templates for given (autodetected) cell types. Refinement may optionally be propagated to neighbor cells.
The basic face refinement templates are given here:
Polygonal faces do not use a specific template, but their edges may be subdivided.
Tetrahedra are divided into 8 tetrahedra, as follows:
Pyramids are divided into 6 pyramids and 4 tetrahedra, as follows (with the pyramids a darker shade and tetrahedra lighter shade on the right view):
Prisms are divided into 8 prisms, as follows:
Hexahedra are divided into 8 hexahedra, as follows:
Polyhedra are subdivided by adding a vertex to the cell's center, and subdividing the cells into n-faced cones joing the cell faces and cell center (tetrahedra for triangle faces, pyramids for quadrangle faces, generic cone-shaped polyhedra otherwise). The following view provides and example for one hexahedral cell with one face subdivided (as may occur for hexahedral cells adjacent to refined hexahadra when a conforming refinement is required):
| void cs_mesh_refine_set_option | ( | const char * | key, |
| const char * | value ) |
Set refinement options, using key/value pairs.
Accepted keys and values:
Refine flagged mesh cells.
| [in,out] | m | mesh |
| [in] | conforming | if true, propagate refinement to ensure subdivision is conforming |
| [in] | cell_flag | subdivision type for each cell (0: none; 1: isotropic) |
| void cs_mesh_refine_simple_selected | ( | cs_mesh_t * | m, |
| bool | conforming, | ||
| cs_lnum_t | n_cells, | ||
| const cs_lnum_t | cells[] ) |
Refine selected mesh cells.
| [in,out] | m | mesh |
| [in] | conforming | if true, propagate refinement to ensure subdivision is conforming |
| [in] | n_cells | number of selected cells |
| [in] | cells | list of selected cells (0 to n-1) or NULL if no indirection is needed |