Escript  Revision_4320
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);
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 */
67 };
69 
71 int Finley_Util_ValueAndIndex_compar(const void *, const void *);
72 
73 #endif /* #ifndef INC_FINLEY_UTIL */
74