Exemple #1
0
visit_handle
SimGetMesh(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    if(strcmp(name, "mesh1d") == 0)
    {
        if(VisIt_UnstructuredMesh_alloc(&h) != VISIT_ERROR)
        {
            visit_handle x,y,conn;
            int nzones;

            nzones = sim->npts-1;
            VisIt_VariableData_alloc(&x);
            VisIt_VariableData_alloc(&y);
            VisIt_VariableData_setDataF(x, VISIT_OWNER_SIM, 1, sim->npts, sim->x);
            VisIt_VariableData_setDataF(y, VISIT_OWNER_SIM, 1, sim->npts, sim->y);

            VisIt_VariableData_alloc(&conn);
            VisIt_VariableData_setDataI(conn, VISIT_OWNER_SIM, 1, 
                3*nzones, sim->conn);

            VisIt_UnstructuredMesh_setCoordsXY(h, x, y);
            VisIt_UnstructuredMesh_setConnectivity(h, nzones, conn);
        }
    }

    return h;
}
Exemple #2
0
visit_handle
SimGetMesh(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;

    if(strcmp(name, "unstructured3d") == 0)
    {
        if(VisIt_UnstructuredMesh_alloc(&h) != VISIT_ERROR)
        {
            visit_handle x,y,z,conn;

            VisIt_VariableData_alloc(&x);
            VisIt_VariableData_alloc(&y);
            VisIt_VariableData_alloc(&z);
            VisIt_VariableData_setDataD(x, VISIT_OWNER_SIM, 1, umnnodes, umx);
            VisIt_VariableData_setDataD(y, VISIT_OWNER_SIM, 1, umnnodes, umy);
            VisIt_VariableData_setDataD(z, VISIT_OWNER_SIM, 1, umnnodes, umz);

            VisIt_VariableData_alloc(&conn);
            VisIt_VariableData_setDataI(conn, VISIT_OWNER_SIM, 1, 
                lconnectivity, connectivity);

            VisIt_UnstructuredMesh_setCoordsXYZ(h, x, y, z);
            VisIt_UnstructuredMesh_setConnectivity(h, umnzones, conn);
        }
    }

    return h;
}
Exemple #3
0
visit_handle
SimGetDomainList(const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    if(VisIt_DomainList_alloc(&h) != VISIT_ERROR)
    {
        visit_handle hdl;
        int i, *iptr = NULL, dcount = 0;
        int ndoms = 9;
        simulation_data *sim = (simulation_data *)cbdata;

        iptr = (int *)malloc(ndoms * sizeof(int));
        memset(iptr, 0, ndoms * sizeof(int));

        for(i = 0; i < ndoms; i++)
        {
            int owner_of_domain = i % sim->par_size;
            if(sim->par_rank == owner_of_domain)
                iptr[dcount++] = i;
        }

        VisIt_VariableData_alloc(&hdl);
        VisIt_VariableData_setDataI(hdl, VISIT_OWNER_VISIT, 1, dcount, iptr);
        VisIt_DomainList_setDomains(h, dcount, hdl);
    }
    return h;
}
Exemple #4
0
visit_handle
SimGetMesh(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;

    if(strcmp(name, "mesh2d") == 0)
    {
        if(VisIt_RectilinearMesh_alloc(&h) == VISIT_OKAY)
        {
            int i;
            visit_handle x,y;

            /* Initialize X coords. */
            for(i = 0; i < NX; ++i)
            {
                float t = (float)i / (float)(NX-1);
                rmesh_x[i] = (1.f-t)*XMIN + t*XMAX;
            }
            /* Initialize Y coords. */
            for(i = 0; i < NY; ++i) 
            {
                float t = (float)i / (float)(NY-1);
                rmesh_y[i] = (1.f-t)*YMIN + t*YMAX;
            }

            VisIt_VariableData_alloc(&x);
            VisIt_VariableData_alloc(&y);
            VisIt_VariableData_setDataF(x, VISIT_OWNER_SIM, 1, NX, rmesh_x);
            VisIt_VariableData_setDataF(y, VISIT_OWNER_SIM, 1, NY, rmesh_y);
            VisIt_RectilinearMesh_setCoordsXY(h, x, y);
        }
    }
    else if(strcmp(name, "ucdmesh") == 0)
    {
        visit_handle c, hc;
        if(VisIt_UnstructuredMesh_alloc(&h) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&c) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&hc) == VISIT_OKAY)
        {
            int nnodes, nzones;
            nnodes = (NX * NY);
            nzones = (NX-1)*(NY-1);
            VisIt_VariableData_setDataF(c, VISIT_OWNER_SIM, 2, nnodes, (float*)coords2d);
            VisIt_VariableData_setDataI(hc, VISIT_OWNER_SIM, 1, 5*nzones,
                connectivity);
            VisIt_UnstructuredMesh_setCoords(h, c);
            VisIt_UnstructuredMesh_setConnectivity(h, nzones, hc);
        }
    }

    return h;
}
Exemple #5
0
visit_handle
SimGetDomainList(const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    if(VisIt_DomainList_alloc(&h) != VISIT_ERROR)
    {
        visit_handle hdl;
        int *iptr = NULL;
        simulation_data *sim = (simulation_data *)cbdata;

        iptr = (int *)malloc(sizeof(int));
        *iptr = sim->par_rank;

        VisIt_VariableData_alloc(&hdl);
        VisIt_VariableData_setDataI(hdl, VISIT_OWNER_VISIT, 1, 1, iptr);
        VisIt_DomainList_setDomains(h, sim->par_size, hdl);
    }
    return h;
}
Exemple #6
0
visit_handle
SimGetDomainList(const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    if(VisIt_DomainList_alloc(&h) != VISIT_ERROR)
    {
        visit_handle hdl;
        int i, *iptr = NULL;
        simulation_data *sim = (simulation_data *)cbdata;

        iptr = (int *)malloc(sizeof(int) * sim->nDomains);
        for(i = 0; i < sim->nDomains; ++i)
            iptr[i] = sim->domains[i].globalIndex;

        VisIt_VariableData_alloc(&hdl);
        VisIt_VariableData_setDataI(hdl, VISIT_OWNER_VISIT, 1, sim->nDomains, iptr);
        VisIt_DomainList_setDomains(h, sim->nTotalDomains, hdl);
    }
    return h;
}
Exemple #7
0
visit_handle
SimGetDomainList(const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    if(VisIt_DomainList_alloc(&h) != VISIT_ERROR)
    {
        visit_handle hdl;
        int *iptr = NULL, i, nTuples = 0;
        simulation_data *sim = (simulation_data *)cbdata;

        iptr = (int *)malloc(sizeof(int) * NDOMAINS);
        for(i = 0; i < NDOMAINS; ++i)
        {
            if(i % sim->par_size == sim->par_rank)
                iptr[nTuples++] = i;
        }

        VisIt_VariableData_alloc(&hdl);
        VisIt_VariableData_setDataI(hdl, VISIT_OWNER_VISIT, 1, nTuples, iptr);
        VisIt_DomainList_setDomains(h, NDOMAINS, hdl);
    }
    return h;
}
Exemple #8
0
visit_handle
SimGetMaterial(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;

    /* Allocate a VisIt_MaterialData */
    VisIt_MaterialData_alloc(&h);
    if(strcmp(name, "Material") == 0)
    {
        int i, j, m, cell = 0, arrlen = 0;
        int nmats, cellmat[10], matnos[3]={1,2,3};
        float cellmatvf[10];

        /* The matlist table indicates the material numbers that are found in
         * each cell. Every 3 numbers indicates the material numbers in a cell.
         * A material number of 0 means that the material entry is not used.
         */
        int matlist[NY-1][NX-1][3] = {
            {{3,0,0},{2,3,0},{1,2,0},{1,0,0}},
            {{3,0,0},{2,3,0},{1,2,0},{1,0,0}},
            {{3,0,0},{2,3,0},{1,2,3},{1,2,0}}
        };

        /* The mat_vf table indicates the material volume fractions that are
         * found in a cell.
         */
        float mat_vf[NY-1][NX-1][3] = {
            {{1.,0.,0.},{0.75,0.25,0.},  {0.8125,0.1875, 0.},{1.,0.,0.}},
            {{1.,0.,0.},{0.625,0.375,0.},{0.5625,0.4375,0.}, {1.,0.,0.}},
            {{1.,0.,0.},{0.3,0.7,0.},    {0.2,0.4,0.4},      {0.55,0.45,0.}}
        };

        /* Tell the object we'll be adding cells to it using add*Cell functions */
        VisIt_MaterialData_appendCells(h, (NX-1)*(NY-1));

        /* Fill in the VisIt_MaterialData */
        VisIt_MaterialData_addMaterial(h, matNames[0], &matnos[0]);
        VisIt_MaterialData_addMaterial(h, matNames[1], &matnos[1]);
        VisIt_MaterialData_addMaterial(h, matNames[2], &matnos[2]);

        for(j = 0; j < NY-1; ++j)
        {
            for(i = 0; i < NX-1; ++i, ++cell)
            {
                nmats = 0;
                for(m = 0; m < 3; ++m)
                {
                    if(matlist[j][i][m] > 0)
                    {
                        cellmat[nmats] = matnos[matlist[j][i][m] - 1];
                        cellmatvf[nmats] = mat_vf[j][i][m];
                        nmats++;
                    }
                }        
                if(nmats > 1)
                    VisIt_MaterialData_addMixedCell(h, cell, cellmat, cellmatvf, nmats);
                else
                    VisIt_MaterialData_addCleanCell(h, cell, cellmat[0]);
            }
        }
    }
    else if(strcmp(name, "MaterialFromArrays") == 0)
    {
        int nTuples, matnos[] = {11,22,33};
        visit_handle hmatlist, hmix_zone, hmix_mat, hmix_vf, hmix_next;
      
        /* Fill in the VisIt_MaterialData using arrays encode the material. */
        VisIt_MaterialData_addMaterial(h, matNames[0], &matnos[0]);
        VisIt_MaterialData_addMaterial(h, matNames[1], &matnos[1]);
        VisIt_MaterialData_addMaterial(h, matNames[2], &matnos[2]);

        VisIt_VariableData_alloc(&hmatlist);
        VisIt_VariableData_setDataI(hmatlist, VISIT_OWNER_SIM, 1, (NX-1)*(NY-1), matlist);
        VisIt_MaterialData_setMaterials(h, hmatlist);

        nTuples = sizeof(mix_zone) / sizeof(int);
        VisIt_VariableData_alloc(&hmix_zone);
        VisIt_VariableData_setDataI(hmix_zone, VISIT_OWNER_SIM, 1, nTuples, mix_zone);

        VisIt_VariableData_alloc(&hmix_mat);
        VisIt_VariableData_setDataI(hmix_mat, VISIT_OWNER_SIM, 1, nTuples, mix_mat);

        VisIt_VariableData_alloc(&hmix_vf);
        VisIt_VariableData_setDataD(hmix_vf, VISIT_OWNER_SIM, 1, nTuples, mix_vf);

        VisIt_VariableData_alloc(&hmix_next);
        VisIt_VariableData_setDataI(hmix_next, VISIT_OWNER_SIM, 1, nTuples, mix_next);

        VisIt_MaterialData_setMixedMaterials(h, hmix_mat, hmix_zone, hmix_next, hmix_vf);
    }

    return h;
}
Exemple #9
0
visit_handle
SimGetVariable(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    if(strncmp(name, "aos", 3) == 0)
    {
        int nnodes, owner;
        owner = (strcmp(name, "aos_c") == 0) ? VISIT_OWNER_COPY : VISIT_OWNER_SIM;
        nnodes = sim->aos.nnodes;
        /* Use setDataArray functions to set up strided array access. */
        VisIt_VariableData_alloc(&h);
        if(strcmp(name+6, "temperature") == 0)
            serror(VisIt_VariableData_setArrayDataF(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].temperature)));
        else if(strcmp(name+6, "vx") == 0)
            serror(VisIt_VariableData_setArrayDataD(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vx)));
        else if(strcmp(name+6, "vy") == 0)
            serror(VisIt_VariableData_setArrayDataD(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vy)));
        else if(strcmp(name+6, "vz") == 0)
            serror(VisIt_VariableData_setArrayDataD(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vz)));
        else if(strcmp(name+6, "I") == 0)
            serror(VisIt_VariableData_setArrayDataI(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].I)));
        else if(strcmp(name+6, "J") == 0)
            serror(VisIt_VariableData_setArrayDataI(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].J)));
        else if(strcmp(name+6, "K") == 0)
            serror(VisIt_VariableData_setArrayDataI(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].K)));
        else if(strcmp(name+6, "velocity") == 0)
        {
            /* Combine separate strided array access into a vector. */
            serror(VisIt_VariableData_setArrayDataD(h, 0, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vx)));
            serror(VisIt_VariableData_setArrayDataD(h, 1, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vy)));
            serror(VisIt_VariableData_setArrayDataD(h, 2, owner, nnodes, 0, sizeof(Node), &(sim->aos.nodes[0].vz)));
        }
    }
    else if(strncmp(name, "soa", 3) == 0)
    {
        int nnodes = sim->soa.nnodes;
        /* Use setData functions to set up contiguous array access. */
        VisIt_VariableData_alloc(&h);
        if(strcmp(name+6, "temperature") == 0)
            serror(VisIt_VariableData_setDataF(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.temperature));
        else if(strcmp(name+6, "vx") == 0)
            serror(VisIt_VariableData_setDataD(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.vx));
        else if(strcmp(name+6, "vy") == 0)
            serror(VisIt_VariableData_setDataD(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.vy));
        else if(strcmp(name+6, "vz") == 0)
            serror(VisIt_VariableData_setDataD(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.vz));
        else if(strcmp(name+6, "I") == 0)
            serror(VisIt_VariableData_setDataI(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.I));
        else if(strcmp(name+6, "J") == 0)
            serror(VisIt_VariableData_setDataI(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.J));
        else if(strcmp(name+6, "K") == 0)
            serror(VisIt_VariableData_setDataI(h, VISIT_OWNER_SIM, 1, nnodes, sim->soa.K));
        else if(strcmp(name+6, "velocity") == 0)
        {
            /* Combine separate contiguous arrays into a vector. */
            serror(VisIt_VariableData_setArrayDataD(h, 0, VISIT_OWNER_SIM, nnodes, 0, sizeof(double), sim->soa.vx));
            serror(VisIt_VariableData_setArrayDataD(h, 1, VISIT_OWNER_SIM, nnodes, 0, sizeof(double), sim->soa.vy));
            serror(VisIt_VariableData_setArrayDataD(h, 2, VISIT_OWNER_SIM, nnodes, 0, sizeof(double), sim->soa.vz));
        }
    }

    return h;
}
Exemple #10
0
visit_handle
SimGetMesh(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    if(strcmp(name, "rect_blank") == 0)
    {
        if(VisIt_RectilinearMesh_alloc(&h) != VISIT_ERROR)
        {
            int ncells;
            visit_handle hx, hy, gc;

            VisIt_VariableData_alloc(&hx);
            VisIt_VariableData_alloc(&hy);
            VisIt_VariableData_setDataF(hx, VISIT_OWNER_SIM, 1, sim->blankRectMesh.dims[0], sim->blankRectMesh.x);
            VisIt_VariableData_setDataF(hy, VISIT_OWNER_SIM, 1, sim->blankRectMesh.dims[1], sim->blankRectMesh.y);
            VisIt_RectilinearMesh_setCoordsXY(h, hx, hy);

            /* Attach ghost cells to blank out certain cells*/
            VisIt_VariableData_alloc(&gc);
            ncells = (sim->blankRectMesh.dims[0]-1) * (sim->blankRectMesh.dims[1]-1);
            VisIt_VariableData_setDataI(gc, VISIT_OWNER_SIM, 1, ncells, sim->blankRectMesh.ghostCells);
            VisIt_RectilinearMesh_setGhostCells(h, gc);
        }
    }
    else if(strcmp(name, "curv_blank") == 0)
    {
        if(VisIt_CurvilinearMesh_alloc(&h) != VISIT_ERROR)
        {
            int ncells, nnodes;
            visit_handle hx, hy, gc;

            nnodes = sim->blankCurvMesh.dims[0] * sim->blankCurvMesh.dims[1];
            ncells = (sim->blankCurvMesh.dims[0]-1) * (sim->blankCurvMesh.dims[1]-1);

            VisIt_VariableData_alloc(&hx);
            VisIt_VariableData_alloc(&hy);
            VisIt_VariableData_setDataF(hx, VISIT_OWNER_SIM, 1, nnodes, sim->blankCurvMesh.x);
            VisIt_VariableData_setDataF(hy, VISIT_OWNER_SIM, 1, nnodes, sim->blankCurvMesh.y);
            VisIt_CurvilinearMesh_setCoordsXY(h, sim->blankCurvMesh.dims, hx, hy);

            /* Attach ghost cells to blank out certain cells*/
            VisIt_VariableData_alloc(&gc);
            VisIt_VariableData_setDataI(gc, VISIT_OWNER_SIM, 1, ncells, sim->blankCurvMesh.ghostCells);
            VisIt_CurvilinearMesh_setGhostCells(h, gc);
        }
    }
    else if(strcmp(name, "ucd_blank") == 0)
    {
        if(VisIt_UnstructuredMesh_alloc(&h) != VISIT_ERROR)
        {
            visit_handle hxyz, hc, gc;

            VisIt_VariableData_alloc(&hxyz);
            VisIt_VariableData_setDataF(hxyz, VISIT_OWNER_SIM, 3, sim->blankUcdMesh.nnodes, sim->blankUcdMesh.xyz);
            VisIt_UnstructuredMesh_setCoords(h, hxyz);

            VisIt_VariableData_alloc(&hc);
            VisIt_VariableData_setDataI(hc, VISIT_OWNER_SIM, 1, sim->blankUcdMesh.connectivityLen,
                sim->blankUcdMesh.connectivity);
            VisIt_UnstructuredMesh_setConnectivity(h, sim->blankUcdMesh.ncells, hc);

            /* Attach ghost cells to blank out certain cells*/
            VisIt_VariableData_alloc(&gc);
            VisIt_VariableData_setDataI(gc, VISIT_OWNER_SIM, 1, sim->blankUcdMesh.ncells, sim->blankUcdMesh.ghostCells);
            VisIt_UnstructuredMesh_setGhostCells(h, gc);
        }
    }
    else if(strncmp(name, "multi_domain", 12) == 0)
    {
        if(VisIt_RectilinearMesh_alloc(&h) != VISIT_ERROR)
        {
            int ncells;
            visit_handle hx, hy, gc;

            VisIt_VariableData_alloc(&hx);
            VisIt_VariableData_alloc(&hy);
            VisIt_VariableData_setDataF(hx, VISIT_OWNER_SIM, 1, sim->multidomain[domain].m.dims[0], sim->multidomain[domain].m.x);
            VisIt_VariableData_setDataF(hy, VISIT_OWNER_SIM, 1, sim->multidomain[domain].m.dims[1], sim->multidomain[domain].m.y);
            VisIt_RectilinearMesh_setCoordsXY(h, hx, hy);

            if(strcmp(name, "multi_domain") == 0)
            {
                /* Do ghost cells using a ghost cells array. */
                VisIt_VariableData_alloc(&gc);
                ncells = (sim->multidomain[domain].m.dims[0]-1) * (sim->multidomain[domain].m.dims[1]-1);
                VisIt_VariableData_setDataI(gc, VISIT_OWNER_SIM, 1, ncells, sim->multidomain[domain].m.ghostCells);
                VisIt_RectilinearMesh_setGhostCells(h, gc);
            }
            else
            {
                /* Do ghost cells using indices. Note: other mesh types can also 
                 * designate ghost cells using indices.
                 */
                VisIt_RectilinearMesh_setRealIndices(h, sim->multidomain[domain].minReal, 
                    sim->multidomain[domain].maxReal);
            }
        }
    }
    else if(strcmp(name, "multi_types") == 0)
    {
        if(domain < 4 && VisIt_RectilinearMesh_alloc(&h) != VISIT_ERROR)
        {
            int ncells;
            visit_handle hx, hy, hz, gc;

            VisIt_VariableData_alloc(&hx);
            VisIt_VariableData_alloc(&hy);
            VisIt_VariableData_alloc(&hz);
            VisIt_VariableData_setDataF(hx, VISIT_OWNER_SIM, 1, sim->multipletypes[domain].dims[0], sim->multipletypes[domain].x);
            VisIt_VariableData_setDataF(hy, VISIT_OWNER_SIM, 1, sim->multipletypes[domain].dims[1], sim->multipletypes[domain].y);
            VisIt_VariableData_setDataF(hz, VISIT_OWNER_SIM, 1, sim->multipletypes[domain].dims[2], sim->multipletypes[domain].z);
            VisIt_RectilinearMesh_setCoordsXYZ(h, hx, hy, hz);

            /* Do ghost cells using a ghost cells array. */
            VisIt_VariableData_alloc(&gc);
            ncells = (sim->multipletypes[domain].dims[0]-1) *
                     (sim->multipletypes[domain].dims[1]-1) *
                     (sim->multipletypes[domain].dims[2]-1);
            VisIt_VariableData_setDataI(gc, VISIT_OWNER_SIM, 1, ncells, sim->multipletypes[domain].ghostCells);
            VisIt_RectilinearMesh_setGhostCells(h, gc);
        }
    }
    return h;
}
Exemple #11
0
visit_handle
SimGetMesh(int domain, const char *name, void *cbdata)
{
    visit_handle h = VISIT_INVALID_HANDLE;
    visit_handle c = VISIT_INVALID_HANDLE;
    int owner = VISIT_OWNER_SIM;
    int dt = VISIT_DATATYPE_FLOAT;

    if(strstr(name, "double") != NULL)
        dt = VISIT_DATATYPE_DOUBLE;
    if(strstr(name, "dynamic") != NULL)
        owner = VISIT_OWNER_VISIT;

    if(strstr(name, "curv") != NULL)
    {
        if(VisIt_CurvilinearMesh_alloc(&h) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&c) == VISIT_OKAY)
        {
            if(strstr(name, "curv2d") != NULL)
            {
                int dims[2];
                dims[0] = NX;
                dims[1] = NY;
                SetData(c, owner, dt, 2, NX*NY, (float*)coords2d);
                VisIt_CurvilinearMesh_setCoords2(h, dims, c);
            }
            else
            {
                int dims[3];
                dims[0] = NX;
                dims[1] = NY;
                dims[2] = NZ;
                SetData(c, owner, dt, 3, NX*NY*NZ, (float*)coords3d);
                VisIt_CurvilinearMesh_setCoords3(h, dims, c);
            }
        }
    }
    else if(strstr(name, "point") != NULL)
    {
        if(VisIt_PointMesh_alloc(&h) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&c) == VISIT_OKAY)
        {
            if(strstr(name, "point2d") != NULL)
                SetData(c, owner, dt, 2, NX*NY, (float*)coords2d);
            else
                SetData(c, owner, dt, 3, NX*NY*NZ, (float*)coords3d);

            VisIt_PointMesh_setCoords(h, c);
        }
    }
    else if(strstr(name, "ucd") != NULL)
    {
        visit_handle hc;
        if(VisIt_UnstructuredMesh_alloc(&h) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&c) == VISIT_OKAY &&
           VisIt_VariableData_alloc(&hc) == VISIT_OKAY)
        {
            int nzones = 0;
            if(strstr(name, "ucd2d") != NULL)
            {
                int i, j, lconnectivity;
                int *connectivity = NULL, *conn = NULL;

                nzones = (NX-1)*(NY-1);
                lconnectivity = 5*nzones;
                conn = connectivity = (int*)malloc(lconnectivity * sizeof(int));
                for(j = 0; j < NY-1; ++j)
                    for(i = 0; i < NX-1; ++i)
                    {
                        *conn++ = VISIT_CELL_QUAD;
                        *conn++ = j*NX + i;
                        *conn++ = j*NX + (i+1);
                        *conn++ = (j+1)*NX + (i+1);
                        *conn++ = (j+1)*NX + i;
                    }
                SetData(c, owner, dt, 2, NX*NY, (float*)coords2d);
                VisIt_VariableData_setDataI(hc, VISIT_OWNER_VISIT, 1, lconnectivity,
                    connectivity);
            }
            else
            {
                int i, j, k, lconnectivity;
                int *connectivity = NULL, *conn = NULL;

                nzones = (NX-1)*(NY-1)*(NZ-1);
                lconnectivity = 9*nzones;
                conn = connectivity = (int*)malloc(lconnectivity * sizeof(int));
                for(k = 0; k < NZ-1; ++k)
                  for(j = 0; j < NY-1; ++j)
                    for(i = 0; i < NX-1; ++i)
                    {
                        *conn++ = VISIT_CELL_HEX;
                        *conn++ = k*NX*NY + j*NX + i;
                        *conn++ = k*NX*NY + j*NX + (i+1);
                        *conn++ = k*NX*NY + (j+1)*NX + (i+1);
                        *conn++ = k*NX*NY + (j+1)*NX + i;
                        *conn++ = (k+1)*NX*NY + j*NX + i;
                        *conn++ = (k+1)*NX*NY + j*NX + (i+1);
                        *conn++ = (k+1)*NX*NY + (j+1)*NX + (i+1);
                        *conn++ = (k+1)*NX*NY + (j+1)*NX + i;
                    }
                SetData(c, owner, dt, 3, NX*NY*NZ, (float*)coords3d);
                VisIt_VariableData_setDataI(hc, VISIT_OWNER_VISIT, 1, lconnectivity,
                    connectivity);
            }

            VisIt_UnstructuredMesh_setCoords(h, c);
            VisIt_UnstructuredMesh_setConnectivity(h, nzones, hc);
        }
    }
    return h;
}