/[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

temp/finley/src/Mesh_createNodeFileMappings.c revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC trunk/finley/src/Mesh_createNodeFileMappings.c revision 1628 by phornby, Fri Jul 11 13:12:46 2008 UTC
# Line 32  void Mesh_createDOFMappingAndCoupling(Fi Line 32  void Mesh_createDOFMappingAndCoupling(Fi
32    Paso_MPI_rank myRank,p,p_min,p_max, *neighbor=NULL;    Paso_MPI_rank myRank,p,p_min,p_max, *neighbor=NULL;
33    Paso_SharedComponents *rcv_shcomp=NULL, *snd_shcomp=NULL;    Paso_SharedComponents *rcv_shcomp=NULL, *snd_shcomp=NULL;
34    Finley_NodeMapping *this_mapping=NULL;    Finley_NodeMapping *this_mapping=NULL;
35    Paso_Coupler* this_coupler=NULL;    Paso_Connector* this_connector=NULL;
36    Paso_Distribution* dof_distribution;    Paso_Distribution* dof_distribution;
37        
38    numNodes=in->Nodes->numNodes;    numNodes=in->Nodes->numNodes;
# Line 146  void Mesh_createDOFMappingAndCoupling(Fi Line 146  void Mesh_createDOFMappingAndCoupling(Fi
146      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
147      for (i=0;i<offsetInShared[numNeighbors];++i) shared[i]=myLastDOF-myFirstDOF+i;      for (i=0;i<offsetInShared[numNeighbors];++i) shared[i]=myLastDOF-myFirstDOF+i;
148    
149      rcv_shcomp=Paso_SharedComponents_alloc(numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);      rcv_shcomp=Paso_SharedComponents_alloc(myLastDOF-myFirstDOF,numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);
150    
151      /* now it is determined which DOFs needs to be send off:*/      /* now it is determined which DOFs needs to be send off:*/
152      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
# Line 185  void Mesh_createDOFMappingAndCoupling(Fi Line 185  void Mesh_createDOFMappingAndCoupling(Fi
185      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d numNeighbors=%d\n", __FILE__, __LINE__, numNeighbors); exit(1); }      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d numNeighbors=%d\n", __FILE__, __LINE__, numNeighbors); exit(1); }
186  #endif  #endif
187      offsetInShared[numNeighbors]=lastn;      offsetInShared[numNeighbors]=lastn;
188      snd_shcomp=Paso_SharedComponents_alloc(numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);      snd_shcomp=Paso_SharedComponents_alloc(myLastDOF-myFirstDOF,numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);
189    
190      if (Finley_noError()) this_coupler=Paso_Coupler_alloc(snd_shcomp,rcv_shcomp);      if (Finley_noError()) this_connector=Paso_Connector_alloc(snd_shcomp,rcv_shcomp);
191      /* assign new DOF labels to nodes */      /* assign new DOF labels to nodes */
192      Paso_SharedComponents_free(rcv_shcomp);      Paso_SharedComponents_free(rcv_shcomp);
193      Paso_SharedComponents_free(snd_shcomp);      Paso_SharedComponents_free(snd_shcomp);
# Line 200  void Mesh_createDOFMappingAndCoupling(Fi Line 200  void Mesh_createDOFMappingAndCoupling(Fi
200    if (Finley_noError()) {    if (Finley_noError()) {
201       if (use_reduced_elements) {       if (use_reduced_elements) {
202          in->Nodes->reducedDegreesOfFreedomMapping=this_mapping;          in->Nodes->reducedDegreesOfFreedomMapping=this_mapping;
203          in->Nodes->reducedDegreesOfFreedomCoupler=this_coupler;          in->Nodes->reducedDegreesOfFreedomConnector=this_connector;
204       } else {       } else {
205          in->Nodes->degreesOfFreedomMapping=this_mapping;          in->Nodes->degreesOfFreedomMapping=this_mapping;
206          in->Nodes->degreesOfFreedomCoupler=this_coupler;          in->Nodes->degreesOfFreedomConnector=this_connector;
207      }      }
208    } else {    } else {
209       Finley_NodeMapping_free(this_mapping);       Finley_NodeMapping_free(this_mapping);
210       Paso_Coupler_free(this_coupler);       Paso_Connector_free(this_connector);
211    
212    }    }
213  }  }
# Line 238  void Finley_Mesh_createNodeFileMappings( Line 238  void Finley_Mesh_createNodeFileMappings(
238    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,
239           *reduced_nodes_first_component=NULL, *nodes_first_component=NULL,k,           *reduced_nodes_first_component=NULL, *nodes_first_component=NULL,k,
240           *maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;           *maskMyReducedDOF=NULL, *indexMyReducedDOF=NULL, *maskMyReducedNodes=NULL, *indexMyReducedNodes=NULL;
241    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize, globalNumNodes, n, lastn,n0, numNeighbors;    dim_t myNumDOF, myNumNodes, myNumReducedNodes, myNumReducedDOF, globalNumReducedNodes, globalNumReducedDOF,i,mpiSize, globalNumNodes;
242    Paso_MPI_rank myRank;    Paso_MPI_rank myRank;
243    
244    mpiSize=in->Nodes->MPIInfo->size;    mpiSize=in->Nodes->MPIInfo->size;
# Line 345  void Finley_Mesh_createNodeFileMappings( Line 345  void Finley_Mesh_createNodeFileMappings(
345    
346    }    }
347    TMPMEMFREE(nodeMask);    TMPMEMFREE(nodeMask);
348    /* ==== mapping between nodes and DOFs + DOF coupler ========== */    /* ==== mapping between nodes and DOFs + DOF connector ========== */
349    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,FALSE);    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,FALSE);
350    /* ==== mapping between nodes and reduced DOFs + reduced DOF coupler ========== */    /* ==== mapping between nodes and reduced DOFs + reduced DOF connector ========== */
351    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,TRUE);    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,TRUE);
352    
353    /* get the Ids for DOFs and reduced nodes */    /* get the Ids for DOFs and reduced nodes */
# Line 370  void Finley_Mesh_createNodeFileMappings( Line 370  void Finley_Mesh_createNodeFileMappings(
370      Paso_Distribution_free(in->Nodes->reducedNodesDistribution);      Paso_Distribution_free(in->Nodes->reducedNodesDistribution);
371      Paso_Distribution_free(in->Nodes->degreesOfFreedomDistribution);      Paso_Distribution_free(in->Nodes->degreesOfFreedomDistribution);
372      Paso_Distribution_free(in->Nodes->reducedDegreesOfFreedomDistribution);      Paso_Distribution_free(in->Nodes->reducedDegreesOfFreedomDistribution);
373      Paso_Coupler_free(in->Nodes->degreesOfFreedomCoupler);      Paso_Connector_free(in->Nodes->degreesOfFreedomConnector);
374      Paso_Coupler_free(in->Nodes->reducedDegreesOfFreedomCoupler);      Paso_Connector_free(in->Nodes->reducedDegreesOfFreedomConnector);
375      in->Nodes->nodesMapping=NULL;      in->Nodes->nodesMapping=NULL;
376      in->Nodes->reducedNodesMapping=NULL;      in->Nodes->reducedNodesMapping=NULL;
377      in->Nodes->degreesOfFreedomMapping=NULL;      in->Nodes->degreesOfFreedomMapping=NULL;
# Line 380  void Finley_Mesh_createNodeFileMappings( Line 380  void Finley_Mesh_createNodeFileMappings(
380      in->Nodes->reducedNodesDistribution=NULL;      in->Nodes->reducedNodesDistribution=NULL;
381      in->Nodes->degreesOfFreedomDistribution=NULL;      in->Nodes->degreesOfFreedomDistribution=NULL;
382      in->Nodes->reducedDegreesOfFreedomDistribution=NULL;      in->Nodes->reducedDegreesOfFreedomDistribution=NULL;
383      in->Nodes->degreesOfFreedomCoupler=NULL;      in->Nodes->degreesOfFreedomConnector=NULL;
384      in->Nodes->reducedDegreesOfFreedomCoupler=NULL;      in->Nodes->reducedDegreesOfFreedomConnector=NULL;
385    }    }
386  }  }
387    

Legend:
Removed from v.1387  
changed lines
  Added in v.1628

  ViewVC Help
Powered by ViewVC 1.1.26