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(); |
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 |
|
|
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 |
|
|