diff --git a/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp b/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp index 736c12b21..0bbb6f6b4 100644 --- a/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp +++ b/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp @@ -474,6 +474,16 @@ void VTKmCellShape(const std::string &shape_type, shape_id = 3; num_indices = 2; } + else if(shape_type == "pyramid") + { + shape_id = 14; + num_indices = 5; + } + else if(shape_type == "wedge") + { + shape_id = 13; + num_indices = 6; + } else { ASCENT_ERROR("Unsupported cell type "< &shapes, indices = 1; dimensionality = 1; } - // TODO: Not supported in blueprint yet ... - // else if(shape_type == "wedge") - // { - // shape_id = 13; - // indices = 6; - // dimensionality = 3; - // } - // else if(shape_type == "pyramid") - // { - // shape_id = 14; - // indices = 5; - // dimensionality = 3; - // } + else if(shape_type == "wedge") + { + shape_id = 13; + indices = 6; + dimensionality = 3; + } + else if(shape_type == "pyramid") + { + shape_id = 14; + indices = 5; + dimensionality = 3; + } else { ASCENT_ERROR("Unsupported element shape " << shape_type); @@ -1880,11 +1889,11 @@ GetBlueprintCellName(vtkm::UInt8 shape_id) } else if(shape_id == vtkm::CELL_SHAPE_WEDGE) { - ASCENT_ERROR("Wedge is not supported in blueprint"); + name = "wedge"; } else if(shape_id == vtkm::CELL_SHAPE_PYRAMID) { - ASCENT_ERROR("Pyramid is not supported in blueprint"); + name = "pyramid"; } return name; } diff --git a/src/tests/_baseline_images/tout_render_3d_pyramid_vert_id100.png b/src/tests/_baseline_images/tout_render_3d_pyramid_vert_id100.png new file mode 100644 index 000000000..0b3962563 Binary files /dev/null and b/src/tests/_baseline_images/tout_render_3d_pyramid_vert_id100.png differ diff --git a/src/tests/_baseline_images/tout_render_3d_wedge_vert_id100.png b/src/tests/_baseline_images/tout_render_3d_wedge_vert_id100.png new file mode 100644 index 000000000..9c7cf85d4 Binary files /dev/null and b/src/tests/_baseline_images/tout_render_3d_wedge_vert_id100.png differ diff --git a/src/tests/ascent/t_ascent_render_3d.cpp b/src/tests/ascent/t_ascent_render_3d.cpp index 21eddc332..a5d399dc5 100644 --- a/src/tests/ascent/t_ascent_render_3d.cpp +++ b/src/tests/ascent/t_ascent_render_3d.cpp @@ -2584,9 +2584,172 @@ TEST(ascent_render_3d, test_render_3d_points_implicit_topo) } +//----------------------------------------------------------------------------- +TEST(ascent_render_3d, test_render_3d_pyra) +{ + // the ascent runtime is currently our only rendering runtime + Node n; + ascent::about(n); + // only run this test if ascent was built with vtkm support + if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled") + { + ASCENT_INFO("Ascent support disabled, skipping 3D default" + "Pipeline test"); + + return; + } + + + Node mesh, info; + mesh["state/cycle"] = 100; + // create the coordinate set + mesh["coordsets/coords/type"] = "explicit"; + mesh["coordsets/coords/values/x"] = {-1.0, 1.0, 1.0, -1.0, 0.0}; + mesh["coordsets/coords/values/y"] = {-1.0, -1.0, 1.0, 1.0, 0.0}; + mesh["coordsets/coords/values/z"] = { 0.0, 0.0, 0.0, 0.0, 1.0}; + // add the topology + + mesh["topologies/topo/type"] = "unstructured"; + mesh["topologies/topo/coordset"] = "coords"; + mesh["topologies/topo/elements/shape"] = "pyramid"; + mesh["topologies/topo/elements/connectivity"].set(DataType::int64(5)); + int64_array con_vals = mesh["topologies/topo/elements/connectivity"].value(); + for(index_t i =0; i < 5; i++) + { + con_vals[i] = i; + } + + mesh["fields/vert_id/topology"] = "topo"; + mesh["fields/vert_id/association"] = "vertex"; + mesh["fields/vert_id/values"].set(DataType::float64(5)); + float64_array vert_id_vals = mesh["fields/vert_id/values"].value(); + for(index_t i =0; i < 5; i++) + { + vert_id_vals[i] = i; + } + + mesh["fields/ele_id/topology"] = "topo"; + mesh["fields/ele_id/association"] = "element"; + mesh["fields/ele_id/values"].set(DataType::float64(1)); + float64_array ele_id_vals = mesh["fields/ele_id/values"].value(); + ele_id_vals[0] = 0; + + string output_path = prepare_output_dir(); + string output_file = conduit::utils::join_file_path(output_path, + "tout_render_3d_pyramid_vert_id"); + // remove old images before rendering + remove_test_image(output_file); + + conduit::Node actions; + conduit::Node &add_plots = actions.append(); + add_plots["action"] = "add_scenes"; + conduit::Node &scenes = add_plots["scenes"]; + scenes["s1/plots/p1/type"] = "pseudocolor"; + scenes["s1/plots/p1/field"] = "vert_id"; + scenes["s1/image_prefix"] = output_file; + + + Ascent ascent; + ascent.open(); + ascent.publish(mesh); + ascent.execute(actions); + ascent.close(); + + EXPECT_TRUE(check_test_image(output_file)); + +} + +//----------------------------------------------------------------------------- +TEST(ascent_render_3d, test_render_3d_wedge) +{ + // the ascent runtime is currently our only rendering runtime + Node n; + ascent::about(n); + // only run this test if ascent was built with vtkm support + if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled") + { + ASCENT_INFO("Ascent support disabled, skipping 3D default" + "Pipeline test"); + + return; + } + + Node mesh, info; + mesh["state/cycle"] = 100; + // create the coordinate set + mesh["coordsets/coords/type"] = "explicit"; + mesh["coordsets/coords/values/x"] = {-1.0, 1.0, 0.0, -1.0, 1.0, 0.0}; + mesh["coordsets/coords/values/y"] = {-1.0, -1.0, -1.0, 1.0, 1.0, 1.0}; + mesh["coordsets/coords/values/z"] = { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0}; + // add the topology + + mesh["topologies/topo/type"] = "unstructured"; + mesh["topologies/topo/coordset"] = "coords"; + mesh["topologies/topo/elements/shape"] = "wedge"; + mesh["topologies/topo/elements/connectivity"].set(DataType::int64(6)); + int64_array con_vals = mesh["topologies/topo/elements/connectivity"].value(); + for(index_t i =0; i < 6; i++) + { + con_vals[i] = i; + } + + mesh["fields/vert_id/topology"] = "topo"; + mesh["fields/vert_id/association"] = "vertex"; + mesh["fields/vert_id/values"].set(DataType::float64(6)); + float64_array vert_id_vals = mesh["fields/vert_id/values"].value(); + for(index_t i =0; i < 6; i++) + { + vert_id_vals[i] = i; + } + + mesh["fields/ele_id/topology"] = "topo"; + mesh["fields/ele_id/association"] = "element"; + mesh["fields/ele_id/values"].set(DataType::float64(1)); + float64_array ele_id_vals = mesh["fields/ele_id/values"].value(); + ele_id_vals[0] = 0; + + string output_path = prepare_output_dir(); + string output_file = conduit::utils::join_file_path(output_path, + "tout_render_3d_wedge_vert_id"); + // remove old images before rendering + remove_test_image(output_file); + + conduit::Node actions; + conduit::Node &add_plots = actions.append(); + add_plots["action"] = "add_scenes"; + conduit::Node &scenes = add_plots["scenes"]; + scenes["s1/plots/p1/type"] = "pseudocolor"; + scenes["s1/plots/p1/field"] = "vert_id"; + scenes["s1/image_prefix"] = output_file; + + + Ascent ascent; + ascent.open(); + ascent.publish(mesh); + ascent.execute(actions); + ascent.close(); + + EXPECT_TRUE(check_test_image(output_file)); + +} + + + // //----------------------------------------------------------------------------- TEST(ascent_render_3d, test_render_3d_extreme_extents) { + // the ascent runtime is currently our only rendering runtime + Node n; + ascent::about(n); + // only run this test if ascent was built with vtkm support + if(n["runtimes/ascent/vtkm/status"].as_string() == "disabled") + { + ASCENT_INFO("Ascent support disabled, skipping 3D default" + "Pipeline test"); + + return; + } + // create uniform grid with very large (spatial) extents Node mesh, info;