Skip to content

Commit de24fc9

Browse files
committed
Added a tiled() mesh test where we request 1 tile in 3D. This test used to cause an infinite loop.
1 parent a5bd8e0 commit de24fc9

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/tests/blueprint/t_blueprint_mpi_mesh_tiled.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,36 @@ top: [3,2]
508508
}
509509
}
510510

511+
//-----------------------------------------------------------------------------
512+
TEST(conduit_blueprint_mpi_mesh_utils, topdown_size_1_1_1)
513+
{
514+
double extents[] = {0., 1., 0., 1., 0., 1.};
515+
conduit::Node res, bopts;
516+
bopts["meshname"] = "main";
517+
bopts["datatype"] = "int32";
518+
bopts["numDomains"] = 2;
519+
bopts["extents"].set(extents, 6);
520+
bopts["curveSplitting"] = 0;
521+
522+
// This makes a single tile due to 1, 1, 1 size.
523+
conduit::blueprint::mesh::examples::tiled(1, 1, 1, res, bopts);
524+
525+
// See if that's what we got.
526+
EXPECT_TRUE(res.has_path("coordsets/coords"));
527+
EXPECT_EQ(res.fetch_existing("coordsets/coords/values/x").dtype().number_of_elements(), 66);
528+
EXPECT_TRUE(res.has_path("topologies/main/elements/shape"));
529+
EXPECT_EQ(res.fetch_existing("topologies/main/elements/shape").as_string(), "hex");
530+
EXPECT_EQ(res.fetch_existing("topologies/main/elements/sizes").dtype().number_of_elements(), 24);
531+
EXPECT_TRUE(res.has_path("topologies/boundary/elements/shape"));
532+
EXPECT_EQ(res.fetch_existing("topologies/boundary/elements/shape").as_string(), "quad");
533+
EXPECT_EQ(res.fetch_existing("topologies/boundary/elements/sizes").dtype().number_of_elements(), 64);
534+
535+
// There was a single domain so no adjsets.
536+
EXPECT_FALSE(res.has_path("adjsets"));
537+
538+
conduit::relay::io::blueprint::save_mesh(res, "tiled", "hdf5");
539+
}
540+
511541
//-----------------------------------------------------------------------------
512542
int main(int argc, char* argv[])
513543
{

0 commit comments

Comments
 (0)