/[escript]/trunk/dudley/src/ElementFile_createColoring.c
ViewVC logotype

Diff of /trunk/dudley/src/ElementFile_createColoring.c

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

trunk/finley/src/ElementFile_createColoring.c revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC branches/domexper/dudley/src/ElementFile_createColoring.c revision 3086 by jfenwick, Thu Aug 5 05:07:58 2010 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2010 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16  /*                                                                                                         */  /*                                                                                                         */
17  /*   Finley: ElementFile                                                                                   */  /*   Dudley: ElementFile                                                                                   */
18  /*                                                                                                         */  /*                                                                                                         */
19  /*   This routine tries to reduce the number of colors used to color elements in the Finley_ElementFile in */  /*   This routine tries to reduce the number of colors used to color elements in the Dudley_ElementFile in */
20  /*                                                                                                         */  /*                                                                                                         */
21  /**************************************************************/  /**************************************************************/
22    
# Line 26  Line 25 
25    
26  /**************************************************************/  /**************************************************************/
27    
28  void Finley_ElementFile_createColoring(Finley_ElementFile* in,dim_t numNodes, index_t* degreeOfFreedom) {  void Dudley_ElementFile_createColoring(Dudley_ElementFile* in,dim_t numNodes, index_t* degreeOfFreedom) {
29      dim_t e,i,numUncoloredElements,n,len,NN;      dim_t e,i,numUncoloredElements,n,len,NN;
30      index_t *maskDOF,color,min_id,max_id;      index_t *maskDOF,min_id,max_id;
31      bool_t independent;      bool_t independent;
32    
33      if (in==NULL) return;      if (in==NULL) return;
34      if (in->numElements<1) return;      if (in->numElements<1) return;
35      NN=in->numNodes;      NN=in->numNodes;
36    
37      min_id=Finley_Util_getMinInt(1,numNodes,degreeOfFreedom);      min_id=Dudley_Util_getMinInt(1,numNodes,degreeOfFreedom);
38      max_id=Finley_Util_getMaxInt(1,numNodes,degreeOfFreedom);      max_id=Dudley_Util_getMaxInt(1,numNodes,degreeOfFreedom);
39      len=max_id-min_id+1;      len=max_id-min_id+1;
40      maskDOF=TMPMEMALLOC(len,index_t);      maskDOF=TMPMEMALLOC(len,index_t);
41      if (! Finley_checkPtr(maskDOF) ) {      if (! Dudley_checkPtr(maskDOF) ) {
42           #pragma omp parallel for private(e) schedule(static)           #pragma omp parallel for private(e) schedule(static)
43           for (e=0;e<in->numElements;e++) in->Color[e]=-1;           for (e=0;e<in->numElements;e++) in->Color[e]=-1;
44           numUncoloredElements=in->numElements;           numUncoloredElements=in->numElements;

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

  ViewVC Help
Powered by ViewVC 1.1.26