/[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 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1741 by gross, Mon Sep 1 04:06:41 2008 UTC
# Line 1  Line 1 
1    
2  /* $Id$ */  /* $Id:$ */
3    
4  /*******************************************************  /*******************************************************
5   *   *
# Line 23  Line 23 
23  #include "Mesh.h"  #include "Mesh.h"
24  #define UNUSED -1  #define UNUSED -1
25    
26    #define BOUNDS_CHECK 1
27    
28  /**************************************************************/  /**************************************************************/
29    
30  void Mesh_createDOFMappingAndCoupling(Finley_Mesh* in, bool_t use_reduced_elements)  void Mesh_createDOFMappingAndCoupling(Finley_Mesh* in, bool_t use_reduced_elements)
31  {  {
32    index_t min_DOF, max_DOF, *shared=NULL, *offsetInShared=NULL, *locDOFMask=NULL, i, k, myFirstDOF, myLastDOF, *nodeMask=NULL, firstDOF, lastDOF, *globalDOFIndex;    index_t min_DOF, max_DOF, *shared=NULL, *offsetInShared=NULL, *locDOFMask=NULL, i, k, myFirstDOF, myLastDOF, *nodeMask=NULL, firstDOF, lastDOF, *globalDOFIndex, *wanted_DOFs=NULL;
33    dim_t mpiSize, len_loc_dof, numNeighbors, n, lastn, numNodes;    dim_t mpiSize, len_loc_dof, numNeighbors, n, lastn, numNodes,*rcv_len=NULL, *snd_len=NULL, count;
34    Paso_MPI_rank myRank,p,p_min,p_max, *neighbor=NULL;    Paso_MPI_rank myRank,p,p_min,p_max, *neighbor=NULL;
35    Paso_SharedComponents *rcv_shcomp=NULL, *snd_shcomp=NULL;    Paso_SharedComponents *rcv_shcomp=NULL, *snd_shcomp=NULL;
36    Finley_NodeMapping *this_mapping=NULL;    Finley_NodeMapping *this_mapping=NULL;
37    Paso_Coupler* this_coupler=NULL;    Paso_Connector* this_connector=NULL;
38    Paso_Distribution* dof_distribution;    Paso_Distribution* dof_distribution;
39        Paso_MPIInfo *mpi_info = in->MPIInfo;
40      #ifdef PASO_MPI
41          MPI_Request* mpi_requests=NULL;
42          MPI_Status* mpi_stati=NULL;
43      #else
44          int *mpi_requests=NULL, *mpi_stati=NULL;
45      #endif
46    
47    numNodes=in->Nodes->numNodes;    numNodes=in->Nodes->numNodes;
48    if (use_reduced_elements) {    if (use_reduced_elements) {
49      dof_distribution=in->Nodes->reducedDegreesOfFreedomDistribution;      dof_distribution=in->Nodes->reducedDegreesOfFreedomDistribution;
50      globalDOFIndex=in->Nodes->globalReducedDOFIndex;      globalDOFIndex=in->Nodes->globalReducedDOFIndex;
     Finley_NodeFile_setReducedDOFRange(&min_DOF, &max_DOF,in->Nodes);  
51    } else {    } else {
52      dof_distribution=in->Nodes->degreesOfFreedomDistribution;      dof_distribution=in->Nodes->degreesOfFreedomDistribution;
53      globalDOFIndex=in->Nodes->globalDegreesOfFreedom;      globalDOFIndex=in->Nodes->globalDegreesOfFreedom;
     Finley_NodeFile_setDOFRange(&min_DOF, &max_DOF,in->Nodes);  
54    }    }
55      myFirstDOF=Paso_Distribution_getFirstComponent(dof_distribution);
56      myLastDOF=Paso_Distribution_getLastComponent(dof_distribution);
57    
58    mpiSize=dof_distribution->mpi_info->size;  
59    myRank=dof_distribution->mpi_info->rank;    mpiSize=mpi_info->size;
60      myRank=mpi_info->rank;
61    
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;
83    }    }
84      rcv_len=TMPMEMALLOC(mpiSize,dim_t);
85      snd_len=TMPMEMALLOC(mpiSize,dim_t);
86      #ifdef PASO_MPI
87        mpi_requests=MEMALLOC(mpiSize*2,MPI_Request);
88        mpi_stati=MEMALLOC(mpiSize*2,MPI_Status);
89      #else
90        mpi_requests=MEMALLOC(mpiSize*2,int);
91        mpi_stati=MEMALLOC(mpiSize*2,int);
92      #endif
93      wanted_DOFs=TMPMEMALLOC(numNodes,index_t);
94    nodeMask=TMPMEMALLOC(numNodes,index_t);    nodeMask=TMPMEMALLOC(numNodes,index_t);
95    neighbor=TMPMEMALLOC(mpiSize,Paso_MPI_rank);    neighbor=TMPMEMALLOC(mpiSize,Paso_MPI_rank);
96    shared=TMPMEMALLOC(numNodes*(p_max-p_min+1),index_t);    shared=TMPMEMALLOC(numNodes*(p_max-p_min+1),index_t);
97    offsetInShared=TMPMEMALLOC(mpiSize+1,index_t);    offsetInShared=TMPMEMALLOC(mpiSize+1,index_t);
98    locDOFMask=TMPMEMALLOC(len_loc_dof, index_t);    locDOFMask=TMPMEMALLOC(len_loc_dof, index_t);
99    if (! ( Finley_checkPtr(neighbor) || Finley_checkPtr(shared) || Finley_checkPtr(offsetInShared) || Finley_checkPtr(locDOFMask) || Finley_checkPtr(nodeMask) ))  {    if (! ( Finley_checkPtr(neighbor) || Finley_checkPtr(shared) || Finley_checkPtr(offsetInShared) || Finley_checkPtr(locDOFMask) ||
100         Finley_checkPtr(nodeMask) || Finley_checkPtr(rcv_len) || Finley_checkPtr(snd_len) || Finley_checkPtr(mpi_requests) || Finley_checkPtr(mpi_stati) ||
101         Finley_checkPtr(mpi_stati) )) {
102      #pragma omp parallel for private(i) schedule(static)  
103      for (i=0;i<len_loc_dof;++i) locDOFMask[i]=UNUSED;      memset(rcv_len,0,sizeof(dim_t)*mpiSize);
104      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel
105      for (i=0;i<numNodes;++i) nodeMask[i]=UNUSED;      {
106            #pragma omp for private(i) schedule(static)
107      for (i=0;i<numNodes;++i) {          for (i=0;i<len_loc_dof;++i) locDOFMask[i]=UNUSED;
108         k=globalDOFIndex[i];          #pragma omp for private(i) schedule(static)
109  #ifdef BOUNDS_CHECK          for (i=0;i<numNodes;++i) nodeMask[i]=UNUSED;
110         if ((k-min_DOF) >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d k=%d min_DOF=%d\n", __FILE__, __LINE__, i, k, min_DOF); exit(1); }          #pragma omp for private(i,k) schedule(static)
111  #endif          for (i=0;i<numNodes;++i) {
112         if (k>-1) locDOFMask[k-min_DOF]=UNUSED-1;             k=globalDOFIndex[i];
113      }             if (k>-1) {
114                  locDOFMask[k-min_DOF]=UNUSED-1;
115                  #ifdef BOUNDS_CHECK
116                  if ((k-min_DOF) >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d k=%d min_DOF=%d\n", __FILE__, __LINE__, i, k, min_DOF); exit(1); }
117                  #endif
118               }
119            }
120    
121      for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {          #pragma omp for private(i) schedule(static)
122        locDOFMask[i]=i-myFirstDOF+min_DOF;          for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {
123  #ifdef BOUNDS_CHECK            locDOFMask[i]=i-myFirstDOF+min_DOF;
124        if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }            #ifdef BOUNDS_CHECK
125  #endif            if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }
126              #endif
127            }
128      }      }
129    
130      numNeighbors=0;      numNeighbors=0;
# Line 104  void Mesh_createDOFMappingAndCoupling(Fi Line 135  void Mesh_createDOFMappingAndCoupling(Fi
135         lastDOF=MIN(max_DOF+1,dof_distribution->first_component[p+1]);         lastDOF=MIN(max_DOF+1,dof_distribution->first_component[p+1]);
136         if (p != myRank) {         if (p != myRank) {
137             for (i=firstDOF-min_DOF;i<lastDOF-min_DOF;++i) {             for (i=firstDOF-min_DOF;i<lastDOF-min_DOF;++i) {
138  #ifdef BOUNDS_CHECK                  #ifdef BOUNDS_CHECK
139                     if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d p=%d i=%d\n", __FILE__, __LINE__, p, i); exit(1); }                  if (i < 0 || i >= len_loc_dof) { printf("BOUNDS_CHECK %s %d p=%d i=%d\n", __FILE__, __LINE__, p, i); exit(1); }
140  #endif                  #endif
141                  if (locDOFMask[i] == UNUSED-1) {                  if (locDOFMask[i] == UNUSED-1) {
142                     locDOFMask[i]=myLastDOF-myFirstDOF+n;                     locDOFMask[i]=myLastDOF-myFirstDOF+n;
143                       wanted_DOFs[n]=i+min_DOF;
144                     ++n;                     ++n;
145                  }                  }
146             }             }
147             if (n>lastn) {             if (n>lastn) {
148                  rcv_len[p]=n-lastn;
149                neighbor[numNeighbors]=p;                neighbor[numNeighbors]=p;
150  #ifdef BOUNDS_CHECK                #ifdef BOUNDS_CHECK
151                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d p=%d numNeighbors=%d n=%d\n", __FILE__, __LINE__, p, numNeighbors, n); exit(1); }                if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d p=%d numNeighbors=%d n=%d\n", __FILE__, __LINE__, p, numNeighbors, n); exit(1); }
152  #endif                #endif
153                offsetInShared[numNeighbors]=lastn;                offsetInShared[numNeighbors]=lastn;
154                numNeighbors++;                numNeighbors++;
155                lastn=n;                lastn=n;
# Line 138  void Mesh_createDOFMappingAndCoupling(Fi Line 171  void Mesh_createDOFMappingAndCoupling(Fi
171      /* now we can set the mapping from nodes to local DOFs */      /* now we can set the mapping from nodes to local DOFs */
172      this_mapping=Finley_NodeMapping_alloc(numNodes,nodeMask,UNUSED);      this_mapping=Finley_NodeMapping_alloc(numNodes,nodeMask,UNUSED);
173      /* define how to get DOF values for controlled bu other processors */      /* define how to get DOF values for controlled bu other processors */
174  #ifdef BOUNDS_CHECK      #ifdef BOUNDS_CHECK
175      for (i=0;i<offsetInShared[numNeighbors];++i) {      for (i=0;i<offsetInShared[numNeighbors];++i) {
176        if (i < 0 || i >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }        if (i < 0 || i >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %d i=%d\n", __FILE__, __LINE__, i); exit(1); }
177      }      }
178  #endif      #endif
179      #pragma omp parallel for private(i) schedule(static)      #pragma omp parallel for private(i) schedule(static)
180      for (i=0;i<offsetInShared[numNeighbors];++i) shared[i]=myLastDOF-myFirstDOF+i;      for (i=0;i<offsetInShared[numNeighbors];++i) shared[i]=myLastDOF-myFirstDOF+i;
181    
182      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,mpi_info);
183    
184      /* now it is determined which DOFs needs to be send off:*/      /*
185      #pragma omp parallel for private(i) schedule(static)       *    now we build the sender
186      for (i=0;i<len_loc_dof;++i) locDOFMask[i]=UNUSED;       */
187        #ifdef PASO_MPI
188             MPI_Alltoall(rcv_len,1,MPI_INT,snd_len,1,MPI_INT,mpi_info->comm);
189        #else
190            for (p=0;p<mpiSize;++p) snd_len[p]=rcv_len[p];
191        #endif
192        count=0;
193        for (p=0;p<rcv_shcomp->numNeighbors;p++) {
194           #ifdef PASO_MPI
195           MPI_Isend(&(wanted_DOFs[rcv_shcomp->offsetInShared[p]]), rcv_shcomp->offsetInShared[p+1]-rcv_shcomp->offsetInShared[p],
196                      MPI_INT,rcv_shcomp->neighbor[p],mpi_info->msg_tag_counter+myRank,mpi_info->comm,&mpi_requests[count]);
197            #endif
198            count++;
199        }
200      n=0;      n=0;
201      numNeighbors=0;      numNeighbors=0;
202      lastn=n;      for (p=0;p<mpiSize;p++) {
203      for (p=p_min;p<=p_max;++p) {           if (snd_len[p] > 0) {
204         firstDOF=dof_distribution->first_component[p];              #ifdef PASO_MPI
205         lastDOF=dof_distribution->first_component[p+1];              MPI_Irecv(&(shared[n]),snd_len[p],
206         if (p != myRank) {                        MPI_INT, p, mpi_info->msg_tag_counter+p, mpi_info->comm, &mpi_requests[count]);
207             /* mark a DOF by p if it will be requested by processor p */              #endif
208             Finley_Mesh_markDOFsConnectedToRange(locDOFMask,min_DOF,p,firstDOF,lastDOF,in,use_reduced_elements);              count++;
209                neighbor[numNeighbors]=p;
210             for (i=myFirstDOF-min_DOF;i<myLastDOF-min_DOF;++i) {              offsetInShared[numNeighbors]=n;
211                  if (locDOFMask[i] == p) {              numNeighbors++;
212  #ifdef BOUNDS_CHECK              n+=snd_len[p];
213             if (n < 0 || n >= numNodes*(p_max-p_min+1)) { printf("BOUNDS_CHECK %s %d p=%d i=%d n=%d\n", __FILE__, __LINE__, p, i, n); exit(1); }           }
 #endif  
                    shared[n]=i-myFirstDOF+min_DOF;  
                    ++n;  
                 }  
            }  
            if (n>lastn) {  
               neighbor[numNeighbors]=p;  
 #ifdef BOUNDS_CHECK  
               if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d p=%d n=%d numNeighbors=%d\n", __FILE__, __LINE__, p, n, numNeighbors); exit(1); }  
 #endif  
               offsetInShared[numNeighbors]=lastn;  
               numNeighbors++;  
               lastn=n;  
            }  
         }  
214      }      }
215  #ifdef BOUNDS_CHECK      mpi_info->msg_tag_counter+=mpi_info->size;
216      if (numNeighbors < 0 || numNeighbors >= mpiSize+1) { printf("BOUNDS_CHECK %s %d numNeighbors=%d\n", __FILE__, __LINE__, numNeighbors); exit(1); }      offsetInShared[numNeighbors]=n;
217  #endif      #ifdef PASO_MPI
218      offsetInShared[numNeighbors]=lastn;      MPI_Waitall(count,mpi_requests,mpi_stati);
219      snd_shcomp=Paso_SharedComponents_alloc(numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);      #endif
220        /* map global ids to local id's */
221        #pragma omp parallel for private(i) schedule(static)
222        for (i=0;i<offsetInShared[numNeighbors];++i) {
223            shared[i]=locDOFMask[shared[i]-min_DOF];
224        }
225    
226        snd_shcomp=Paso_SharedComponents_alloc(myLastDOF-myFirstDOF,numNeighbors,neighbor,shared,offsetInShared,1,0,dof_distribution->mpi_info);
227    
228      if (Finley_noError()) this_coupler=Paso_Coupler_alloc(snd_shcomp,rcv_shcomp);      if (Finley_noError()) this_connector=Paso_Connector_alloc(snd_shcomp,rcv_shcomp);
229      /* assign new DOF labels to nodes */      /* assign new DOF labels to nodes */
230      Paso_SharedComponents_free(rcv_shcomp);      Paso_SharedComponents_free(rcv_shcomp);
231      Paso_SharedComponents_free(snd_shcomp);      Paso_SharedComponents_free(snd_shcomp);
232    }    }
233      TMPMEMFREE(rcv_len);
234      TMPMEMFREE(snd_len);
235      TMPMEMFREE(mpi_requests);
236      TMPMEMFREE(mpi_stati);
237      TMPMEMFREE(wanted_DOFs);
238    TMPMEMFREE(nodeMask);    TMPMEMFREE(nodeMask);
239    TMPMEMFREE(neighbor);    TMPMEMFREE(neighbor);
240    TMPMEMFREE(shared);    TMPMEMFREE(shared);
# Line 200  void Mesh_createDOFMappingAndCoupling(Fi Line 243  void Mesh_createDOFMappingAndCoupling(Fi
243    if (Finley_noError()) {    if (Finley_noError()) {
244       if (use_reduced_elements) {       if (use_reduced_elements) {
245          in->Nodes->reducedDegreesOfFreedomMapping=this_mapping;          in->Nodes->reducedDegreesOfFreedomMapping=this_mapping;
246          in->Nodes->reducedDegreesOfFreedomCoupler=this_coupler;          in->Nodes->reducedDegreesOfFreedomConnector=this_connector;
247       } else {       } else {
248          in->Nodes->degreesOfFreedomMapping=this_mapping;          in->Nodes->degreesOfFreedomMapping=this_mapping;
249          in->Nodes->degreesOfFreedomCoupler=this_coupler;          in->Nodes->degreesOfFreedomConnector=this_connector;
250      }      }
251    } else {    } else {
252       Finley_NodeMapping_free(this_mapping);       Finley_NodeMapping_free(this_mapping);
253       Paso_Coupler_free(this_coupler);       Paso_Connector_free(this_connector);
254    
255    }    }
256  }  }
# Line 238  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, n, lastn,n0, numNeighbors;    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 251  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 279  void Finley_Mesh_createNodeFileMappings( Line 322  void Finley_Mesh_createNodeFileMappings(
322                 k=in->Nodes->globalNodesIndex[indexReducedNodes[i]];                 k=in->Nodes->globalNodesIndex[indexReducedNodes[i]];
323                 if ( (k>=myFirstNode) && (myLastNode>k) ) maskMyReducedNodes[k-myFirstNode]=i;                 if ( (k>=myFirstNode) && (myLastNode>k) ) maskMyReducedNodes[k-myFirstNode]=i;
324                 k=in->Nodes->globalDegreesOfFreedom[indexReducedNodes[i]];                 k=in->Nodes->globalDegreesOfFreedom[indexReducedNodes[i]];
325                 if ( (k>=myFirstDOF) && (myLastDOF>k) ) maskMyReducedDOF[k-myFirstDOF]=i;                 if ( (k>=myFirstDOF) && (myLastDOF>k) ) {
326                      maskMyReducedDOF[k-myFirstDOF]=i;
327                   }
328              }              }
329          }          }
330          myNumReducedNodes=Finley_Util_packMask(myNumNodes,maskMyReducedNodes,indexMyReducedNodes);          myNumReducedNodes=Finley_Util_packMask(myNumNodes,maskMyReducedNodes,indexMyReducedNodes);
# Line 306  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 ===============================*/
# Line 345  void Finley_Mesh_createNodeFileMappings( Line 390  void Finley_Mesh_createNodeFileMappings(
390    
391    }    }
392    TMPMEMFREE(nodeMask);    TMPMEMFREE(nodeMask);
393    /* ==== mapping between nodes and DOFs + DOF coupler ========== */    /* ==== mapping between nodes and DOFs + DOF connector ========== */
394    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,FALSE);    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,FALSE);
395    /* ==== mapping between nodes and reduced DOFs + reduced DOF coupler ========== */    /* ==== mapping between nodes and reduced DOFs + reduced DOF connector ========== */
396    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,TRUE);    if ( Finley_noError()) Mesh_createDOFMappingAndCoupling(in,TRUE);
397    
398    /* get the Ids for DOFs and reduced nodes */    /* get the Ids for DOFs and reduced nodes */
# Line 370  void Finley_Mesh_createNodeFileMappings( Line 415  void Finley_Mesh_createNodeFileMappings(
415      Paso_Distribution_free(in->Nodes->reducedNodesDistribution);      Paso_Distribution_free(in->Nodes->reducedNodesDistribution);
416      Paso_Distribution_free(in->Nodes->degreesOfFreedomDistribution);      Paso_Distribution_free(in->Nodes->degreesOfFreedomDistribution);
417      Paso_Distribution_free(in->Nodes->reducedDegreesOfFreedomDistribution);      Paso_Distribution_free(in->Nodes->reducedDegreesOfFreedomDistribution);
418      Paso_Coupler_free(in->Nodes->degreesOfFreedomCoupler);      Paso_Connector_free(in->Nodes->degreesOfFreedomConnector);
419      Paso_Coupler_free(in->Nodes->reducedDegreesOfFreedomCoupler);      Paso_Connector_free(in->Nodes->reducedDegreesOfFreedomConnector);
420      in->Nodes->nodesMapping=NULL;      in->Nodes->nodesMapping=NULL;
421      in->Nodes->reducedNodesMapping=NULL;      in->Nodes->reducedNodesMapping=NULL;
422      in->Nodes->degreesOfFreedomMapping=NULL;      in->Nodes->degreesOfFreedomMapping=NULL;
# Line 380  void Finley_Mesh_createNodeFileMappings( Line 425  void Finley_Mesh_createNodeFileMappings(
425      in->Nodes->reducedNodesDistribution=NULL;      in->Nodes->reducedNodesDistribution=NULL;
426      in->Nodes->degreesOfFreedomDistribution=NULL;      in->Nodes->degreesOfFreedomDistribution=NULL;
427      in->Nodes->reducedDegreesOfFreedomDistribution=NULL;      in->Nodes->reducedDegreesOfFreedomDistribution=NULL;
428      in->Nodes->degreesOfFreedomCoupler=NULL;      in->Nodes->degreesOfFreedomConnector=NULL;
429      in->Nodes->reducedDegreesOfFreedomCoupler=NULL;      in->Nodes->reducedDegreesOfFreedomConnector=NULL;
430    }    }
431  }  }
432    

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

  ViewVC Help
Powered by ViewVC 1.1.26