/[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 2549 by jfenwick, Mon Jul 20 06:43:47 2009 UTC revision 2620 by gross, Thu Aug 20 06:24:00 2009 UTC
# Line 127  class Design(design.Design): Line 127  class Design(design.Design):
127          else:          else:
128                opt=""                opt=""
129    
130          exe="gmsh -format msh -%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" % (
131                  self.getDim(), self.__algo, self.__smoothing, opt,                  self.getDim(), self.__algo, self.__smoothing, opt,
132                  self.getElementOrder(), self.getMeshFileName(),                  self.getElementOrder(), self.getMeshFileName())
                 self.getScriptFileName())  
133          return exe          return exe
134        def getScriptHandler(self):
135            """
136            Returns a handler to the script file to generate the geometry.
137            In the current implementation a script file name is returned.
138            """
139            if getMPIRankWorld() == 0:
140                open(self.getScriptFileName(),"w").write(self.getScriptString())
141            return self.getScriptFileName()
142    
143    
144      def getMeshHandler(self):      def getMeshHandler(self):
145          """          """
146          Returns a handle to a mesh meshing the design. In the current          Returns a handle to a mesh meshing the design. In the current
147          implementation a mesh file name in gmsh format is returned.          implementation a mesh file name in gmsh format is returned.
148          """          """
149          cmd = self.getCommandString()          cmd = self.getCommandString()%self.getScriptHandler()
150          if getMPIRankWorld() == 0:          if getMPIRankWorld() == 0:
             open(self.getScriptFileName(),"w").write(self.getScriptString())  
151              ret = os.system(cmd) / 256              ret = os.system(cmd) / 256
152          else:          else:
153              ret=0              ret=0

Legend:
Removed from v.2549  
changed lines
  Added in v.2620

  ViewVC Help
Powered by ViewVC 1.1.26