#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <string.h>
#include "bft_mem.h"
#include "cs_base.h"
#include "cs_geom.h"
#include "fvm_nodal.h"
#include "fvm_point_location.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_connect.h"
#include "cs_mesh_quantities.h"
#include "cs_mesh_intersect.h"
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... | |
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:
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.
[in] | input | pointer to segments starts and ends: [x0, y0, z0, x1, y1, z1] |
[in] | n_points | number of vertices in the polyline |
[out] | n_cells | number of selected cells |
[out] | cell_ids | array of selected cell ids (0 to n-1 numbering) |
[out] | seg_c_len | array of length of the segment in the selected cells |
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.
[in] | n_points | number of vertices in the polyline |
[in] | point_coords | pointer to segments starts and ends: [x0, y0, z0, x1, y1, z1, ...] |
[in] | min_fraction | minimum fraction of each edge under which fraction is ignored |
[out] | seg_cell_idx | index of start an end cell ids per segment (size: n_points == n_segments-1) |
[out] | seg_cell | cells 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_fraction | fraction of each segment in intersected cells (same index as seg_cell) |
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:
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.
[in] | input | pointer to segment start and end: [x0, y0, z0, x1, y1, z1] |
[out] | n_cells | number of selected cells |
[out] | cell_ids | array of selected cell ids (0 to n-1 numbering) |