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

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

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

revision 1155 by gross, Fri Apr 13 03:39:49 2007 UTC revision 1156 by gross, Mon May 21 06:45:14 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 258  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 257  Finley_Mesh* Finley_Mesh_readGmsh(char*
257                   final_face_element_type=Tri3;                   final_face_element_type=Tri3;
258                }                }
259             }             }
260    printf("ELEMENTS READ\n");
261             mesh_p->Elements=Finley_ElementFile_alloc(final_element_type,mesh_p->order, mesh_p->reduced_order);             mesh_p->Elements=Finley_ElementFile_alloc(final_element_type,mesh_p->order, mesh_p->reduced_order);
262             mesh_p->FaceElements=Finley_ElementFile_alloc(final_face_element_type,mesh_p->order, mesh_p->reduced_order);             mesh_p->FaceElements=Finley_ElementFile_alloc(final_face_element_type,mesh_p->order, mesh_p->reduced_order);
263             mesh_p->ContactElements=Finley_ElementFile_alloc(Point1_Contact,mesh_p->order, mesh_p->reduced_order);             mesh_p->ContactElements=Finley_ElementFile_alloc(Point1_Contact,mesh_p->order, mesh_p->reduced_order);
# Line 301  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 301  Finley_Mesh* Finley_Mesh_readGmsh(char*
301             }             }
302           }           }
303        }        }
304    printf("ELEMENTS reordered\n");
305        /* and clean up */        /* and clean up */
306        TMPMEMFREE(id);        TMPMEMFREE(id);
307        TMPMEMFREE(tag);        TMPMEMFREE(tag);
# Line 323  Finley_Mesh* Finley_Mesh_readGmsh(char* Line 324  Finley_Mesh* Finley_Mesh_readGmsh(char*
324    
325    /* close file */    /* close file */
326    fclose(fileHandle_p);    fclose(fileHandle_p);
   /* clean up */  
   if (! Finley_noError()) {  
      Finley_Mesh_dealloc(mesh_p);  
      return NULL;  
   }  
327    /*   resolve id's : */    /*   resolve id's : */
328    Finley_Mesh_resolveNodeIds(mesh_p);    if (Finley_noError()) {
329          Finley_Mesh_resolveNodeIds(mesh_p);
330      }
331    /* rearrange elements: */    /* rearrange elements: */
332    Finley_Mesh_prepare(mesh_p);    if (Finley_noError()) {
333         Finley_Mesh_prepare(mesh_p);
334      }
335    
336      /* optimize node labeling*/
337      if (Finley_noError()) {
338          if (optimize_labeling) Finley_Mesh_optimizeNodeLabeling(mesh_p);
339      }
340    /* that's it */    /* that's it */
341    #ifdef Finley_TRACE    #ifdef Finley_TRACE
342    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 346  Finley_Mesh* Finley_Mesh_readGmsh(char*
346         if (  ! Finley_Mesh_isPrepared(mesh_p)) {         if (  ! Finley_Mesh_isPrepared(mesh_p)) {
347            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.");
348         }         }
349      } else {
350         Finley_Mesh_dealloc(mesh_p);
351    }    }
352    return mesh_p;    return mesh_p;
353  }  }

Legend:
Removed from v.1155  
changed lines
  Added in v.1156

  ViewVC Help
Powered by ViewVC 1.1.26