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

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

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

revision 1749 by gross, Wed Sep 3 07:25:01 2008 UTC revision 1920 by phornby, Thu Oct 23 10:05:27 2008 UTC
# Line 1  Line 1 
1    
 /* $Id:$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 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    
# Line 23  Line 22 
22  #include "Mesh.h"  #include "Mesh.h"
23  #define UNUSED -1  #define UNUSED -1
24    
 #define BOUNDS_CHECK 1  
   
25  /**************************************************************/  /**************************************************************/
26    
27  void Mesh_createDOFMappingAndCoupling(Finley_Mesh* in, bool_t use_reduced_elements)  void Mesh_createDOFMappingAndCoupling(Finley_Mesh* in, bool_t use_reduced_elements)
# Line 267  void Finley_Mesh_createMappings(Finley_M Line 264  void Finley_Mesh_createMappings(Finley_M
264      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
265      for (i=0;i<mesh->Nodes->numNodes;++i) maskReducedNodes[i]=-1;      for (i=0;i<mesh->Nodes->numNodes;++i) maskReducedNodes[i]=-1;
266      Finley_Mesh_markNodes(maskReducedNodes,0,mesh,TRUE);      Finley_Mesh_markNodes(maskReducedNodes,0,mesh,TRUE);
267    
268      numReducedNodes=Finley_Util_packMask(mesh->Nodes->numNodes,maskReducedNodes,indexReducedNodes);      numReducedNodes=Finley_Util_packMask(mesh->Nodes->numNodes,maskReducedNodes,indexReducedNodes);
269      if (Finley_noError()) Finley_Mesh_createNodeFileMappings(mesh,numReducedNodes,indexReducedNodes,dof_distribution, node_distribution);      if (Finley_noError()) Finley_Mesh_createNodeFileMappings(mesh,numReducedNodes,indexReducedNodes,dof_distribution, node_distribution);
270    }    }
# Line 280  void Finley_Mesh_createNodeFileMappings( Line 278  void Finley_Mesh_createNodeFileMappings(
278    
279    index_t myFirstDOF, myLastDOF, myFirstNode, myLastNode, *reduced_dof_first_component=NULL, *nodeMask=NULL,    index_t myFirstDOF, myLastDOF, myFirstNode, myLastNode, *reduced_dof_first_component=NULL, *nodeMask=NULL,
280           *reduced_nodes_first_component=NULL, k,*maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;           *reduced_nodes_first_component=NULL, k,*maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;
281    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize, minGlobalNodeIndex,maxGlobalNodeIndex;    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize;
282    Paso_MPI_rank myRank;    Paso_MPI_rank myRank;
283    
284    mpiSize=in->Nodes->MPIInfo->size;    mpiSize=in->Nodes->MPIInfo->size;
285    myRank=in->Nodes->MPIInfo->rank;    myRank=in->Nodes->MPIInfo->rank;
286    
287    /* mark the nodes used by the reduced mesh */    /* mark the nodes used by the reduced mesh */
288    
289    reduced_dof_first_component=TMPMEMALLOC(mpiSize+1,index_t);    reduced_dof_first_component=TMPMEMALLOC(mpiSize+1,index_t);
# Line 380  void Finley_Mesh_createNodeFileMappings( Line 379  void Finley_Mesh_createNodeFileMappings(
379      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
380      for (i=0;i<numReducedNodes;++i) nodeMask[indexReducedNodes[i]]=i;      for (i=0;i<numReducedNodes;++i) nodeMask[indexReducedNodes[i]]=i;
381      in->Nodes->reducedNodesMapping=Finley_NodeMapping_alloc(in->Nodes->numNodes,nodeMask,UNUSED);      in->Nodes->reducedNodesMapping=Finley_NodeMapping_alloc(in->Nodes->numNodes,nodeMask,UNUSED);
   
382    }    }
383    TMPMEMFREE(nodeMask);    TMPMEMFREE(nodeMask);
384    /* ==== mapping between nodes and DOFs + DOF connector ========== */    /* ==== mapping between nodes and DOFs + DOF connector ========== */

Legend:
Removed from v.1749  
changed lines
  Added in v.1920

  ViewVC Help
Powered by ViewVC 1.1.26