/[escript]/trunk/finley/src/NodeFile_setIdRange.c
ViewVC logotype

Diff of /trunk/finley/src/NodeFile_setIdRange.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/finley/src/finleyC/NodeFile_setIdRange.c revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC trunk/finley/src/NodeFile_setIdRange.c revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC
# Line 1  Line 1 
1  /*  
2   ******************************************************************************  /* $Id$ */
3   *                                                                            *  
4   *       COPYRIGHT  ACcESS 2003,2004,2005 -  All Rights Reserved              *  /*******************************************************
5   *                                                                            *   *
6   * This software is the property of ACcESS. No part of this code              *   *           Copyright 2003-2007 by ACceSS MNRF
7   * may be copied in any form or by any means without the expressed written    *   *       Copyright 2007 by University of Queensland
8   * consent of ACcESS.  Copying, use or modification of this software          *   *
9   * by any unauthorised person is illegal unless that person has a software    *   *                http://esscc.uq.edu.au
10   * license agreement with ACcESS.                                             *   *        Primary Business: Queensland, Australia
11   *                                                                            *   *  Licensed under the Open Software License version 3.0
12   ******************************************************************************   *     http://www.opensource.org/licenses/osl-3.0.php
13  */   *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 20  Line 21 
21    
22  /**************************************************************/  /**************************************************************/
23    
 /*   Author: gross@access.edu.au */  
 /*   Version: $Id$ */  
   
 /**************************************************************/  
   
24  #include "NodeFile.h"  #include "NodeFile.h"
25  #include "Util.h"  #include "Util.h"
26    
27  /**************************************************************/  /**************************************************************/
28    
29    
30    void Finley_NodeFile_setGlobalIdRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {
31       index_t min_id_local, max_id_local;
32       #ifdef PASO_MPI
33       index_t global_id_range[2], id_range[2];
34       #endif
35    
36       Finley_NodeFile_setIdRange(&min_id_local, &max_id_local,in);
37    
38       #ifdef PASO_MPI
39       id_range[0]=-min_id_local;
40       id_range[1]=max_id_local;
41       MPI_Allreduce( id_range, global_id_range, 2, MPI_INT, MPI_MAX, in->MPIInfo->comm );
42       *min_id=-global_id_range[0];
43       *max_id=global_id_range[1];
44       #else
45       *min_id=min_id_local;
46       *max_id=max_id_local;
47       #endif
48    }
49    
50  void Finley_NodeFile_setIdRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {  void Finley_NodeFile_setIdRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {
51     *min_id=Finley_Util_getMinInt(1,in->numNodes,in->Id);     *min_id=Finley_Util_getMinInt(1,in->numNodes,in->Id);
52     *max_id=Finley_Util_getMaxInt(1,in->numNodes,in->Id);     *max_id=Finley_Util_getMaxInt(1,in->numNodes,in->Id);
53  }  }
54  /*  void Finley_NodeFile_setGlobalDOFRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {
55  * $Log$     index_t min_id_local, max_id_local;
56  * Revision 1.3  2005/09/15 03:44:23  jgs     #ifdef PASO_MPI
57  * Merge of development branch dev-02 back to main trunk on 2005-09-15     index_t global_id_range[2], id_range[2];
58  *     #endif
59  * Revision 1.2.2.1  2005/09/07 06:26:20  gross  
60  * the solver from finley are put into the standalone package paso now     Finley_NodeFile_setDOFRange(&min_id_local, &max_id_local,in);
61  *  
62  * Revision 1.2  2005/07/08 04:07:56  jgs     #ifdef PASO_MPI
63  * Merge of development branch back to main trunk on 2005-07-08     id_range[0]=-min_id_local;
64  *     id_range[1]=max_id_local;
65  * Revision 1.1.1.1.2.1  2005/06/29 02:34:54  gross     MPI_Allreduce( id_range, global_id_range, 2, MPI_INT, MPI_MAX, in->MPIInfo->comm );
66  * some changes towards 64 integers in finley     *min_id=-global_id_range[0];
67  *     *max_id=global_id_range[1];
68  * Revision 1.1.1.1  2004/10/26 06:53:57  jgs     #else
69  * initial import of project esys2     *min_id=min_id_local;
70  *     *max_id=max_id_local;
71  * Revision 1.1.1.1  2004/06/24 04:00:40  johng     #endif
72  * Initial version of eys using boost-python.  }
73  *  
74  *  void Finley_NodeFile_setDOFRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {
75  */     *min_id=Finley_Util_getMinInt(1,in->numNodes,in->globalDegreesOfFreedom);
76       *max_id=Finley_Util_getMaxInt(1,in->numNodes,in->globalDegreesOfFreedom);
77    }
78    void Finley_NodeFile_setReducedDOFRange(index_t* min_id,index_t* max_id,Finley_NodeFile* in) {
79       *min_id=Finley_Util_getFlaggedMinInt(1,in->numNodes,in->globalReducedDOFIndex,-1);
80       *max_id=Finley_Util_getFlaggedMaxInt(1,in->numNodes,in->globalReducedDOFIndex,-1);
81    }
82    
83    index_t Finley_NodeFile_maxGlobalDegreeOfFreedomIndex(Finley_NodeFile* in) {
84      index_t loc_out, out;
85      loc_out=Finley_Util_getMaxInt(1,in->numNodes,in->globalNodesIndex);
86      #ifdef PASO_MPI
87      MPI_Allreduce(&loc_out, &out, 1, MPI_INT, MPI_MAX, in->MPIInfo->comm );
88      #else
89      out=loc_out;
90      #endif
91      return out;
92    }
93    index_t Finley_NodeFile_maxGlobalReducedDegreeOfFreedomIndex(Finley_NodeFile* in) {
94      index_t loc_out, out;
95      loc_out=Finley_Util_getFlaggedMaxInt(1,in->numNodes,in->globalReducedDOFIndex,-1);
96      #ifdef PASO_MPI
97      MPI_Allreduce(&loc_out, &out, 1, MPI_INT, MPI_MAX, in->MPIInfo->comm );
98      #else
99      out=loc_out;
100      #endif
101      return out;
102    
103    }
104    
105    index_t Finley_NodeFile_maxGlobalNodeIDIndex(Finley_NodeFile* in) {
106      index_t loc_out, out;
107      loc_out=Finley_Util_getMaxInt(1,in->numNodes,in->globalNodesIndex);
108      #ifdef PASO_MPI
109      MPI_Allreduce(&loc_out, &out, 1, MPI_INT, MPI_MAX, in->MPIInfo->comm );
110      #else
111      out=loc_out;
112      #endif
113      return out;
114    }
115    index_t Finley_NodeFile_maxGlobalReducedNodeIDIndex(Finley_NodeFile* in) {
116      index_t loc_out, out;
117      loc_out=Finley_Util_getFlaggedMaxInt(1,in->numNodes,in->globalReducedNodesIndex,-1);
118      #ifdef PASO_MPI
119      MPI_Allreduce(&loc_out, &out, 1, MPI_INT, MPI_MAX, in->MPIInfo->comm );
120      #else
121      out=loc_out;
122      #endif
123      return out;
124    }

Legend:
Removed from v.155  
changed lines
  Added in v.1388

  ViewVC Help
Powered by ViewVC 1.1.26