~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/fvm/fvm_point_location.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
/*----------------------------------------------------------------------------
 
31
 *  Local headers
 
32
 *----------------------------------------------------------------------------*/
 
33
 
 
34
#include "fvm_defs.h"
 
35
#include "fvm_nodal.h"
 
36
 
 
37
/*----------------------------------------------------------------------------*/
 
38
 
 
39
#ifdef __cplusplus
 
40
extern "C" {
 
41
#if 0
 
42
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
 
43
#endif
 
44
#endif /* __cplusplus */
 
45
 
 
46
/*=============================================================================
 
47
 * Macro definitions
 
48
 *============================================================================*/
 
49
 
 
50
/*============================================================================
 
51
 * Type definitions
 
52
 *============================================================================*/
 
53
 
 
54
/*=============================================================================
 
55
 * Static global variables
 
56
 *============================================================================*/
 
57
 
 
58
/*=============================================================================
 
59
 * Public function prototypes
 
60
 *============================================================================*/
 
61
 
 
62
/*----------------------------------------------------------------------------
 
63
 * Find elements in a given nodal mesh containing points: updates the
 
64
 * location[] and distance[] arrays associated with a set of points
 
65
 * for points that are in an element of this mesh, or closer to one
 
66
 * than to previously encountered elements.
 
67
 *
 
68
 * parameters:
 
69
 *   this_nodal        <-- pointer to nodal mesh representation structure
 
70
 *   tolerance         <-- associated 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_coords      <-- point coordinates
 
76
 *   location          <-> number of element containing or closest to each
 
77
 *                         point (size: n_points)
 
78
 *   distance          <-> distance from point to element indicated by
 
79
 *                         location[]: < 0 if unlocated, 0 - 1 if inside,
 
80
 *                         and > 1 if outside a volume element, or absolute
 
81
 *                         distance to a surface element (size: n_points)
 
82
 *----------------------------------------------------------------------------*/
 
83
 
 
84
void
 
85
fvm_point_location_nodal(const fvm_nodal_t  *this_nodal,
 
86
                         double              tolerance,
 
87
                         int                 locate_on_parents,
 
88
                         fvm_lnum_t          n_points,
 
89
                         const fvm_coord_t   point_coords[],
 
90
                         fvm_lnum_t          location[],
 
91
                         float               distance[]);
 
92
 
 
93
/*----------------------------------------------------------------------------
 
94
 * Find elements in a given nodal mesh closest to points: updates the
 
95
 * location[] and distance[] arrays associated with a set of points
 
96
 * for points that are closer to an element of this mesh than to previously
 
97
 * encountered elements.
 
98
 *
 
99
 * This function currently only handles elements of lower dimension than
 
100
 * the spatial dimension.
 
101
 *
 
102
 * parameters:
 
103
 *   this_nodal        <-- pointer to nodal mesh representation structure
 
104
 *   locate_on_parents <-- location relative to parent element numbers if 1,
 
105
 *                         id of element + 1 in concatenated sections of
 
106
 *                         same element dimension if 0
 
107
 *   n_points          <-- number of points to locate
 
108
 *   point_coords      <-- point coordinates
 
109
 *   location          <-> number of element containing or closest to each
 
110
 *                         point (size: n_points)
 
111
 *   distance          <-> distance from point to element indicated by
 
112
 *                         location[]: < 0 if unlocated, or absolute
 
113
 *                         distance to a surface element (size: n_points)
 
114
 *----------------------------------------------------------------------------*/
 
115
 
 
116
void
 
117
fvm_point_location_closest_nodal(const fvm_nodal_t  *this_nodal,
 
118
                                 int                 locate_on_parents,
 
119
                                 fvm_lnum_t          n_points,
 
120
                                 const fvm_coord_t   point_coords[],
 
121
                                 fvm_lnum_t          location[],
 
122
                                 float               distance[]);
 
123
 
 
124
/*----------------------------------------------------------------------------*/
 
125
 
 
126
#ifdef __cplusplus
 
127
}
 
128
#endif /* __cplusplus */
 
129
 
 
130
#endif /* __FVM_POINT_LOCATION_H__ */