Skip to content

Commit d121916

Browse files
banned
1 parent f9e72fc commit d121916

2 files changed

Lines changed: 14 additions & 42 deletions

File tree

src/libs/blueprint/conduit_blueprint_mesh.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6694,7 +6694,9 @@ mesh::matset::verify(const Node &matset,
66946694

66956695
if(mat.dtype().is_object())
66966696
{
6697-
vfs_res &= verify_o2mrelation_field(protocol, vfs, vfs_info, mat_name);
6697+
log::error(info, protocol,
6698+
"material volume fractions must be a scalar array, not an object with children");
6699+
res &= false;
66986700
}
66996701
else
67006702
{
@@ -6723,24 +6725,24 @@ mesh::matset::verify(const Node &matset,
67236725

67246726
res &= verify_matset_material_map(protocol,matset,info);
67256727

6726-
// for cases where vfs are an object, we expect the material_map child
6727-
// names to be a subset of the volume_fractions child names
6728+
// for cases where vfs are an object, we expect the volume_fractions child
6729+
// names to be a subset of the material_map child names
67286730
if(matset.has_child("volume_fractions") &&
67296731
matset["volume_fractions"].dtype().is_object())
67306732
{
6731-
NodeConstIterator itr = matset["material_map"].children();
6733+
NodeConstIterator itr = matset["volume_fractions"].children();
67326734
while(itr.has_next())
67336735
{
67346736
itr.next();
67356737
std::string curr_name = itr.name();
6736-
if(!matset["volume_fractions"].has_child(curr_name))
6738+
if(!matset["material_map"].has_child(curr_name))
67376739
{
67386740
std::ostringstream oss;
6739-
oss << "'material_map' hierarchy must be a subset of "
6740-
"'volume_fractions'. "
6741-
" 'volume_fractions' is missing child '"
6741+
oss << "'volume_fractions' material names must be a subset of "
6742+
"'material_map'. "
6743+
" 'material_map' is missing child '"
67426744
<< curr_name
6743-
<<"' which exists in 'material_map`" ;
6745+
<<"' which exists in 'volume_fractions`" ;
67446746
log::error(info, protocol,oss.str());
67456747
res &= false;
67466748
}

src/tests/blueprint/t_blueprint_mesh_verify.cpp

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,28 +1107,14 @@ TEST(conduit_blueprint_mesh_verify, matset_general)
11071107
n.reset();
11081108
n["topology"].set("mesh");
11091109

1110-
n["volume_fractions"]["m1"]["values"].set(DataType::float64(8));
1111-
n["volume_fractions"]["m1"]["indices"].set(DataType::uint32(5));
1110+
n["volume_fractions"]["m1"].set(DataType::float64(8));
11121111
CHECK_MESH(verify_matset,n,info,true);
11131112
CHECK_MATSET(n,is_multi_buffer,is_element_dominant);
11141113

1115-
n["volume_fractions"]["m2"]["indices"].set(DataType::uint32(5));
1116-
CHECK_MESH(verify_matset,n,info,false);
1117-
n["volume_fractions"]["m2"]["values"].set(DataType::float64(10));
1118-
CHECK_MESH(verify_matset,n,info,true);
1119-
CHECK_MATSET(n,is_multi_buffer,is_element_dominant);
1120-
1121-
n["volume_fractions"]["m3"]["sizes"].set(DataType::uint32(3));
1122-
n["volume_fractions"]["m3"]["values"].set(DataType::float64(30));
1114+
n["volume_fractions"]["m4"]["indices"].set(DataType::uint32(5));
11231115
CHECK_MESH(verify_matset,n,info,false);
1124-
n["volume_fractions"]["m3"]["offsets"].set(DataType::uint32(3));
1125-
CHECK_MESH(verify_matset,n,info,true);
1126-
CHECK_MATSET(n,is_multi_buffer,is_element_dominant);
1127-
11281116
n["volume_fractions"]["m4"]["test"]["values"].set(DataType::uint32(3));
11291117
CHECK_MESH(verify_matset,n,info,false);
1130-
n["volume_fractions"]["m4"]["indices"].set(DataType::uint32(5));
1131-
CHECK_MESH(verify_matset,n,info,false);
11321118

11331119
// make sure we are in good shape for opt material_map checks
11341120
n["volume_fractions"].remove("m4");
@@ -1143,6 +1129,7 @@ TEST(conduit_blueprint_mesh_verify, matset_general)
11431129
n["material_map/m1"] = 0;
11441130
n["material_map/m2"] = 1;
11451131
n["material_map/m3"] = 2;
1132+
n["material_map/m4"] = 4;
11461133

11471134
CHECK_MESH(verify_matset,n,info,true);
11481135

@@ -1162,23 +1149,6 @@ TEST(conduit_blueprint_mesh_verify, matset_general)
11621149
n["material_map/m2"] = "bananas";
11631150
n["material_map/m3"] = "mangoes";
11641151
CHECK_MESH(verify_matset,n,info,false);
1165-
1166-
// material_map ents don't match vfs
1167-
// (more mat map ents than vfs)
1168-
n["material_map"].reset();
1169-
n["material_map/m1"] = 0;
1170-
n["material_map/m2"] = 1;
1171-
n["material_map/m3"] = 2;
1172-
n["material_map/m4"] = 4;
1173-
1174-
CHECK_MESH(verify_matset,n,info,false);
1175-
1176-
// material_map ents are subset of vfs
1177-
// (should be true)
1178-
n["material_map"].reset();
1179-
n["material_map/m1"] = 0;
1180-
n["material_map/m3"] = 2;
1181-
CHECK_MESH(verify_matset,n,info,true);
11821152
}
11831153

11841154
{ // Element ID Tests //

0 commit comments

Comments
 (0)