Exemplo n.º 1
0
int
main(int argc, char *argv[])
{
    int driver = DB_PDB;
    DBfile *dbfile = NULL;

    // Look through command line args.
    for(int j = 1; j < argc; ++j)
    {
        if (strcmp(argv[j], "-driver") == 0)
        {
            j++;

            if (strcmp(argv[j], "DB_HDF5") == 0)
                driver = DB_HDF5;
            else if (strcmp(argv[j], "DB_PDB") == 0)
                driver = DB_PDB;
            else
            {
               fprintf(stderr,"Uncrecognized driver name \"%s\"\n",
                   argv[j]);
            }
        }
    }

    /* Open the Silo file */
    dbfile = DBCreate("meshorigin.silo", DB_CLOBBER, DB_LOCAL,
        "Many mesh types with different cell/node offsets", driver);
    if(dbfile == NULL)
    {
        fprintf(stderr, "Could not create Silo file!\n");
        return -1;
    }

    /* Add other Silo calls here. */
    write_point3d(dbfile, "pointmesh0", 0);
    write_point3d(dbfile, "pointmesh1", 1);

    write_rect3d(dbfile, "rectmesh0", 0);
    write_rect3d(dbfile, "rectmesh1", 1);

    write_curv3d(dbfile, "curvemesh0", 0);
    write_curv3d(dbfile, "curvemesh1", 1);

    write_ucd3d(dbfile, "ucdmesh0", 0);
    write_ucd3d(dbfile, "ucdmesh1", 1);

    /* Close the Silo file. */
    DBClose(dbfile);
    return 0;
}
Exemplo n.º 2
0
int
main(int argc, char *argv[])
{
    DBfile *dbfile = NULL;
    /* Open the Silo file */
    dbfile = DBCreate("ucd3d.silo", DB_CLOBBER, DB_LOCAL,
        "Unstructured 3d mesh", DB_HDF5);
    if(dbfile == NULL)
    {
        fprintf(stderr, "Could not create Silo file!\n");
        return -1;
    }

    /* Add other Silo calls here. */
    write_ucd3d(dbfile);

    /* Close the Silo file. */
    DBClose(dbfile);
    return 0;
}