Skip to content

Commit

Permalink
Merge pull request #1214 from LLNL/features/whitlock/better_tiled_mes…
Browse files Browse the repository at this point in the history
…h_construction

Enhanced tiled mesh generation so it can work top-down.
  • Loading branch information
BradWhitlock committed Dec 18, 2023
2 parents c8ea7af + 52dec29 commit 9c8feb7
Show file tree
Hide file tree
Showing 20 changed files with 4,408 additions and 322 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added a `conduit::blueprint::mesh::utils::convert()` function that converts a list of nodes to a desired data type.
- Added a `conduit::blueprint::mesh::generate_boundary_partition_field()` function that can take a topology and a partition field and generate a field for a related boundary topology. This is helpful when partitioning a boundary topology in the same manner as its parent topology.
- Added `blueprint.mesh.examples.strided_structured` to the blueprint python module.

- Added `conduit::blueprint::mesh::utils::adjset::to_topo()` function to make new point mesh topologies for each group of an adjacency set. This permits each group to be visualized as a set of points in VisIt. The groups for each side of the domain interface can be compared since they are separate point meshes.
- Added `conduit::blueprint::mesh::utils::adjset::is_canonical()` function to check whether the group names in an adjacency set are canonical.

### Changed

#### General
- Improved the efficiency of json parsing logic.
- The `conduit_relay_io_convert` program was enhanced so it can read/write Blueprint root files by passing _"blueprint"_ for the read or write protocols.
- The `conduit_adjset_validate` program now writes a point mesh for each adjset groups if the _-output_ argument is supplied.

#### Blueprint
- The `conduit::blueprint::mpi::mesh::partition_map_back()` function was enhanced so it accepts a "field_prefix" value in its options. The prefix is used when looking for the `global_vertex_ids` field, which could have been created with a prefix by the same option in the `conduit::blueprint::mpi::mesh::generate_partition_field()` function.
Expand Down
37 changes: 31 additions & 6 deletions src/executables/adjset_validate/adjset_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ printUsage(const char *program)
int
main(int argc, char *argv[])
{
std::string input, output("adjset_validate"), protocol;
std::string input, output, protocol;

// Set default protocol. Use HDF5 if present.
conduit::Node props;
Expand Down Expand Up @@ -202,28 +202,53 @@ main(int argc, char *argv[])
std::vector<const conduit::Node *> adjsets(GetAdjsets(root));

// Look through the adjsets to see if the points are all good.
std::string msg2("Check adjset ");
bool err = false;
conduit::Node pointMeshes;
for(size_t i = 0; i < adjsets.size(); i++)
{
std::string adjsetName(adjsets[i]->name());

// Get the adjset association.
std::string association;
if(adjsets[i]->has_path("association"))
association = adjsets[i]->fetch_existing("association").as_string();

conduit::Node info;
bool res = conduit::blueprint::mesh::utils::adjset::validate(root, adjsetName, info);
if(res)
{
std::cout << msg2 << adjsetName << "... PASS" << std::endl;
// If the adjset is vertex associated then compare the points in
// it to make sure that they are the same on each side of the boundary.
if(association == "vertex")
res = conduit::blueprint::mesh::utils::adjset::compare_pointwise(root, adjsetName, info);

if(res)
{
std::cout << "Check " << association << " adjset " << adjsetName << "... PASS" << std::endl;
}
else
{
std::cout << "Check " << association << " adjset " << adjsetName << "... FAIL: The adjset points have different orders" << std::endl;
info.print();
err = true;
}
}
else
{
std::cout << msg2 << adjsetName << "... FAIL: The adjsets contain errors." << std::endl;
std::cout << "Check " << association << " adjset " << adjsetName << "... FAIL: The adjsets contain errors." << std::endl;
info.print();
addPointMesh(adjsetName, info, pointMeshes);
// If we're outputting, make a point mesh of the differences.
if(!output.empty())
addPointMesh(adjsetName, info, pointMeshes);
err = true;
}

// If we're outputting. write the adjsets as point meshes that we can look at.
if(!output.empty())
conduit::blueprint::mesh::utils::adjset::to_topo(root, adjsetName, pointMeshes);
}
// Write any point meshes that were created.
if(pointMeshes.number_of_children() > 0)
if(!output.empty() && pointMeshes.number_of_children() > 0)
{
conduit::relay::io::blueprint::save_mesh(pointMeshes, output, protocol);
}
Expand Down

0 comments on commit 9c8feb7

Please sign in to comment.