/[escript]/trunk/pycad/py_src/gmsh.py
ViewVC logotype

Diff of /trunk/pycad/py_src/gmsh.py

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

revision 2238 by gross, Tue Feb 3 06:17:34 2009 UTC revision 2319 by gross, Thu Mar 19 03:19:41 2009 UTC
# Line 36  import design Line 36  import design
36  import tempfile  import tempfile
37  import os  import os
38  from primitives import Point, Spline, BezierCurve, BSpline, Line, Arc, CurveLoop, RuledSurface, PlaneSurface, SurfaceLoop, Volume, PropertySet, Ellipse  from primitives import Point, Spline, BezierCurve, BSpline, Line, Arc, CurveLoop, RuledSurface, PlaneSurface, SurfaceLoop, Volume, PropertySet, Ellipse
39    from esys.escript import getMPIWorldMax, getMPIRankWorld
40    
41  class Design(design.Design):  class Design(design.Design):
42      """      """
# Line 125  class Design(design.Design): Line 126  class Design(design.Design):
126          else:          else:
127                opt=""                opt=""
128    
129          exe="gmsh -%s -algo %s-smooth %s %s-v 0 -order %s -o %s %s" % (          exe="gmsh -format msh -%s -algo %s -smooth %s %s-v 0 -order %s -o %s %s" % (
130                  self.getDim(), self.__algo, self.__smoothing, opt,                  self.getDim(), self.__algo, self.__smoothing, opt,
131                  self.getElementOrder(), self.getMeshFileName(),                  self.getElementOrder(), self.getMeshFileName(),
132                  self.getScriptFileName())                  self.getScriptFileName())
# Line 136  class Design(design.Design): Line 137  class Design(design.Design):
137          Returns a handle to a mesh meshing the design. In the current          Returns a handle to a mesh meshing the design. In the current
138          implementation a mesh file name in gmsh format is returned.          implementation a mesh file name in gmsh format is returned.
139          """          """
         f = open(self.getScriptFileName(),"w")  
         f.write(self.getScriptString())  
         f.close()  
140          cmd = self.getCommandString()          cmd = self.getCommandString()
141          ret = os.system(cmd) / 256          if getMPIRankWorld() == 0:
142                open(self.getScriptFileName(),"w").write(self.getScriptString())
143                ret = os.system(cmd) / 256
144            else:
145                ret=0
146            ret=getMPIWorldMax(ret)
147          if ret > 0:          if ret > 0:
148            raise RuntimeError, "Could not build mesh: %s"%cmd            raise RuntimeError, "Could not build mesh: %s"%cmd
149          else:          else:

Legend:
Removed from v.2238  
changed lines
  Added in v.2319

  ViewVC Help
Powered by ViewVC 1.1.26