/[escript]/trunk-mpi-branch/finley/src/Util.h
ViewVC logotype

Contents of /trunk-mpi-branch/finley/src/Util.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1230 - (show annotations)
Thu Aug 9 06:19:35 2007 UTC (12 years, 9 months ago) by gross
File MIME type: text/plain
File size: 3192 byte(s)
the mappings of nodes of local and global DOFs added but program still crashes.

1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11
12 */
13
14 /**************************************************************/
15
16 /* Some utility routines: */
17
18 /**************************************************************/
19
20 /* author: gross@access.edu.au */
21 /* Version: $Id$ */
22
23 /**************************************************************/
24
25 #ifndef INC_FINLEY_UTIL
26 #define INC_FINLEY_UTIL
27
28 #include "Finley.h"
29
30 /**************************************************************/
31
32 void Finley_Util_Gather_double(dim_t len,index_t* index,dim_t numData,double* in,double * out);
33 void Finley_Util_Gather_int(dim_t len,index_t* index,dim_t numData,index_t* in,index_t * out);
34 void Finley_Util_AddScatter(dim_t len,index_t* index,dim_t numData,double* in,double * out, index_t bound);
35 void Finley_Util_SmallMatMult(dim_t A1,dim_t A2, double* A, dim_t B2, double*B, double* C);
36 void Finley_Util_SmallMatSetMult(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
51 #ifdef PASO_MPI
52 void Finley_printDoubleArray( FILE *fid, dim_t n, double *array, char *name );
53 void Finley_printIntArray( FILE *fid, dim_t n, int *array, char *name );
54 void Finley_printMaskArray( FILE *fid, dim_t n, int *array, char *name );
55 #endif
56
57
58
59 /* Finley_Util_orderValueAndIndex is used to sort items by a value */
60 /* index points to the location of the original item array. */
61 /* it can be used to reorder the array */
62 struct Finley_Util_ValueAndIndex {
63 index_t index;
64 index_t value;
65 };
66 typedef struct Finley_Util_ValueAndIndex Finley_Util_ValueAndIndex;
67
68 void Finley_Util_sortValueAndIndex(dim_t n,Finley_Util_ValueAndIndex* array);
69 int Finley_Util_ValueAndIndex_compar(const void *, const void *);
70
71 #endif /* #ifndef INC_FINLEY_UTIL */
72

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26