My Project
programmer's documentation
Functions
cs_geom.h File Reference
#include "cs_defs.h"
Include dependency graph for cs_geom.h:

Go to the source code of this file.

Functions

void cs_geom_closest_point (cs_lnum_t n_points, const cs_real_t point_coords[][3], const cs_real_t query_coords[3], cs_lnum_t *point_id, int *rank_id)
 find the closest point of a set to a given point in space. More...
 
double cs_geom_segment_intersect_face (int orient, cs_lnum_t n_vertices, const cs_lnum_t vertex_ids[], const cs_real_t vtx_coord[][3], const cs_real_t face_cog[3], const cs_real_t sx0[3], const cs_real_t sx1[3], int n_crossings[2], cs_real_t *face_norm)
 Test if a line segment intersects a face. More...
 

Function Documentation

◆ cs_geom_closest_point()

void cs_geom_closest_point ( cs_lnum_t  n_points,
const cs_real_t  point_coords[][3],
const cs_real_t  query_coords[3],
cs_lnum_t point_id,
int *  rank_id 
)

find the closest point of a set to a given point in space.

If the orient parameter is set to -1 or 1, intersection is only considered when (sx1-sx0).normal.orient > 0. If set to 0, intersection is considered in both cases.

Parameters
[in]n_pointsnumber of points
[in]point_coordspoint coordinates
[in]query_coordscoordinates searched for
[out]point_idid of closest point if on the same rank, -1 otherwise
[out]rank_idid of rank containing closest point

◆ cs_geom_segment_intersect_face()

double cs_geom_segment_intersect_face ( int  orient,
cs_lnum_t  n_vertices,
const cs_lnum_t  vertex_ids[],
const cs_real_t  vtx_coord[][3],
const cs_real_t  face_cog[3],
const cs_real_t  sx0[3],
const cs_real_t  sx1[3],
int  n_crossings[2],
cs_real_t face_norm 
)

Test if a line segment intersects a face.

                          |
 x------------------------|--------x D: end coordinates

O: start coordiantes | x G: Face (Center of Gravity) x current | cell center | | Face number

If the orient parameter is set to -1 or 1, intersection is only considered when (sx1-sx0).normal.orient > 0. If set to 0, intersection is considered in both cases.

Parameters
[in]orientif -1 or 1, multiplies face_normal to check for segment
[in]n_verticesnumber of face vertices
[in]vertex_idsids of face vertices
[in]vtx_coordvertex coordinates
[in]face_cogcoordinates of face center
[in]sx0segment start coordinates
[in]sx1segment end coordinates
[out]n_crossingsnumber sub_face crossings [0: in; 1: out]
[in,out]face_normlocal face unit normal of the crossed sub triangle (if entering with something different from NULL)
Returns
2 if the segment does not go through the face's plane, or minimum relative distance (in terms of segment length) of intersection point to face.