/[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 1903 by ksteube, Thu Sep 25 06:43:44 2008 UTC revision 1904 by phornby, Wed Oct 22 08:27:56 2008 UTC
# Line 44  class Design(design.Design): Line 44  class Design(design.Design):
44      DELAUNAY="iso"      DELAUNAY="iso"
45      NETGEN="netgen"      NETGEN="netgen"
46      TETGEN="tetgen"      TETGEN="tetgen"
47    
48        __script_file = None
49    
50      def __init__(self,dim=3,element_size=1.,order=1,keep_files=False):      def __init__(self,dim=3,element_size=1.,order=1,keep_files=False):
51         """         """
52         initializes the gmsh design         initializes the gmsh design
# Line 98  class Design(design.Design): Line 101  class Design(design.Design):
101          """          """
102          clean up          clean up
103          """          """
104          if not self.keepFiles():          if not self.keepFiles() and (self.scriptFile() != None) :
105                 os.unlink(self.getScriptFileName())              self.scriptFile().close()
106                 os.unlink(self.getMeshFileName())              os.unlink(self.getScriptFileName())
107                os.unlink(self.getMeshFileName())
108    
109      def getCommandString(self):      def getCommandString(self):
110          """          """
111          returns the gmsh comand          returns the gmsh comand
# Line 128  class Design(design.Design): Line 133  class Design(design.Design):
133          returns a handle to a mesh meshing the design. In the current implementation          returns a handle to a mesh meshing the design. In the current implementation
134          a mesh file name in gmsh format is returned.          a mesh file name in gmsh format is returned.
135          """          """
136          open(self.getScriptFileName(),"w").write(self.getScriptString())          f = open(self.getScriptFileName(),"w")
137            setScriptFile(f)
138            f.write(self.getScriptString())
139          cmd = self.getCommandString()          cmd = self.getCommandString()
140          ret = os.system(cmd) / 256          ret = os.system(cmd) / 256
141      if ret > 0:      if ret > 0:
# Line 136  class Design(design.Design): Line 143  class Design(design.Design):
143      else:      else:
144            return self.getMeshFileName()            return self.getMeshFileName()
145    
146        def setScriptFile(self,f=None):
147            self.__script_file=f
148            return
149    
150        def scriptFile(self):
151            return self.__script_file
152    
153    
154    
155      def getScriptString(self):      def getScriptString(self):
156          """          """
157          returns the gmsh script to generate the mesh          returns the gmsh script to generate the mesh

Legend:
Removed from v.1903  
changed lines
  Added in v.1904

  ViewVC Help
Powered by ViewVC 1.1.26