How to use the meshio.xdmf.write function in meshio

To help you get started, we’ve selected a few meshio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / meshio / test / test_xdmf.py View on Github external
def write(*args, **kwargs):
        return meshio.xdmf.write(*args, data_format="HDF", compression="gzip", **kwargs)
github nschloe / meshio / test / performance.py View on Github external
            lambda f, m: meshio.xdmf.write(f, m, data_format="HDF", compression="gzip"),
            meshio.xdmf.read,
github nschloe / meshio / test / test_xdmf.py View on Github external
def write(*args, **kwargs):
        return meshio.xdmf.write(*args, data_format=data_format, **kwargs)
github nschloe / meshio / meshio / _cli / _compress.py View on Github external
elif fmt == "med":
        med.write(
            args.infile, mesh, compression="gzip", compression_opts=9 if args.max else 4
        )
    elif fmt == "ply":
        ply.write(args.infile, mesh, binary=True)
    elif fmt == "stl":
        stl.write(args.infile, mesh, binary=True)
    elif fmt == "vtk":
        vtk.write(args.infile, mesh, binary=True)
    elif fmt == "vtu":
        vtu.write(
            args.infile, mesh, binary=True, compression="lzma" if args.max else "zlib"
        )
    elif fmt == "xdmf":
        xdmf.write(
            args.infile,
            mesh,
            data_format="HDF",
            compression="gzip",
            compression_opts=9 if args.max else 4,
        )
    else:
        print("Don't know how to compress {}.".format(args.infile))
        exit(1)

    size = os.stat(args.infile).st_size
    print("File size after:  {:.2f} MB".format(size / 1024 ** 2))
github nschloe / meshio / meshio / _cli / _ascii.py View on Github external
elif fmt == "flac3d":
        flac3d.write(args.infile, mesh, binary=False)
    elif fmt == "gmsh":
        gmsh.write(args.infile, mesh, binary=False)
    elif fmt == "mdpa":
        mdpa.write(args.infile, mesh, binary=False)
    elif fmt == "ply":
        ply.write(args.infile, mesh, binary=False)
    elif fmt == "stl":
        stl.write(args.infile, mesh, binary=False)
    elif fmt == "vtk":
        vtk.write(args.infile, mesh, binary=False)
    elif fmt == "vtu":
        vtu.write(args.infile, mesh, binary=False)
    elif fmt == "xdmf":
        xdmf.write(args.infile, mesh, data_format="XML")
    else:
        print("Don't know how to convert {} to ASCII format.".format(args.infile))
        exit(1)

    size = os.stat(args.infile).st_size
    print("File size after:  {:.2f} MB".format(size / 1024 ** 2))