def prep_mesh_config(iname, oname, sizing, char_length=0.1):
    """Create file specifying meshing parameters.

    Sizing specified at points, edges and cells and implemented through
    thresholds.

    Additional info about gmsh mesh sizing `here
    <http://gmsh.info/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes>`_.

    Args:
        iname (str): input filename
        oname (str): output filename
        sizing (list): mesh size near points, edges and in cells
        char_length (float, optional): gmsh Mesh.CharacteristicLengthMax
    """
    eps = 1e-06
    xmin = ymin = zmin = 0
    xmax = ymax = zmax = 1
    base = '{{{0}, {1}, {2}, {3}, {4}, {5}}}'
    with open(oname, 'w') as fhl:
        fhl.write('Merge "{}";\n'.format(iname))
        fhl.write('e1() = Line In BoundingBox ' + base.format(xmin - eps, 
            ymin - eps, zmin - eps, xmax + eps, ymax + eps, zmax + eps) + ';\n'
            )
        fhl.write('Mesh.CharacteristicLengthMax = {0};\n'.format(char_length))
        fhl.write('psize = {0};\n'.format(sizing[0]))
        fhl.write('esize = {0};\n'.format(sizing[1]))
        fhl.write('csize = {0};\n'.format(sizing[2]))
        fhl.write('p1() = Point In BoundingBox ' + base.format(xmin - eps, 
            ymin - eps, zmin - eps, xmax + eps, ymax + eps, zmax + eps) + ';\n'
            )
        fhl.write('Field[1] = Distance;\n')
        fhl.write('Field[1].NodesList = {p1()};' + '\n')
        fhl.write('Field[2] = Threshold;\n')
        fhl.write('Field[2].IField = 1;\n')
        fhl.write('Field[2].LcMin = psize;\n')
        fhl.write('Field[2].LcMax = csize;\n')
        fhl.write('Field[2].DistMin = 0;\n')
        fhl.write('Field[2].DistMax = 3*csize;\n')
        fhl.write('Field[3] = Distance;\n')
        fhl.write('Field[3].NNodesByEdge = 10;\n')
        fhl.write('Field[3].EdgesList = {e1()};\n')
        fhl.write('Field[4] = Threshold;\n')
        fhl.write('Field[4].IField = 2;\n')
        fhl.write('Field[4].LcMin = esize;\n')
        fhl.write('Field[4].LcMax = csize;\n')
        fhl.write('Field[4].DistMin = 0;\n')
        fhl.write('Field[4].DistMax = 3*csize;\n')
        fhl.write('Field[5] = Min;\n')
        fhl.write('Field[5].FieldsList = {2, 4};' + '\n')
        fhl.write('Background Field = 5;\n')
        fhl.write('Mesh.CharacteristicLengthExtendFromBoundary = 0;\n')
