Skip to content

Commit

Permalink
Fix axom klee tests and revert bp plugin mat nos (#19392) (#19393)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Mar 16, 2024
1 parent 5d10922 commit 5d0b5fd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
36 changes: 14 additions & 22 deletions src/databases/Blueprint/avtBlueprintFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,9 @@ avtBlueprintFileFormat::AddBlueprintMeshAndFieldMetadata(avtDatabaseMetaData *md
//
// Justin Privitera, Wed Feb 14 11:37:06 PST 2024
// Present material ids alongside material names.
//
// Justin Privitera, Fri Mar 15 15:56:13 PDT 2024
// Revert previous change.
//
// ****************************************************************************
void
Expand Down Expand Up @@ -1330,13 +1333,6 @@ avtBlueprintFileFormat::AddBlueprintMaterialsMetadata(avtDatabaseMetaData *md,
<< mesh_matset_name
<< " : " << m_matset_info[mesh_matset_name].to_yaml())

// we want to add the matnos to the names
for (size_t i = 0; i < matnames.size(); i ++)
{
int matno = m_matset_info[mesh_matset_name]["matnames"][matnames[i]].to_int64();
matnames[i] = std::to_string(matno) + " " + matnames[i];
}

avtMaterialMetaData *mmd = new avtMaterialMetaData(mesh_matset_name,
mesh_topo_name,
static_cast<int>(matnames.size()),
Expand Down Expand Up @@ -2590,6 +2586,9 @@ avtBlueprintFileFormat::GetAuxiliaryData(const char *var,
//
// Justin Privitera, Wed Feb 14 11:37:06 PST 2024
// Present material ids alongside material names.
//
// Justin Privitera, Fri Mar 15 15:56:13 PDT 2024
// Revert previous change.
//
// ****************************************************************************
avtMaterial *
Expand All @@ -2607,14 +2606,21 @@ avtBlueprintFileFormat::GetMaterial(int domain,
mat_name,
n_matset);

std::vector<std::string> matnames = n_matset["matnames"].child_names();
// package up char ptrs
std::vector<const char *> matnames_ptrs;
for (const auto &matname : matnames)
matnames_ptrs.push_back(matname.c_str());
auto names = const_cast<char **>(matnames_ptrs.data());

// use to_silo util to convert from bp to the mixslot rep
// that silo and visit use

Node n_silo_matset;
conduit::blueprint::mesh::matset::to_silo(n_matset,
n_silo_matset);

int nmats = static_cast<int>(n_silo_matset["material_map"].number_of_children());
int nmats = static_cast<int>(matnames.size());
int nzones = static_cast<int>(n_silo_matset["matlist"].dtype().number_of_elements());
int *matlist = NULL;
int *mix_mat = NULL;
Expand All @@ -2629,20 +2635,6 @@ avtBlueprintFileFormat::GetMaterial(int domain,
matnos.push_back(n_mat.to_int());
}

std::vector<std::string> matnames;
for (const auto &matname : n_silo_matset["material_map"].child_names())
{
const int matno = n_silo_matset["material_map"][matname].to_int64();
const std::string mat_num_and_name = std::to_string(matno) + " " + matname;
matnames.push_back(mat_num_and_name);
}

// package up char ptrs
std::vector<const char *> matnames_ptrs;
for (const auto &matname : matnames)
matnames_ptrs.push_back(matname.c_str());
auto names = const_cast<char **>(matnames_ptrs.data());

// we need int ptrs for the avtMaterial object,
// convert if needed

Expand Down
1 change: 0 additions & 1 deletion src/resources/help/en_US/relnotes3.4.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<li>GetPlotInformation() can now contain entries for multiple-curves when Query-over-time is performed on multiple variables. For example, if a pick-through-time was performed for variables 'u' and 'v', the curve for 'v' would be retrieved via 'GetPlotInformation()['Curves']['v']. Single variable results will still be retrieved via 'GetPlotInformation()['Curve'].</li>
<li>The ADIOS2 database plugin learned a new flavor of file type: Pixie3D.</li>
<li>A number of improvements were made to the UNV plugin including quadric elements, support for antique SDRC/I-Deas files prior to Master Series (versions 4,5 and 6), GMSH hidden polygon linear element.</li>
<li>The Blueprint Reader now presents material ids alongside material names when plotting materials.</li>
</ul>

<p>Click the following link to view the release notes for the previous version
Expand Down
19 changes: 11 additions & 8 deletions src/test/tests/databases/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
# Justin Privitera, Tue Mar 12 13:29:30 PDT 2024
# Now that blueprint presents material ids alongside material names, we
# must use the ids and names to get specific materials.
#
# Justin Privitera, Fri Mar 15 15:56:13 PDT 2024
# Revert prior change.
#
# ----------------------------------------------------------------------------
RequiredDatabasePlugin("Blueprint")
Expand Down Expand Up @@ -427,10 +430,10 @@ def test_venn(tag_name, venn_db_file):
TestSection("Blueprint Matset Example Tests: {0} Matvf Exprs".format(tag_name))

# check all volume fractions
vf_exprs = {"vf_bg":'matvf(mesh_topo_matset,"0 background")',
"vf_c_a":'matvf(mesh_topo_matset,"1 circle_a")',
"vf_c_b":'matvf(mesh_topo_matset,"2 circle_b")',
"vf_c_c":'matvf(mesh_topo_matset,"3 circle_c")'}
vf_exprs = {"vf_bg":'matvf(mesh_topo_matset,"background")',
"vf_c_a":'matvf(mesh_topo_matset,"circle_a")',
"vf_c_b":'matvf(mesh_topo_matset,"circle_b")',
"vf_c_c":'matvf(mesh_topo_matset,"circle_c")'}

for ename,edef in vf_exprs.items():
DefineScalarExpression(ename,edef);
Expand All @@ -453,10 +456,10 @@ def test_venn(tag_name, venn_db_file):
TestSection("Blueprint Matset Example Tests: {0} Val4mat Exprs".format(tag_name))

# check all volume fractions
v4m_exprs = {"v4m_bg":'val4mat(<mesh_topo/mat_check>,"0 background")',
"v4m_c_a":'val4mat(<mesh_topo/mat_check>,"1 circle_a")',
"v4m_c_b":'val4mat(<mesh_topo/mat_check>,"2 circle_b")',
"v4m_c_c":'val4mat(<mesh_topo/mat_check>,"3 circle_c")'}
v4m_exprs = {"v4m_bg":'val4mat(<mesh_topo/mat_check>,"background")',
"v4m_c_a":'val4mat(<mesh_topo/mat_check>,"circle_a")',
"v4m_c_b":'val4mat(<mesh_topo/mat_check>,"circle_b")',
"v4m_c_c":'val4mat(<mesh_topo/mat_check>,"circle_c")'}

v4m_test_vals = {"v4m_bg": 1,
"v4m_c_a": 20,
Expand Down

0 comments on commit 5d0b5fd

Please sign in to comment.