/[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 932 by gross, Fri Jan 19 09:27:15 2007 UTC revision 999 by gross, Tue Feb 27 08:12:37 2007 UTC
# Line 30  class Design(design.Design): Line 30  class Design(design.Design):
30      """      """
31      design fo gmsh      design fo gmsh
32      """      """
33      ISO="iso"      DELAUNAY="iso"
     TRI="tri"  
     ANISO="aniso"  
34      NETGEN="netgen"      NETGEN="netgen"
35      TETGEN="tetgen"      TETGEN="tetgen"
36      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):
# Line 40  class Design(design.Design): Line 38  class Design(design.Design):
38         initializes the gmsh design         initializes the gmsh design
39    
40         @param dim: patial dimension         @param dim: patial dimension
41         @element_size: global element size         @param element_size: global element size
42         @order: element order         @param order: element order
43         @keep_files: flag to keep work files.         @param keep_files: flag to keep work files.
44         """         """
45         design.Design.__init__(self,dim=dim,element_size=element_size,order=order,keep_files=keep_files)         design.Design.__init__(self,dim=dim,element_size=element_size,order=order,keep_files=keep_files)
46         self.setScriptFileName()         self.setScriptFileName()
# Line 76  class Design(design.Design): Line 74  class Design(design.Design):
74         returns the name of the file for the gmsh msh         returns the name of the file for the gmsh msh
75         """         """
76         return self.__mshname         return self.__mshname
77      def setOptions(self,algorithm=None,optimize_quality=True,smoothing=3):      def setOptions(self,algorithm=None,optimize_quality=True,smoothing=1):
78          """          """
79          sets options for the mesh generator          sets options for the mesh generator
80          """          """
81          if algorithm==None: algorithm=self.ISO          if algorithm==None: algorithm=self.DELAUNAY
82          self.__algo=algorithm          self.__algo=algorithm
83          self.__optimize_quality=optimize_quality          self.__optimize_quality=optimize_quality
84          self.__smoothing=smoothing          self.__smoothing=smoothing
# Line 108  class Design(design.Design): Line 106  class Design(design.Design):
106                opt="-optimize "                opt="-optimize "
107          else:          else:
108                opt=""                opt=""
109          exe="gmsh -%s -algo %s -smooth %s %s -v 0 -order %s -o %s %s"%(self.getDim(),          exe="gmsh -%s -algo %s -clcurv -smooth %s %s -v 0 -order %s -o %s %s"%(self.getDim(),
110                                                                         self.__algo,                                                                         self.__algo,
111                                                                         self.__smoothing,                                                                         self.__smoothing,
112                                                                         opt,                                                                         opt,
# Line 124  class Design(design.Design): Line 122  class Design(design.Design):
122          open(self.getScriptFileName(),"w").write(self.getScriptString())          open(self.getScriptFileName(),"w").write(self.getScriptString())
123          os.system(self.getCommandString())          os.system(self.getCommandString())
124          return self.getMeshFileName()          return self.getMeshFileName()
 # to finley  
 def MakeDomain(design,integrationOrder=-1,optimizeLabeling=True, richFaceElements=False):  
         mshname=design.getMeshHandler()  
         print "MakeDomain :",mshname  
         1/0  
         convertGmshToFinley(open(mshname,"r"),open(filename,"w"),dim=self.getDim())  
         if not self.keepTmpFiles(): os.unlink(mshname)  
         return exe  
         line=gmsh_file.readline().split()  
         while len(line)>0:  
            print line  
            line=gmsh_file.readline().split()  

Legend:
Removed from v.932  
changed lines
  Added in v.999

  ViewVC Help
Powered by ViewVC 1.1.26