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

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

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

revision 899 by gross, Mon Nov 13 08:02:24 2006 UTC revision 931 by gross, Fri Jan 19 03:06:33 2007 UTC
# Line 25  __url__="http://www.iservo.edu.au/esys/e Line 25  __url__="http://www.iservo.edu.au/esys/e
25  __version__="$Revision:$"  __version__="$Revision:$"
26  __date__="$Date:$"  __date__="$Date:$"
27    
28  from primitives import Primitive, PrimitiveStack  from primitives import Primitive #, PrimitiveStack
29  from datetime import date  from datetime import date
30  import tempfile  import tempfile
31  import os  import os
32    
33    class PrimitiveBaseStack(object):
34          def __init__(self,*items):
35            self.__prims=set()
36            for i in items:
37                self.__prims|=i.getPrimitives()
38            self.__prims=list(self.__prims)
39            self.__prims.sort()
40    
41          def getGmshCommands(self,scaling_factor=1.):
42            out=""
43            for i in self.__prims:
44               out+=i.getGmshCommand(scaling_factor)+"\n"
45            return out
46    
47  class Design(object):  class Design(object):
48      """      """
49      template for elementary geometrical object      template for elementary geometrical object
# Line 89  class Design(object): Line 103  class Design(object):
103      def writeFinleyMesh(self,filename):      def writeFinleyMesh(self,filename):
104          mshname=tempfile.mkstemp(suffix=".msh")[1]          mshname=tempfile.mkstemp(suffix=".msh")[1]
105          exe=self.writeGmshMesh(mshname)          exe=self.writeGmshMesh(mshname)
106          f=open(mshname,"r")          convertGmshToFinley(open(mshname,"r"),open(filename,"w"),dim=self.getDim())
         line=f.readline().split()  
         while len(line)>0:  
            print line  
            line=f.readline().split()  
107          if not self.keepTmpFiles(): os.unlink(mshname)          if not self.keepTmpFiles(): os.unlink(mshname)
108          return exe          return exe
109    
110    def convertGmshToFinley(gmsh_file,finley_file,dim=3):
111            line=gmsh_file.readline().split()
112            while len(line)>0:
113               print line
114               line=gmsh_file.readline().split()

Legend:
Removed from v.899  
changed lines
  Added in v.931

  ViewVC Help
Powered by ViewVC 1.1.26