← Back to team overview

dolfin team mailing list archive

Re: [HG] -Add conversion from .gmsh (http://www.geuz.org/gmsh/) format to dolfin-convert.

 

Is there a mistake in the parsing of gmsh format. Maybe it should be

elif state == 2:
    if line = "$ENDNOD":
        state += 1

instead of 

elif line == "$ENDNOD":
    state += 1

Otherwise, you will react to "$ENDNOD" no matter what state you are
in. State 2 would indicate that you are now expecting to see "$ENDNOD"
and nothing else.

I don't know the format so I'm just guessing.

/Anders


On Wed, Feb 15, 2006 at 03:54:23PM -0600, Anders Logg wrote:
> No, you can't overload on function name. When you define write_cells()
> again, the previous definition will be lost, same as
> 
> a = 2
> a = 3
> 
> Now a is 3, and no one remembers it was once 2. It can't be both, same
> for functions.
> 
> /Anders
> 
> 
> On Wed, Feb 15, 2006 at 10:45:03PM +0100, DOLFIN wrote:
> > One or more new changesets pushed to the primary DOLFIN repository.
> > A short summary of the last three changesets is included below.
> > 
> > changeset:   1691:c6cc5f39ea0d23ed6eb24a4ddd360e6a3d41db89
> > tag:         tip
> > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > date:        Wed Feb 15 22:44:21 2006 +0100
> > files:       src/utils/convert/dolfin-convert
> > description:
> > -Add conversion from .gmsh (http://www.geuz.org/gmsh/) format to dolfin-convert.
> > -Add functions in dolfin-convert for writing DOLFIN mesh XML headers, etc, which are common to all mesh conversions.
> > 
> > This was my first foray in Python. Is it possible to overload functions?
> > 
> > def write_cells(n0, n1, n2, n3):
> >     .
> > 
> > def write_cells(n0, n1, n2):
> >     .
> >     
> > 
> > Garth
> > 
> > 
> > changeset:   1690:0dc4c67e201b24d136b068587fe3791d3a504636
> > user:        "Johan Jansson <johanjan@xxxxxxxxxxxxxxxx>"
> > date:        Wed Feb 15 15:19:03 2006 +0100
> > files:       src/kernel/io/XMLFile.cpp src/kernel/io/dolfin/XMLFile.h src/test/main.cpp
> > description:
> > io:
> > 
> > Implemented and added test for Function output.
> > 
> > 
> > changeset:   1689:5b787894cb61db22606aaf55e83ee3c7a8080426
> > user:        "Johan Jansson <johanjan@xxxxxxxxxxxxxxxx>"
> > date:        Wed Feb 15 14:30:18 2006 +0100
> > files:       src/kernel/io/XMLVector.cpp src/test/function.xml src/test/main.cpp src/test/reftri.xml.gz
> > description:
> > io:
> > 
> > Fixed and tested Vector input. Added test of Function input to
> > src/test (works).
> > 
> > 
> > -------------------------------------------------------
> > For more details, visit http://www.fenics.org/hg/dolfin
> > 
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
> > 
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



Follow ups

References