programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mei_math_util.h
Go to the documentation of this file.
1 #ifndef __MEI_MATH_UTIL_H__
2 #define __MEI_MATH_UTIL_H__
3 
10 /*
11  This file is part of Code_Saturne, a general-purpose CFD tool.
12 
13  Copyright (C) 1998-2014 EDF S.A.
14 
15  This program is free software; you can redistribute it and/or modify it under
16  the terms of the GNU General Public License as published by the Free Software
17  Foundation; either version 2 of the License, or (at your option) any later
18  version.
19 
20  This program is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23  details.
24 
25  You should have received a copy of the GNU General Public License along with
26  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27  Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29 
30 /*----------------------------------------------------------------------------*/
31 
32 /*----------------------------------------------------------------------------
33  * Fichiers `include' librairie standard C
34  *----------------------------------------------------------------------------*/
35 
36 #include <math.h>
37 
38 /*============================================================================
39  * Type definitions
40  *============================================================================*/
41 
42 /*----------------------------------------------------------------------------*/
46 /*----------------------------------------------------------------------------*/
47 
48 typedef struct {
49  int col;
50  int row;
51  double **values;
52  char *name;
53  char *commentaries;
55 
56 /*============================================================================
57  * Public function definitions
58  *============================================================================*/
59 
60 /*----------------------------------------------------------------------------
61  * Return an interpolated value.
62  *
63  * param [in] filename char
64  * param [in] c1 double
65  * param [in] c2 double
66  * param [in] x variable to interpolate
67  *
68  * return interpolated value
69  *----------------------------------------------------------------------------*/
70 
71 double
72 mei_interp1d(const char *filename, const int c1, const int c2, const double x);
73 
74 /*-----------------------------------------------------------------------------*/
75 /*
76  * Destroy all user data set for 1D interpolation.
77  */
78 /*-----------------------------------------------------------------------------*/
79 
80 void mei_data_free(void);
81 
82 /*----------------------------------------------------------------------------
83  * Return the max value from two doubles.
84  *
85  * parameters:
86  * x1 <-- double
87  * x2 <-- double
88  *----------------------------------------------------------------------------*/
89 
90 double
91 mei_max(const double x1, const double x2);
92 
93 /*----------------------------------------------------------------------------
94  * Return the min value from two doubles.
95  *
96  * parameters:
97  * x1 <-- double
98  * x2 <-- double
99  *----------------------------------------------------------------------------*/
100 
101 double
102 mei_min(const double x1, const double x2);
103 
104 /*-----------------------------------------------------------------------------*/
105 
106 #endif
void mei_data_free(void)
Destroy all user data set for 1D interpolation.
Definition: mei_math_util.c:495
char * name
Definition: mei_math_util.h:52
int col
Definition: mei_math_util.h:49
double ** values
Definition: mei_math_util.h:51
char * commentaries
Definition: mei_math_util.h:53
Structure associated to a single user data set for 1D interpolation.
Definition: mei_math_util.h:48
int row
Definition: mei_math_util.h:50
double mei_min(const double x1, const double x2)
Return the min value from two doubles.
Definition: mei_math_util.c:542
double mei_max(const double x1, const double x2)
Return the max value from two doubles.
Definition: mei_math_util.c:523
double mei_interp1d(const char *filename, const int c1, const int c2, const double x)
Return the 1D interpolation if a value.
Definition: mei_math_util.c:461