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

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

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

revision 1743 by gross, Fri Aug 29 06:19:53 2008 UTC revision 1744 by ksteube, Tue Sep 2 07:39:18 2008 UTC
# Line 246  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 246  Finley_Mesh* Finley_Mesh_read_MPI(char*
246    double time0=Finley_timer();    double time0=Finley_timer();
247    FILE *fileHandle_p = NULL;    FILE *fileHandle_p = NULL;
248    ElementTypeId typeID, faceTypeID, contactTypeID, pointTypeID;    ElementTypeId typeID, faceTypeID, contactTypeID, pointTypeID;
249      Finley_TagMap* tag_map;
250    index_t tag_key;    index_t tag_key;
251    
252    Finley_resetError();    Finley_resetError();
# Line 789  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 790  Finley_Mesh* Finley_Mesh_read_MPI(char*
790      TMPMEMFREE(tempInts);      TMPMEMFREE(tempInts);
791        } /* end of Read the nodal element data */        } /* end of Read the nodal element data */
792    
793        /* ksteube TODO: read tags */        /* get the name tags */
794          if (Finley_noError()) {
795            char remainder[100000], *ptr;
796            int tag_key, num_read, len, error_code;
797            if (mpi_info->rank == 0) {  /* Master */
798          /* Read the word 'Tag' */
799              fscanf(fileHandle_p, "%s\n", name);
800          /* Read rest of file in one chunk */
801              num_read = fread(remainder, 100000, sizeof(char), fileHandle_p);
802              ptr = strrchr(remainder, '\n');
803              *ptr = '\0';
804            }
805        len = strlen(remainder);
806    #ifdef PASO_MPI
807            error_code = MPI_Bcast (&len, 1, MPI_INT,  0, mpi_info->comm);
808            if (error_code != MPI_SUCCESS) {
809              Finley_setError(PASO_MPI_ERROR, "Finley_Mesh_read: broadcast of tag len failed");
810              return NULL;
811            }
812            error_code = MPI_Bcast (remainder, len+1, MPI_CHAR,  0, mpi_info->comm);
813            if (error_code != MPI_SUCCESS) {
814              Finley_setError(PASO_MPI_ERROR, "Finley_Mesh_read: broadcast of tags failed");
815              return NULL;
816            }
817    #endif
818            ptr = remainder;
819            do {
820              sscanf(ptr, "%s %d\n", name, &tag_key);
821              Finley_Mesh_addTagMap(mesh_p,name,tag_key);
822              ptr++;
823            } while(NULL != (ptr = strchr(ptr, '\n')));
824          }
825    
826       }       }
827    
# Line 799  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 831  Finley_Mesh* Finley_Mesh_read_MPI(char*
831       /*   resolve id's : */       /*   resolve id's : */
832       /* rearrange elements: */       /* rearrange elements: */
833    
      /* return mesh_p; */ /* ksteube temp return for debugging */  
   
834       if (Finley_noError()) Finley_Mesh_resolveNodeIds(mesh_p);       if (Finley_noError()) Finley_Mesh_resolveNodeIds(mesh_p);
835       if (Finley_noError()) Finley_Mesh_prepare(mesh_p, optimize);       if (Finley_noError()) Finley_Mesh_prepare(mesh_p, optimize);
836    

Legend:
Removed from v.1743  
changed lines
  Added in v.1744

  ViewVC Help
Powered by ViewVC 1.1.26