コード例 #1
0
ファイル: amr.c プロジェクト: ahota/visit_intel
visit_handle
SimGetMetaData(void *cbdata)
{
    visit_handle md = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    /* Create metadata. */
    if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
    {
        int i;
        visit_handle mmd = VISIT_INVALID_HANDLE;

        /* Set the simulation state. */
        VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
            VISIT_SIMMODE_STOPPED : VISIT_SIMMODE_RUNNING);
        VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time);

        /* Set the first mesh's properties.*/
        if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY)
        {
            /* Vary the number of patches based on the cycle so we can test
             * AMR SILs that change over time.
             */
            int iter = (sim->cycle % 2);

            /* Set the mesh's properties.*/
            VisIt_MeshMetaData_setName(mmd, "amr");
            VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_AMR);
            VisIt_MeshMetaData_setTopologicalDimension(mmd, 2);
            VisIt_MeshMetaData_setSpatialDimension(mmd, 2);
            VisIt_MeshMetaData_setNumDomains(mmd, npatches[iter]);
            VisIt_MeshMetaData_setDomainTitle(mmd, "Patches");
            VisIt_MeshMetaData_setDomainPieceName(mmd, "patch");
            VisIt_MeshMetaData_setNumGroups(mmd, nlevels[iter]);
            VisIt_MeshMetaData_setGroupTitle(mmd, "Levels");
            VisIt_MeshMetaData_setGroupPieceName(mmd, "level");
            for(i = 0; i < npatches[iter]; ++i)
                VisIt_MeshMetaData_addGroupId(mmd, level[i]);
            VisIt_MeshMetaData_setXUnits(mmd, "cm");
            VisIt_MeshMetaData_setYUnits(mmd, "cm");
            VisIt_MeshMetaData_setXLabel(mmd, "Width");
            VisIt_MeshMetaData_setYLabel(mmd, "Height");

            VisIt_SimulationMetaData_addMesh(md, mmd);
        }

        /* Add some custom commands. */
        for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
        {
            visit_handle cmd = VISIT_INVALID_HANDLE;
            if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
            {
                VisIt_CommandMetaData_setName(cmd, cmd_names[i]);
                VisIt_SimulationMetaData_addGenericCommand(md, cmd);
            }
        }
    }

    return md;
}
コード例 #2
0
ファイル: ucdcurve.c プロジェクト: ahota/visit_intel
visit_handle
SimGetMetaData(void *cbdata)
{
    visit_handle md = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    /* Create metadata. */
    if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
    {
        int i;
        visit_handle mmd = VISIT_INVALID_HANDLE;
        visit_handle vmd = VISIT_INVALID_HANDLE;
        visit_handle cmd = VISIT_INVALID_HANDLE;
        visit_handle emd = VISIT_INVALID_HANDLE;

        /* Set the simulation state. */
        VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
            VISIT_SIMMODE_STOPPED : VISIT_SIMMODE_RUNNING);
        VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time);

        /* Add mesh metadata. */
        if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY)
        {
            /* Set the mesh's properties.*/
            VisIt_MeshMetaData_setName(mmd, "mesh1d");
            VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_UNSTRUCTURED);
            VisIt_MeshMetaData_setTopologicalDimension(mmd, 1);
            VisIt_MeshMetaData_setSpatialDimension(mmd, 2);
            VisIt_MeshMetaData_setNumDomains(mmd, sim->par_size);
            VisIt_MeshMetaData_setDomainTitle(mmd, "Domains");
            VisIt_MeshMetaData_setDomainPieceName(mmd, "domain");
            VisIt_MeshMetaData_setNumGroups(mmd, 0);
            VisIt_MeshMetaData_setXUnits(mmd, "cm");
            VisIt_MeshMetaData_setYUnits(mmd, "cm");
            VisIt_MeshMetaData_setXLabel(mmd, "Width");
            VisIt_MeshMetaData_setYLabel(mmd, "Height");

            VisIt_SimulationMetaData_addMesh(md, mmd);
        }

        /* Add variables. */
        if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY)
        {
            VisIt_VariableMetaData_setName(vmd, "zonal");
            VisIt_VariableMetaData_setMeshName(vmd, "mesh1d");
            VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR);
            VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE);

            VisIt_SimulationMetaData_addVariable(md, vmd);
        }

        if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY)
        {
            VisIt_VariableMetaData_setName(vmd, "nodal");
            VisIt_VariableMetaData_setMeshName(vmd, "mesh1d");
            VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR);
            VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE);

            VisIt_SimulationMetaData_addVariable(md, vmd);
        }
            
        /* Add some commands. */
        for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
        {
            visit_handle cmd = VISIT_INVALID_HANDLE;
            if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
            {
                VisIt_CommandMetaData_setName(cmd, cmd_names[i]);
                VisIt_SimulationMetaData_addGenericCommand(md, cmd);
            }
        }
    }

    return md;
}
コード例 #3
0
ファイル: zerocopy.c プロジェクト: burlen/visit_vtk_7_src
visit_handle
SimGetMetaData(void *cbdata)
{
    visit_handle md = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;

    /* Create metadata. */
    if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
    {
        int i,j;
        visit_handle mmd = VISIT_INVALID_HANDLE;
        visit_handle vmd = VISIT_INVALID_HANDLE;

        /* Set the simulation state. */
        VisIt_SimulationMetaData_setMode(md, VISIT_SIMMODE_RUNNING);
        VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time);

        for(i = 0; i < sizeof(meshes)/sizeof(const char*); ++i)
        {
            /* Add mesh metadata. */
            if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY)
            {
                /* Set the mesh's properties.*/
                VisIt_MeshMetaData_setName(mmd, meshes[i]);
                VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_CURVILINEAR);
                VisIt_MeshMetaData_setTopologicalDimension(mmd, 3);
                VisIt_MeshMetaData_setSpatialDimension(mmd, 3);
                VisIt_MeshMetaData_setNumDomains(mmd, sim->par_size);
                VisIt_MeshMetaData_setDomainTitle(mmd, "Domains");
                VisIt_MeshMetaData_setDomainPieceName(mmd, "domain");
                VisIt_MeshMetaData_setNumGroups(mmd, 0);
                VisIt_MeshMetaData_setXUnits(mmd, "cm");
                VisIt_MeshMetaData_setYUnits(mmd, "cm");
                VisIt_MeshMetaData_setZUnits(mmd, "cm");
                VisIt_MeshMetaData_setXLabel(mmd, "Width");
                VisIt_MeshMetaData_setYLabel(mmd, "Height");
                VisIt_MeshMetaData_setZLabel(mmd, "Depth");

                VisIt_SimulationMetaData_addMesh(md, mmd);
            }

            /* Add scalars. */
            for(j = 0; j < sizeof(scalars)/sizeof(const char*); ++j)
            {
                if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY)
                {
                    char varname[100];
                    sprintf(varname, "%s/%s", meshes[i], scalars[j]);

                    VisIt_VariableMetaData_setName(vmd, varname);
                    VisIt_VariableMetaData_setMeshName(vmd, meshes[i]);
                    VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR);
                    VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE);
                    VisIt_SimulationMetaData_addVariable(md, vmd);
                }
            }

            /* Add vectors. */
            for(j = 0; j < sizeof(vectors)/sizeof(const char*); ++j)
            {
                if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY)
                {
                    char varname[100];
                    sprintf(varname, "%s/%s", meshes[i], vectors[j]);

                    VisIt_VariableMetaData_setName(vmd, varname);
                    VisIt_VariableMetaData_setMeshName(vmd, meshes[i]);
                    VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_VECTOR);
                    VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE);
                    VisIt_SimulationMetaData_addVariable(md, vmd);
                }
            }
        }

        /* Add some commands. */
        for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
        {
            visit_handle cmd = VISIT_INVALID_HANDLE;
            if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
            {
                VisIt_CommandMetaData_setName(cmd, cmd_names[i]);
                VisIt_SimulationMetaData_addGenericCommand(md, cmd);
            }
        }
    }

    return md;
}
コード例 #4
0
ファイル: stubs.c プロジェクト: ybouret/iics
/******************************************************************************
 *
 * Purpose: This callback function returns simulation metadata.
 *
 *****************************************************************************/
visit_handle
SimGetMetaData(void *cbdata)
{
    visit_handle md = VISIT_INVALID_HANDLE;
    simulation_data *sim = (simulation_data *)cbdata;
    
    /* Create metadata. */
    if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
    {
        indx_t i;
        visit_handle mmd = VISIT_INVALID_HANDLE;
        visit_handle vmd = VISIT_INVALID_HANDLE;
        // visit_handle cmd = VISIT_INVALID_HANDLE;
        // visit_handle emd = VISIT_INVALID_HANDLE;
        
        /* Set the simulation state. */
        VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
                                         VISIT_SIMMODE_STOPPED : VISIT_SIMMODE_RUNNING);
        VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time);
        
        /* Add mesh metadata. */
        if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY)
        {
            /* Set the mesh's properties.*/
            VisIt_MeshMetaData_setName(mmd, "quadmesh");
            VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_RECTILINEAR);
            VisIt_MeshMetaData_setTopologicalDimension(mmd, 3);
            VisIt_MeshMetaData_setSpatialDimension(mmd, 3);
            VisIt_MeshMetaData_setNumDomains(mmd, sim->par_size);
            VisIt_MeshMetaData_setDomainTitle(mmd, "Domains");
            VisIt_MeshMetaData_setDomainPieceName(mmd, "domain");
            VisIt_MeshMetaData_setNumGroups(mmd, 0);
            /*   VisIt_MeshMetaData_setXUnits(mmd, "cm");
             VisIt_MeshMetaData_setYUnits(mmd, "cm");
             VisIt_MeshMetaData_setZUnits(mmd, "cm");
             VisIt_MeshMetaData_setXLabel(mmd, "Width");
             VisIt_MeshMetaData_setYLabel(mmd, "Height");
             VisIt_MeshMetaData_setZLabel(mmd, "Depth");
             */
            VisIt_SimulationMetaData_addMesh(md, mmd);
            
        }
        
        /* Add a variable. */
        if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY)
        {
            VisIt_VariableMetaData_setName(vmd, "u");
            VisIt_VariableMetaData_setMeshName(vmd, "quadmesh");
            VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR);
            // for zonal description
            //VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE);
            //for nodal description
            VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE);
            
            VisIt_SimulationMetaData_addVariable(md, vmd);
        }
        
        
        /* Add an expression.
         if(VisIt_ExpressionMetaData_alloc(&emd) == VISIT_OKAY)
         {
         VisIt_ExpressionMetaData_setName(emd, "zvec");
         VisIt_ExpressionMetaData_setDefinition(emd, "{zonal, zonal}");
         VisIt_ExpressionMetaData_setType(emd, VISIT_VARTYPE_VECTOR);
         
         VisIt_SimulationMetaData_addExpression(md, emd);
         }
         */
        /* Add some commands. */
        for(i = 0; i < (indx_t) (sizeof(cmd_names)/sizeof(const char *)); ++i)
        {
            visit_handle cmd = VISIT_INVALID_HANDLE;
            if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
            {
                VisIt_CommandMetaData_setName(cmd, cmd_names[i]);
                VisIt_SimulationMetaData_addGenericCommand(md, cmd);
            }
        }
    }
    
    return md;
}
コード例 #5
0
visit_handle
SimGetMetaData(void *cbdata)
{
    visit_handle md = VISIT_INVALID_HANDLE;
    const char *meshNames[] = {
        "curv2d_static_float", "curv2d_static_double", 
        "curv2d_dynamic_float", "curv2d_dynamic_double",
        "curv3d_static_float", "curv3d_static_double", 
        "curv3d_dynamic_float", "curv3d_dynamic_double",

        "point2d_static_float", "point2d_static_double", 
        "point2d_dynamic_float", "point2d_dynamic_double",
        "point3d_static_float", "point3d_static_double", 
        "point3d_dynamic_float", "point3d_dynamic_double",

        "ucd2d_static_float", "ucd2d_static_double", 
        "ucd2d_dynamic_float", "ucd2d_dynamic_double",
        "ucd3d_static_float", "ucd3d_static_double", 
        "ucd3d_dynamic_float", "ucd3d_dynamic_double"
    };
    const int meshTypes[] = {
        VISIT_MESHTYPE_CURVILINEAR,  VISIT_MESHTYPE_CURVILINEAR,
        VISIT_MESHTYPE_CURVILINEAR,  VISIT_MESHTYPE_CURVILINEAR,
        VISIT_MESHTYPE_CURVILINEAR,  VISIT_MESHTYPE_CURVILINEAR,
        VISIT_MESHTYPE_CURVILINEAR,  VISIT_MESHTYPE_CURVILINEAR,

        VISIT_MESHTYPE_POINT,        VISIT_MESHTYPE_POINT,
        VISIT_MESHTYPE_POINT,        VISIT_MESHTYPE_POINT,
        VISIT_MESHTYPE_POINT,        VISIT_MESHTYPE_POINT,
        VISIT_MESHTYPE_POINT,        VISIT_MESHTYPE_POINT,

        VISIT_MESHTYPE_UNSTRUCTURED, VISIT_MESHTYPE_UNSTRUCTURED,
        VISIT_MESHTYPE_UNSTRUCTURED, VISIT_MESHTYPE_UNSTRUCTURED,
        VISIT_MESHTYPE_UNSTRUCTURED, VISIT_MESHTYPE_UNSTRUCTURED,
        VISIT_MESHTYPE_UNSTRUCTURED, VISIT_MESHTYPE_UNSTRUCTURED
    };
    const int dims[] = {
        2,2,2,2,3,3,3,3,
        2,2,2,2,3,3,3,3,
        2,2,2,2,3,3,3,3
    };
    simulation_data *sim = (simulation_data *)cbdata;

    /* Create metadata. */
    if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY)
    {
        int i;
        visit_handle cmd = VISIT_INVALID_HANDLE;

        /* Set the simulation state. */
        VisIt_SimulationMetaData_setMode(md, (sim->runMode == SIM_STOPPED) ?
            VISIT_SIMMODE_STOPPED : VISIT_SIMMODE_RUNNING);
        VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time);

        /* Add mesh metadata. */
        for(i = 0; i < 24; ++i)
        {
            visit_handle mmd = VISIT_INVALID_HANDLE;
            if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY)
            {
                /* Set the mesh's properties.*/
                VisIt_MeshMetaData_setName(mmd, meshNames[i]);
                VisIt_MeshMetaData_setMeshType(mmd, meshTypes[i]);
                VisIt_MeshMetaData_setTopologicalDimension(mmd, dims[i]);
                VisIt_MeshMetaData_setSpatialDimension(mmd, dims[i]);
                VisIt_MeshMetaData_setNumDomains(mmd, 1);
                VisIt_MeshMetaData_setDomainTitle(mmd, "Domains");
                VisIt_MeshMetaData_setDomainPieceName(mmd, "domain");
                VisIt_MeshMetaData_setNumGroups(mmd, 0);
                VisIt_MeshMetaData_setXUnits(mmd, "cm");
                VisIt_MeshMetaData_setYUnits(mmd, "cm");
                VisIt_MeshMetaData_setZUnits(mmd, "cm");
                VisIt_MeshMetaData_setXLabel(mmd, "Width");
                VisIt_MeshMetaData_setYLabel(mmd, "Height");
                VisIt_MeshMetaData_setZLabel(mmd, "Depth");

                VisIt_SimulationMetaData_addMesh(md, mmd);
            }
        }
            
        /* Add some commands. */
        for(i = 0; i < sizeof(cmd_names)/sizeof(const char *); ++i)
        {
            visit_handle cmd = VISIT_INVALID_HANDLE;
            if(VisIt_CommandMetaData_alloc(&cmd) == VISIT_OKAY)
            {
                VisIt_CommandMetaData_setName(cmd, cmd_names[i]);
                VisIt_SimulationMetaData_addGenericCommand(md, cmd);
            }
        }
    }

    return md;
}