/[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 2699 by gross, Tue Sep 29 06:29:12 2009 UTC revision 2700 by gross, Wed Sep 30 08:28:55 2009 UTC
# Line 163  class Design(design.Design): Line 163  class Design(design.Design):
163          Returns the gmsh script to generate the mesh.          Returns the gmsh script to generate the mesh.
164          """          """
165          h=self.getElementSize()          h=self.getElementSize()
166          out='// generated by esys.pycad\nGeneral.Terminal = 1;'          out='// generated by esys.pycad\nGeneral.Terminal = 1;\n'
167          for prim in self.getAllPrimitives():          for prim in self.getAllPrimitives():
168             p=prim.getUnderlyingPrimitive()             p=prim.getUnderlyingPrimitive()
169             if isinstance(p, Point):             if isinstance(p, Point):
# Line 223  class Design(design.Design): Line 223  class Design(design.Design):
223                        line+="Surface"                        line+="Surface"
224                    else:                    else:
225                        line+="Volume"                        line+="Volume"
226                    out+=line+"(" + str(p.getID()) + ") = {"+self.__mkArgs(p.getItems())+"};\n"                    out+=line+"(" + str(p.getID()) + ") = {"+self.__mkArgs(p.getItems(),useAbs=True)+"};\n"
227    
228             else:             else:
229                 raise TypeError("unable to pass %s object to gmsh."%str(type(p)))                 raise TypeError("unable to pass %s object to gmsh."%str(type(p)))
230          return out          return out
231    
232    
233      def __mkArgs(self,args):      def __mkArgs(self,args, useAbs=False):
234          line=""          line=""
235          for i in args:          for i in args:
236                id = i.getDirectedID()
237                if useAbs: id=abs(id)
238              if len(line)>0:              if len(line)>0:
239                  line+=", %s"%i.getDirectedID()                  line+=", %s"%id
240              else:              else:
241                  line="%s"%i.getDirectedID()                  line="%s"%id
242          return line          return line
243    
244      def __mkTransfiniteLine(self,p):      def __mkTransfiniteLine(self,p):

Legend:
Removed from v.2699  
changed lines
  Added in v.2700

  ViewVC Help
Powered by ViewVC 1.1.26