/[escript]/branches/doubleplusgood/dudley/src/Mesh_readGmsh.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/dudley/src/Mesh_readGmsh.cpp

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

revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC revision 1178 by gross, Wed May 30 05:03:17 2007 UTC
# Line 51  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 51  Finley_Mesh* Finley_Mesh_readGmsh(char*
51      sprintf(error_msg,"reading GMSH with MPI is not supported yet.");      sprintf(error_msg,"reading GMSH with MPI is not supported yet.");
52      Finley_setError(IO_ERROR,error_msg);      Finley_setError(IO_ERROR,error_msg);
53      return NULL;      return NULL;
   
54  #else  #else
55    /* allocate mesh */    /* allocate mesh */
56    
# Line 245  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 244  Finley_Mesh* Finley_Mesh_readGmsh(char*
244                   final_element_type=Line2;                   final_element_type=Line2;
245                } else if (numDim==2) {                } else if (numDim==2) {
246                   final_element_type=Tri3;                   final_element_type=Tri3;
247                } else if (numDim==2) {                } else if (numDim==3) {
248                   final_element_type=Tet4;                   final_element_type=Tet4;
249                }                }
250             }             }
# Line 254  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 253  Finley_Mesh* Finley_Mesh_readGmsh(char*
253                   final_face_element_type=Point1;                   final_face_element_type=Point1;
254                } else if (numDim==2) {                } else if (numDim==2) {
255                   final_face_element_type=Line2;                   final_face_element_type=Line2;
256                } else if (numDim==2) {                } else if (numDim==3) {
257                   final_face_element_type=Tri3;                   final_face_element_type=Tri3;
258                }                }
259             }             }
# Line 323  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 322  Finley_Mesh* Finley_Mesh_readGmsh(char*
322    
323    /* close file */    /* close file */
324    fclose(fileHandle_p);    fclose(fileHandle_p);
   /* clean up */  
   if (! Finley_noError()) {  
      Finley_Mesh_dealloc(mesh_p);  
      return NULL;  
   }  
325    /*   resolve id's : */    /*   resolve id's : */
326    Finley_Mesh_resolveNodeIds(mesh_p);  printf("resolve nodes\n");
327      if (Finley_noError()) {
328          Finley_Mesh_resolveNodeIds(mesh_p);
329      }
330    printf("resolve nodes\n");
331    /* rearrange elements: */    /* rearrange elements: */
332    Finley_Mesh_prepare(mesh_p);  printf("prepare\n");
333      if (Finley_noError()) {
334         Finley_Mesh_prepare(mesh_p);
335      }
336    printf("prepare\n");
337    
338      /* optimize node labeling*/
339      if (Finley_noError()) {
340          if (optimize_labeling) Finley_Mesh_optimizeNodeLabeling(mesh_p);
341      }
342    /* that's it */    /* that's it */
343    #ifdef Finley_TRACE    #ifdef Finley_TRACE
344    printf("timing: reading mesh: %.4e sec\n",Finley_timer()-time0);    printf("timing: reading mesh: %.4e sec\n",Finley_timer()-time0);
# Line 341  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 348  Finley_Mesh* Finley_Mesh_readGmsh(char*
348         if (  ! Finley_Mesh_isPrepared(mesh_p)) {         if (  ! Finley_Mesh_isPrepared(mesh_p)) {
349            Finley_setError(SYSTEM_ERROR,"Mesh is not prepared for calculation. Contact the programmers.");            Finley_setError(SYSTEM_ERROR,"Mesh is not prepared for calculation. Contact the programmers.");
350         }         }
351      } else {
352         Finley_Mesh_dealloc(mesh_p);
353    }    }
354    return mesh_p;    return mesh_p;
355  }  }

Legend:
Removed from v.1062  
changed lines
  Added in v.1178

  ViewVC Help
Powered by ViewVC 1.1.26