FeResPost Web Site                     FeResPost Online User Manual

IV.2.5.4 Outputting a Gmsh file

This example illustrates the creation of a Gmsh file for later visualization with Gmsh. The part of the data file specific to the “writeGmsh” function call is as follows:

   # Group creation :

   meshGrp=db.getGroupAllFEM

   targetGrp = db.getGroupCopy("pan_PZ_Al_2024")
   targetGrp2 = db.getGroupCopy("pan_PZ")

   # Stress data in skins :

   stress = db.getResultCopy("TEMP_GRAD_X","Statics",\
      "Stress Tensor","ElemCenters",targetGrp,[])
   stress2 = db.getResultCopy("TEMP_GRAD_X","Statics",\
      "Stress Tensor","ElemCorners",targetGrp,[])

   displ = db.getResultCopy("TEMP_GRAD_X","Statics",\
      "Displacements, Translational","Nodes",targetGrp2,[])
   norm = displ.deriveVectorToOneScal("abs")

   # Stress data in honeycomb :

   targetGrp =tmpGroup_Honey_72
   honeyStress=db.getResultCopy("TEMP_GRAD_X","Statics",\
      "Stress Tensor","ElemCenters",targetGrp,[])

   # Gmsh output :

   db.writeGmshMesh("brol.msh",0,meshGrp,false)
   db.writeGmsh("brol.gmsh",0,[[stress,"stress","ElemCenters"],\
                               [stress2,"stress2","ElemCorners"],\
                               [honeyStress,"honeyStress","ElemCenterPoints"],\
                               [displ,"displ","Nodes"],\
                               [norm,"norm","Nodes"]],\
                              [[db.getGroupCopy("pan_PZ"),"mesh pan_PZ"],\
                               [db.getGroupCopy("pan_MZ"),"mesh pan_MZ"],\
                               [db.getGroupCopy("pan_PX"),"mesh pan_PX"]],\
                              [[meshGrp,"skel sat"]])

In fact, only the last function call is new. The example is provided in file "RUBY/EX11/writeGmsh.rb".