/[escript]/branches/schroedinger_upto1946/finley/src/Mesh_createNodeFileMappings.c
ViewVC logotype

Diff of /branches/schroedinger_upto1946/finley/src/Mesh_createNodeFileMappings.c

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

revision 1735 by gross, Fri Aug 29 00:18:26 2008 UTC revision 1738 by gross, Fri Aug 29 05:06:45 2008 UTC
# Line 52  void Mesh_createDOFMappingAndCoupling(Fi Line 52  void Mesh_createDOFMappingAndCoupling(Fi
52      dof_distribution=in->Nodes->degreesOfFreedomDistribution;      dof_distribution=in->Nodes->degreesOfFreedomDistribution;
53      globalDOFIndex=in->Nodes->globalDegreesOfFreedom;      globalDOFIndex=in->Nodes->globalDegreesOfFreedom;
54    }    }
55      myFirstDOF=Paso_Distribution_getFirstComponent(dof_distribution);
56      myLastDOF=Paso_Distribution_getLastComponent(dof_distribution);
57    
58    
59    mpiSize=mpi_info->size;    mpiSize=mpi_info->size;
60    myRank=mpi_info->rank;    myRank=mpi_info->rank;
# Line 59  void Mesh_createDOFMappingAndCoupling(Fi Line 62  void Mesh_createDOFMappingAndCoupling(Fi
62    min_DOF=Finley_Util_getFlaggedMinInt(1,numNodes,globalDOFIndex,-1);    min_DOF=Finley_Util_getFlaggedMinInt(1,numNodes,globalDOFIndex,-1);
63    max_DOF=Finley_Util_getFlaggedMaxInt(1,numNodes,globalDOFIndex,-1);    max_DOF=Finley_Util_getFlaggedMaxInt(1,numNodes,globalDOFIndex,-1);
64    
65      if (max_DOF < min_DOF) {
66          min_DOF=myFirstDOF;
67          max_DOF=myLastDOF-1;
68      }
69    
70    p_min=mpiSize;    p_min=mpiSize;
71    p_max=-1;    p_max=-1;
72      if (max_DOF >= min_DOF) {
73    for (p=0; p<mpiSize; ++p) {        for (p=0; p<mpiSize; ++p) {
74        if (dof_distribution->first_component[p]<=min_DOF) p_min=p;           if (dof_distribution->first_component[p]<=min_DOF) p_min=p;
75        if (dof_distribution->first_component[p]<=max_DOF) p_max=p;           if (dof_distribution->first_component[p]<=max_DOF) p_max=p;
76    }       }
77       }
78    
79    len_loc_dof=max_DOF-min_DOF+1;    len_loc_dof=max_DOF-min_DOF+1;
   myFirstDOF=Paso_Distribution_getFirstComponent(dof_distribution);  
   myLastDOF=Paso_Distribution_getLastComponent(dof_distribution);  
80    if (! ((min_DOF<=myFirstDOF) && (myLastDOF-1<=max_DOF)) ) {    if (! ((min_DOF<=myFirstDOF) && (myLastDOF-1<=max_DOF)) ) {
81        Finley_setError(SYSTEM_ERROR,"Local elements do not span local degrees of freedom.");        Finley_setError(SYSTEM_ERROR,"Local elements do not span local degrees of freedom.");
82        return;        return;
# Line 274  void Finley_Mesh_createNodeFileMappings( Line 281  void Finley_Mesh_createNodeFileMappings(
281    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,
282           *reduced_nodes_first_component=NULL, *nodes_first_component=NULL,k,           *reduced_nodes_first_component=NULL, *nodes_first_component=NULL,k,
283           *maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;           *maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;
284    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize, globalNumNodes;    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize, minGlobalNodeIndex,maxGlobalNodeIndex;
285    Paso_MPI_rank myRank;    Paso_MPI_rank myRank;
286    
287    mpiSize=in->Nodes->MPIInfo->size;    mpiSize=in->Nodes->MPIInfo->size;
# Line 287  void Finley_Mesh_createNodeFileMappings( Line 294  void Finley_Mesh_createNodeFileMappings(
294    
295    if (! ( Finley_checkPtr(reduced_dof_first_component) || Finley_checkPtr(reduced_nodes_first_component) || Finley_checkPtr(nodes_first_component)  ) ) {    if (! ( Finley_checkPtr(reduced_dof_first_component) || Finley_checkPtr(reduced_nodes_first_component) || Finley_checkPtr(nodes_first_component)  ) ) {
296    
297       globalNumNodes=Finley_NodeFile_maxGlobalNodeIDIndex(in->Nodes)+1;       Finley_NodeFile_setGlobalNodeIDIndexRange(&minGlobalNodeIndex,&maxGlobalNodeIndex,in->Nodes);
298       Paso_MPIInfo_setDistribution(in->Nodes->MPIInfo,0,globalNumNodes-1,nodes_first_component);       Paso_MPIInfo_setDistribution(in->Nodes->MPIInfo,minGlobalNodeIndex,maxGlobalNodeIndex,nodes_first_component);
299    
300       myFirstDOF=dof_first_component[myRank];       myFirstDOF=dof_first_component[myRank];
301       myLastDOF=dof_first_component[myRank+1];       myLastDOF=dof_first_component[myRank+1];
# Line 344  void Finley_Mesh_createNodeFileMappings( Line 351  void Finley_Mesh_createNodeFileMappings(
351          reduced_nodes_first_component[mpiSize]=globalNumReducedNodes;          reduced_nodes_first_component[mpiSize]=globalNumReducedNodes;
352          reduced_dof_first_component[mpiSize]=globalNumReducedDOF;          reduced_dof_first_component[mpiSize]=globalNumReducedDOF;
353          /* ==== distribution of Nodes ===============================*/          /* ==== distribution of Nodes ===============================*/
354          Paso_MPIInfo_setDistribution(in->Nodes->MPIInfo,0,globalNumNodes-1,nodes_first_component);          Paso_MPIInfo_setDistribution(in->Nodes->MPIInfo,minGlobalNodeIndex,maxGlobalNodeIndex,nodes_first_component);
355          in->Nodes->nodesDistribution=Paso_Distribution_alloc(in->Nodes->MPIInfo,nodes_first_component,1,0);          in->Nodes->nodesDistribution=Paso_Distribution_alloc(in->Nodes->MPIInfo,nodes_first_component,1,0);
356            
357          /* ==== distribution of Nodes ===============================*/          /* ==== distribution of Nodes ===============================*/

Legend:
Removed from v.1735  
changed lines
  Added in v.1738

  ViewVC Help
Powered by ViewVC 1.1.26