def METHOD_NAME(mesh):
    # get file info
    dirname = os.path.dirname(mesh["geo"])
    basename = os.path.basename(mesh["geo"])
    name, ext = os.path.splitext(basename)
    # build filename
    filename = name
    if("name" in mesh):
        filename = filename + "_" + str(mesh["name"]) + "_"
    if("h" in mesh):
        filename = filename + "_hmin" + str(mesh["h"][0]) + "_hmax" + str(mesh["h"][1])
    if("reynolds" in mesh):
        filename = filename + "_reynolds" + str(mesh["reynolds"])
    if("lo" in mesh):
        filename = filename + "_lo" + str(mesh["lo"][0])
    filename = filename
    # Check if we did not already create this file before
    # ensure that a new file is created
    i = 0
    while(os.path.exists(filename + "." + str(i) + ext)):
        i = i + 1
    filename = filename + "." + str(i) + ext
    if(params["verbose"]):
        print "Creating " + filename
    fin = open(mesh["geo"], "r")
    fout = open(filename, "w")
    for line in fin.readlines():
        cleanline = line.translate(None, "\n").lstrip().rstrip()
        l = cleanline.split("=")
        newln = ""
        # Set the hmin/hmax value of points
        # if we find a point
        if(l[0].find("Point(") == 0):
            # Get the id of the point
            pid = int(l[0].translate(None, "Point()"))
            # The following only need one replace in cas we are in the wrong case
            # if this is a point that we have to set to hmin, we do it
            if(pid in mesh["hminPoints"]):
                newln = l[0] + "=" + l[1].replace("hmax", "hmin")
            # otherwise we set it to hmax
            else:
                newln = l[0] + "=" + l[1].replace("hmin", "hmax")
            # output line to file
            if(cleanline != newln and params["verbose"]):
                print "\"" + cleanline + "\""
                print "\"" + newln + "\""
                print "Changed line " + l[0]
        # change hmin
        elif(l[0].find("hmin") == 0):
            newln = "hmin = " + str(mesh["h"][0]) + ";"
        # change hmax
        elif(l[0].find("hmax") == 0):
            newln = "hmax = " + str(mesh["h"][1]) + ";"
        # change hmax
        elif(l[0].find("lo") == 0):
            newln = "lo = " + str(mesh["lo"][0]) + ";"
        # by default we output the line to the file
        else:
            newln = cleanline
        fout.write(newln + "\n")
    fin.close()
    fout.close()
    return filename