My Project
programmer's documentation
Functions
cs_mesh_refine.c File Reference
#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"
Include dependency graph for cs_mesh_refine.c:

Functions

void cs_mesh_refine_simple (cs_mesh_t *m, bool conforming, const int cell_flag[])
 Refine flagged mesh cells. More...
 
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. More...
 

Detailed Description

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:

Basic face refinement templates

Polygonal faces do not use a specific template, but their edges may be subdivided.

Tetrahedra are divided into 8 tetrahedra, as follows:

Basic tetrahedron refinement template and subcells

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):

Basic pyramid refinement template and subcells

Prisms are divided into 8 prisms, as follows:

Basic prism refinement template and subcells

Hexahedra are divided into 8 hexahedra, as follows:

Basic hexahedron refinement template and subcells

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):

Polyhedron refinement and subcells example

Function Documentation

◆ cs_mesh_refine_simple()

void cs_mesh_refine_simple ( cs_mesh_t m,
bool  conforming,
const int  cell_flag[] 
)

Refine flagged mesh cells.

Parameters
[in,out]mmesh
[in]conformingif true, propagate refinement to ensure subdivision is conforming
[in]cell_flagsubdivision type for each cell (0: none; 1: isotropic)

◆ cs_mesh_refine_simple_selected()

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.

Parameters
[in,out]mmesh
[in]conformingif true, propagate refinement to ensure subdivision is conforming
[in]n_cellsnumber of selected cells
[in]cellslist of selected cells (0 to n-1) or NULL if no indirection is needed