Escript
Revision_4320
Main Page
Namespaces
Classes
Files
File List
File Members
finley
src
finley/src/Util.h
Go to the documentation of this file.
1
2
/*****************************************************************************
3
*
4
* Copyright (c) 2003-2013 by University of Queensland
5
* http://www.uq.edu.au
6
*
7
* Primary Business: Queensland, Australia
8
* Licensed under the Open Software License version 3.0
9
* http://www.opensource.org/licenses/osl-3.0.php
10
*
11
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12
* Development since 2012 by School of Earth Sciences
13
*
14
*****************************************************************************/
15
16
17
/************************************************************************************/
18
19
/* Some utility routines: */
20
21
/************************************************************************************/
22
23
#ifndef INC_FINLEY_UTIL
24
#define INC_FINLEY_UTIL
25
26
#include "
Finley.h
"
27
#include "esysUtils/Esys_MPI.h"
28
29
/************************************************************************************/
30
31
void
Finley_Util_Gather_double
(
dim_t
len,
index_t
*
index
,
dim_t
numData,
double
* in,
double
* out);
32
void
Finley_Util_Gather_int
(
dim_t
len,
index_t
*
index
,
dim_t
numData,
index_t
* in,
index_t
* out);
33
void
Finley_Util_AddScatter
(
const
dim_t
len,
const
index_t
*
index
,
const
dim_t
numData,
const
double
* in,
double
* out,
const
index_t
upperBound);
34
void
Finley_Util_SmallMatMult
(
dim_t
A1,
dim_t
A2,
double
* A,
dim_t
B2,
double
*B,
double
* C);
35
void
Finley_Util_SmallMatSetMult
(
dim_t
len,
dim_t
A1,
dim_t
A2,
double
* A,
dim_t
B2,
double
*B,
double
* C);
36
void
Finley_Util_SmallMatSetMult1
(
dim_t
len,
dim_t
A1,
dim_t
A2,
double
* A,
dim_t
B2,
double
*B,
double
* C);
37
void
Finley_Util_InvertSmallMat
(
dim_t
len,
dim_t
dim,
double
* A,
double
*invA,
double
* det);
38
void
Finley_Util_DetOfSmallMat
(
dim_t
len,
dim_t
dim,
double
* A,
double
* det);
39
void
Finley_NormalVector
(
dim_t
len,
dim_t
dim,
dim_t
dim1,
double
* A,
double
* Normal);
40
void
Finley_LengthOfNormalVector
(
dim_t
len,
dim_t
dim,
dim_t
dim1,
double
* A,
double
* length);
41
void
Finley_Util_InvertMap
(
dim_t
,
index_t
*,
dim_t
,
index_t
*);
42
index_t
Finley_Util_getMaxInt
(
dim_t
dim,
dim_t
N
,
index_t
* values);
43
index_t
Finley_Util_getMinInt
(
dim_t
dim,
dim_t
N
,
index_t
* values);
44
index_t
Finley_Util_getFlaggedMaxInt
(
dim_t
dim,
dim_t
N
,
index_t
* values,
index_t
ignore);
45
index_t
Finley_Util_getFlaggedMinInt
(
dim_t
dim,
dim_t
N
,
index_t
* values,
index_t
ignore);
46
dim_t
Finley_Util_packMask
(
dim_t
N
,
bool_t
* mask,
index_t
*
index
);
47
bool_t
Finley_Util_isAny
(
dim_t
N
,
index_t
* array,
index_t
value
);
48
index_t
Finley_Util_cumsum
(
dim_t
,
index_t
*);
49
bool_t
Finley_Util_anyNonZeroDouble
(
dim_t
N
,
double
* values);
50
void
Finley_Util_setValuesInUse
(
const
index_t
*values,
const
dim_t
numValues,
dim_t
*numValuesInUse,
index_t
**valuesInUse,
Esys_MPIInfo
* mpiinfo);
51
52
#ifdef ESYS_MPI
53
void
Finley_printDoubleArray( FILE *fid,
dim_t
n,
double
*array,
char
*name );
54
void
Finley_printIntArray( FILE *fid,
dim_t
n,
int
*array,
char
*name );
55
void
Finley_printMaskArray( FILE *fid,
dim_t
n,
int
*array,
char
*name );
56
#endif
57
58
59
60
61
/* Finley_Util_orderValueAndIndex is used to sort items by a value */
62
/* index points to the location of the original item array. */
63
/* it can be used to reorder the array */
64
struct
Finley_Util_ValueAndIndex
{
65
index_t
index
;
66
index_t
value
;
67
};
68
typedef
struct
Finley_Util_ValueAndIndex
Finley_Util_ValueAndIndex
;
69
70
void
Finley_Util_sortValueAndIndex
(
dim_t
n,
Finley_Util_ValueAndIndex
* array);
71
int
Finley_Util_ValueAndIndex_compar
(
const
void
*,
const
void
*);
72
73
#endif
/* #ifndef INC_FINLEY_UTIL */
74
Generated on Fri Mar 15 2013 14:07:51 for Escript by
1.8.1.2