8.1
general documentation
cs_mesh_intersect.h File Reference
#include "cs_defs.h"
+ Include dependency graph for cs_mesh_intersect.h:

Go to the source code of this file.

Functions

void cs_mesh_intersect_segment_cell_select (void *input, cs_lnum_t *n_cells, cs_lnum_t **cell_ids)
 Select cells cut by a given segment. More...
 
void cs_mesh_intersect_polyline_cell_select (void *input, cs_lnum_t n_points, cs_lnum_t *n_cells, cs_lnum_t **cell_ids, cs_real_t **seg_c_len)
 Select cells cut by a line composed of segments. More...
 
void cs_mesh_intersect_polyline_map (cs_lnum_t n_points, const cs_real_t point_coords[], cs_real_t min_fraction, cs_lnum_t **seg_cell_idx, cs_lnum_t **seg_cell, cs_real_t **seg_cell_fraction)
 Map a polyline of segments to the local mesh. More...
 

Function Documentation

◆ cs_mesh_intersect_polyline_cell_select()

void cs_mesh_intersect_polyline_cell_select ( void *  input,
cs_lnum_t  n_points,
cs_lnum_t n_cells,
cs_lnum_t **  cell_ids,
cs_real_t **  seg_c_len 
)

Select cells cut by a line composed of segments.

This selection function may be used as an elements selection function for postprocessing.

In this case, the input points to a real array containing the segment's start and end coordinates.

Note: the input pointer must point to valid data when this selection function is called, so either:

  • that value or structure should not be temporary (i.e. local);
  • post-processing output must be ensured using cs_post_write_meshes() with a fixed-mesh writer before the data pointed to goes out of scope;

The caller is responsible for freeing the returned cell_ids array. When passed to postprocessing mesh or probe set definition functions, this is handled automatically.

Parameters
[in]inputpointer to segments starts and ends: [x0, y0, z0, x1, y1, z1]
[in]n_pointsnumber of vertices in the polyline
[out]n_cellsnumber of selected cells
[out]cell_idsarray of selected cell ids (0 to n-1 numbering)
[out]seg_c_lenarray of length of the segment in the selected cells

◆ cs_mesh_intersect_polyline_map()

void cs_mesh_intersect_polyline_map ( cs_lnum_t  n_points,
const cs_real_t  point_coords[],
cs_real_t  min_fraction,
cs_lnum_t **  seg_cell_idx,
cs_lnum_t **  seg_cell,
cs_real_t **  seg_cell_fraction 
)

Map a polyline of segments to the local mesh.

The caller is responsible for freeing the returned seg_cell* arrays.

Parameters
[in]n_pointsnumber of vertices in the polyline
[in]point_coordspointer to segments starts and ends: [x0, y0, z0, x1, y1, z1, ...]
[in]min_fractionminimum fraction of each edge under which fraction is ignored
[out]seg_cell_idxindex of start an end cell ids per segment (size: n_points == n_segments-1)
[out]seg_cellcells intersected by each segment i are given by seg_cell[], with seg_cell_idx[i] <= j < with seg_cell_idx[i+1]
[out]seg_cell_fractionfraction of each segment in intersected cells (same index as seg_cell)

◆ cs_mesh_intersect_segment_cell_select()

void cs_mesh_intersect_segment_cell_select ( void *  input,
cs_lnum_t n_cells,
cs_lnum_t **  cell_ids 
)

Select cells cut by a given segment.

This selection function may be used as an elements selection function for postprocessing.

In this case, the input points to a real array containing the segment's start and end coordinates.

Note: the input pointer must point to valid data when this selection function is called, so either:

  • that value or structure should not be temporary (i.e. local);
  • post-processing output must be ensured using cs_post_write_meshes() with a fixed-mesh writer before the data pointed to goes out of scope;

The caller is responsible for freeing the returned cell_ids array. When passed to postprocessing mesh or probe set definition functions, this is handled automatically.

Parameters
[in]inputpointer to segment start and end: [x0, y0, z0, x1, y1, z1]
[out]n_cellsnumber of selected cells
[out]cell_idsarray of selected cell ids (0 to n-1 numbering)