visit_handle SimGetMetaData(void *cbdata) { visit_handle md = VISIT_INVALID_HANDLE; simulation_data *sim = (simulation_data *)cbdata; /* Create metadata with no variables. */ if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY) { visit_handle m1 = VISIT_INVALID_HANDLE; visit_handle m2 = VISIT_INVALID_HANDLE; visit_handle vmd = VISIT_INVALID_HANDLE; visit_handle cmd = VISIT_INVALID_HANDLE; visit_handle mat = VISIT_INVALID_HANDLE; /* Set the simulation state. */ if(sim->runMode == VISIT_SIMMODE_STOPPED) VisIt_SimulationMetaData_setMode(md, VISIT_SIMMODE_STOPPED); else VisIt_SimulationMetaData_setMode(md, VISIT_SIMMODE_RUNNING); VisIt_SimulationMetaData_setCycleTime(md, sim->cycle, sim->time); /* Set the first mesh's properties.*/ if(VisIt_MeshMetaData_alloc(&m1) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(m1, "mesh2d"); VisIt_MeshMetaData_setMeshType(m1, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(m1, 2); VisIt_MeshMetaData_setSpatialDimension(m1, 2); VisIt_MeshMetaData_setXUnits(m1, "cm"); VisIt_MeshMetaData_setYUnits(m1, "cm"); VisIt_MeshMetaData_setXLabel(m1, "Width"); VisIt_MeshMetaData_setYLabel(m1, "Height"); VisIt_SimulationMetaData_addMesh(md, m1); } /* Set the second mesh's properties.*/ if(VisIt_MeshMetaData_alloc(&m2) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(m2, "mesh3d"); VisIt_MeshMetaData_setMeshType(m2, VISIT_MESHTYPE_CURVILINEAR); VisIt_MeshMetaData_setTopologicalDimension(m2, 3); VisIt_MeshMetaData_setSpatialDimension(m2, 3); VisIt_MeshMetaData_setXUnits(m2, "cm"); VisIt_MeshMetaData_setYUnits(m2, "cm"); VisIt_MeshMetaData_setZUnits(m2, "cm"); VisIt_MeshMetaData_setXLabel(m2, "Width"); VisIt_MeshMetaData_setYLabel(m2, "Height"); VisIt_MeshMetaData_setZLabel(m2, "Depth"); VisIt_SimulationMetaData_addMesh(md, m2); } /* Add a zonal scalar variable on mesh2d. */ if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, "zonal"); VisIt_VariableMetaData_setMeshName(vmd, "mesh2d"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE); VisIt_SimulationMetaData_addVariable(md, vmd); } /* Add a nodal scalar variable on mesh3d. */ if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, "nodal"); VisIt_VariableMetaData_setMeshName(vmd, "mesh3d"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE); VisIt_SimulationMetaData_addVariable(md, vmd); } /* Add a curve variable. */ if(VisIt_CurveMetaData_alloc(&cmd) == VISIT_OKAY) { VisIt_CurveMetaData_setName(cmd, "sine"); VisIt_CurveMetaData_setXLabel(cmd, "Angle"); VisIt_CurveMetaData_setXUnits(cmd, "radians"); VisIt_CurveMetaData_setYLabel(cmd, "Amplitude"); VisIt_CurveMetaData_setYUnits(cmd, ""); VisIt_SimulationMetaData_addCurve(md, cmd); } /* Add a material */ if(VisIt_MaterialMetaData_alloc(&mat) == VISIT_OKAY) { VisIt_MaterialMetaData_setName(mat, "mat"); VisIt_MaterialMetaData_setMeshName(mat, "mesh2d"); VisIt_MaterialMetaData_addMaterialName(mat, "Iron"); VisIt_MaterialMetaData_addMaterialName(mat, "Copper"); VisIt_MaterialMetaData_addMaterialName(mat, "Nickel"); VisIt_SimulationMetaData_addMaterial(md, mat); } } return md; }
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; }
/****************************************************************************** * * 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; }
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 m1 = VISIT_INVALID_HANDLE, m2 = VISIT_INVALID_HANDLE; visit_handle vmd = VISIT_INVALID_HANDLE; 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); /* Set the first mesh's properties.*/ if(VisIt_MeshMetaData_alloc(&m1) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(m1, "mesh2d"); VisIt_MeshMetaData_setMeshType(m1, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(m1, 2); VisIt_MeshMetaData_setSpatialDimension(m1, 2); VisIt_MeshMetaData_setXUnits(m1, "cm"); VisIt_MeshMetaData_setYUnits(m1, "cm"); VisIt_MeshMetaData_setXLabel(m1, "Width"); VisIt_MeshMetaData_setYLabel(m1, "Height"); VisIt_SimulationMetaData_addMesh(md, m1); } /* Set the second mesh's properties.*/ if(VisIt_MeshMetaData_alloc(&m2) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(m2, "mesh3d"); VisIt_MeshMetaData_setMeshType(m2, VISIT_MESHTYPE_CURVILINEAR); VisIt_MeshMetaData_setTopologicalDimension(m2, 3); VisIt_MeshMetaData_setSpatialDimension(m2, 3); VisIt_MeshMetaData_setXUnits(m2, "cm"); VisIt_MeshMetaData_setYUnits(m2, "cm"); VisIt_MeshMetaData_setZUnits(m2, "cm"); VisIt_MeshMetaData_setXLabel(m2, "Width"); VisIt_MeshMetaData_setYLabel(m2, "Height"); VisIt_MeshMetaData_setZLabel(m2, "Depth"); VisIt_SimulationMetaData_addMesh(md, m2); } /* Add a zonal scalar variable on mesh2d. */ if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, "zonal"); VisIt_VariableMetaData_setMeshName(vmd, "mesh2d"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE); VisIt_SimulationMetaData_addVariable(md, vmd); } /* Add a nodal scalar variable on mesh3d. */ if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, "nodal"); VisIt_VariableMetaData_setMeshName(vmd, "mesh3d"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_NODE); VisIt_SimulationMetaData_addVariable(md, vmd); } /* 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; }
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; }
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; double extents[6]; 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, "rect_blank"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(mmd, 2); VisIt_MeshMetaData_setSpatialDimension(mmd, 2); VisIt_MeshMetaData_setNumDomains(mmd, 1); VisIt_SimulationMetaData_addMesh(md, mmd); } if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(mmd, "curv_blank"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_CURVILINEAR); VisIt_MeshMetaData_setTopologicalDimension(mmd, 2); VisIt_MeshMetaData_setSpatialDimension(mmd, 2); VisIt_MeshMetaData_setNumDomains(mmd, 1); /* This mesh's coordinates contain bad values for some of cells * that are ghosted out. Set the extents to make it so VisIt * will use these extents rather than looking over the coordinates. */ extents[0] = sim->blankCurvMesh.extents[0]; extents[1] = sim->blankCurvMesh.extents[1]; extents[2] = sim->blankCurvMesh.extents[2]; extents[3] = sim->blankCurvMesh.extents[3]; extents[4] = 0.; extents[5] = 0.; VisIt_MeshMetaData_setSpatialExtents(mmd, extents); VisIt_SimulationMetaData_addMesh(md, mmd); } if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(mmd, "ucd_blank"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_UNSTRUCTURED); VisIt_MeshMetaData_setTopologicalDimension(mmd, 2); VisIt_MeshMetaData_setSpatialDimension(mmd, 2); VisIt_MeshMetaData_setNumDomains(mmd, 1); VisIt_SimulationMetaData_addMesh(md, mmd); } if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(mmd, "multi_domain_index"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(mmd, 2); VisIt_MeshMetaData_setSpatialDimension(mmd, 2); VisIt_MeshMetaData_setNumDomains(mmd, 9); VisIt_SimulationMetaData_addMesh(md, mmd); } if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(mmd, "multi_domain"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(mmd, 2); VisIt_MeshMetaData_setSpatialDimension(mmd, 2); VisIt_MeshMetaData_setNumDomains(mmd, 9); VisIt_SimulationMetaData_addMesh(md, mmd); } if(VisIt_MeshMetaData_alloc(&mmd) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(mmd, "multi_types"); VisIt_MeshMetaData_setMeshType(mmd, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(mmd, 3); VisIt_MeshMetaData_setSpatialDimension(mmd, 3); VisIt_MeshMetaData_setNumDomains(mmd, 4); VisIt_SimulationMetaData_addMesh(md, mmd); } /* Add a variable. */ if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, "rect_var"); VisIt_VariableMetaData_setMeshName(vmd, "rect_blank"); 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, "curv_var"); VisIt_VariableMetaData_setMeshName(vmd, "curv_blank"); 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, "ucd_var"); VisIt_VariableMetaData_setMeshName(vmd, "ucd_blank"); 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, "multi_var"); VisIt_VariableMetaData_setMeshName(vmd, "multi_domain"); 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, "multi_var_index"); VisIt_VariableMetaData_setMeshName(vmd, "multi_domain_index"); 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, "multi_types_var"); VisIt_VariableMetaData_setMeshName(vmd, "multi_types"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE); 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; }
visit_handle SimGetMetaData(void *cbdata) { visit_handle md = VISIT_INVALID_HANDLE; simulation_data *sim = (simulation_data *)cbdata; int f; /* Create metadata. */ if(VisIt_SimulationMetaData_alloc(&md) == VISIT_OKAY) { int i; visit_handle m1 = VISIT_INVALID_HANDLE; visit_handle vmd = VISIT_INVALID_HANDLE; 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); /* Set the first mesh's properties.*/ if(VisIt_MeshMetaData_alloc(&m1) == VISIT_OKAY) { /* Set the mesh's properties.*/ VisIt_MeshMetaData_setName(m1, "mesh"); VisIt_MeshMetaData_setMeshType(m1, VISIT_MESHTYPE_RECTILINEAR); VisIt_MeshMetaData_setTopologicalDimension(m1, 3); VisIt_MeshMetaData_setSpatialDimension(m1, 3); VisIt_MeshMetaData_setNumDomains(m1, sim->par_size); VisIt_MeshMetaData_setXUnits(m1, ""); VisIt_MeshMetaData_setYUnits(m1, ""); VisIt_MeshMetaData_setZUnits(m1, ""); VisIt_MeshMetaData_setXLabel(m1, ""); VisIt_MeshMetaData_setYLabel(m1, ""); VisIt_MeshMetaData_setZLabel(m1, ""); VisIt_SimulationMetaData_addMesh(md, m1); } for(f=0; f < NFIELDS; f++) { char name[8]; sprintf(name,"data%03d", f); if(VisIt_VariableMetaData_alloc(&vmd) == VISIT_OKAY) { VisIt_VariableMetaData_setName(vmd, name); VisIt_VariableMetaData_setMeshName(vmd, "mesh"); VisIt_VariableMetaData_setType(vmd, VISIT_VARTYPE_SCALAR); VisIt_VariableMetaData_setCentering(vmd, VISIT_VARCENTERING_ZONE); VisIt_SimulationMetaData_addVariable(md, vmd); } } /* 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; }