8.3
general documentation
fvm_point_location.h
Go to the documentation of this file.
1#ifndef __FVM_POINT_LOCATION_H__
2#define __FVM_POINT_LOCATION_H__
3
4/*============================================================================
5 * Locate local points in a nodal representation associated with a mesh
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#include "cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "fvm_defs.h"
37#include "fvm_nodal.h"
38
39/*----------------------------------------------------------------------------*/
40
42
43/*=============================================================================
44 * Macro definitions
45 *============================================================================*/
46
47/*============================================================================
48 * Type definitions
49 *============================================================================*/
50
51/*=============================================================================
52 * Static global variables
53 *============================================================================*/
54
55/*=============================================================================
56 * Public function prototypes
57 *============================================================================*/
58
59/*----------------------------------------------------------------------------
60 * Find elements in a given nodal mesh containing points: updates the
61 * location[] and distance[] arrays associated with a set of points
62 * for points that are in an element of this mesh, or closer to one
63 * than to previously encountered elements.
64 *
65 * parameters:
66 * this_nodal <-- pointer to nodal mesh representation structure
67 * tolerance_base <-- associated base tolerance (used for bounding
68 * box check only, not for location test)
69 * tolerance_multiplier <-- associated fraction of element bounding boxes
70 * added to tolerance
71 * locate_on_parents <-- location relative to parent element numbers if 1,
72 * id of element + 1 in concatenated sections of
73 * same element dimension if 0
74 * n_points <-- number of points to locate
75 * point_tag <-- optional point tag
76 * point_coords <-- point coordinates
77 * location <-> number of element containing or closest to each
78 * point (size: n_points)
79 * distance <-> distance from point to element indicated by
80 * location[]: < 0 if unlocated, 0 - 1 if inside,
81 * and > 1 if outside a volume element, or absolute
82 * distance to a surface element (size: n_points)
83 *----------------------------------------------------------------------------*/
84
85void
86fvm_point_location_nodal(const fvm_nodal_t *this_nodal,
87 float tolerance_base,
88 float tolerance_fraction,
89 int locate_on_parents,
90 cs_lnum_t n_points,
91 const int *point_tag,
92 const cs_coord_t point_coords[],
93 cs_lnum_t location[],
94 float distance[]);
95
96/*----------------------------------------------------------------------------
97 * For each point previously located in a element, find among vertices of this
98 * element the closest vertex relative to this point.
99 *
100 * As input, located_ent_num is an array with a numbering not using a parent
101 * numbering. As output, located_ent_num may use a parent numbering
102 * according to the value of locate_on_parents.
103 *
104 * The located_vtx_num output is also determined relative to the
105 * locate_on_parents option.
106 *
107 * parameters:
108 * this_nodal <-- pointer to nodal mesh representation structure
109 * locate_on_parents <-- location relative to parent element numbers if 1,
110 * id of element + 1 in concatenated sections of
111 * same element dimension if 0
112 * n_points <-- number of points to locate
113 * point_coords <-- point coordinates
114 * located_ent_num <-> input: list of elements (cells or faces according
115 * to max entity dim) where points have been
116 * initially located or not (size: n_points)
117 * output: possibly modified by parent numbering
118 * located_vtx_num <-> output: list of vertices closest to each point
119 *----------------------------------------------------------------------------*/
120
121void
122fvm_point_location_closest_vertex(const fvm_nodal_t *this_nodal,
123 int locate_on_parents,
124 cs_lnum_t n_points,
125 const cs_coord_t point_coords[],
126 cs_lnum_t located_ent_num[],
127 cs_lnum_t located_vtx_num[]);
128
129/*----------------------------------------------------------------------------*/
130
132
133#endif /* __FVM_POINT_LOCATION_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_coord_t
Definition: cs_defs.h:340
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void fvm_point_location_closest_vertex(const fvm_nodal_t *this_nodal, int locate_on_parents, cs_lnum_t n_points, const cs_coord_t point_coords[], cs_lnum_t located_ent_num[], cs_lnum_t located_vtx_num[])
Definition: fvm_point_location.cpp:3420
void fvm_point_location_nodal(const fvm_nodal_t *this_nodal, float tolerance_base, float tolerance_fraction, int locate_on_parents, cs_lnum_t n_points, const int *point_tag, const cs_coord_t point_coords[], cs_lnum_t location[], float distance[])
Definition: fvm_point_location.cpp:3256