Skip to content

Commit

Permalink
verify for structured options for adjsets (#374)
Browse files Browse the repository at this point in the history
* Verify method for blueprint nestset

* Updated the 'blueprint::mesh::nestset' verify function based on discussed refinements (circa 5/29).

* Adding index verifiers for 'nestsets' Blueprint field.

* Finished the initial implementation of the misc nestsets blueprint example.

* * Added all of the test cases for the new structured AMR schema.
* Made some minor improvements to the automated structured AMR schema generation code.

* Fixing an issue with builds on Windows.

* Trying another thing to fix the Windows build.

* Fixed a minor bug in 'conduit::Node::set' that was causing memory problems when setting an existing object/list node to a scalar type.

* Refactored the 'nestset' example code to use explicit transform operator to simplify code.

* Add blueprint verify for structured version of adjsets

* Small fixes in adjset verify

* Added "windows" to adjset verify.

* Change adjsets verify to allow for neighbor integers only

* Add an example to verify the uniform version of adjset

* Add manual build-up of adjest windows for testing

* Fix adjset example to set coords for vertices, not zones

* Add ratio for adjacency neighbors on different AMR levels

* Add ratios to structured adjset blueprint mesh example

Co-authored-by: Joseph Ciurej <ciurej1@llnl.gov>
  • Loading branch information
nselliott and xjrc committed Apr 20, 2020
1 parent 0e723f1 commit 8b4da06
Show file tree
Hide file tree
Showing 4 changed files with 664 additions and 3 deletions.
60 changes: 59 additions & 1 deletion src/libs/blueprint/conduit_blueprint_mesh.cpp
Expand Up @@ -4114,8 +4114,66 @@ mesh::adjset::verify(const Node &adjset,

bool group_res = true;
group_res &= verify_integer_field(protocol, chld, chld_info, "neighbors");
group_res &= verify_integer_field(protocol, chld, chld_info, "values");
if(chld.has_child("values"))
{
group_res &= verify_integer_field(protocol, chld,
chld_info, "values");
}
else if(chld.has_child("windows"))
{

group_res &= verify_object_field(protocol, chld,
chld_info, "windows");

bool windows_res = true;
NodeConstIterator witr = chld["windows"].children();
while(witr.has_next())
{
const Node &wndw = witr.next();
const std::string wndw_name = witr.name();
Node &wndw_info = chld_info["windows"][wndw_name];

bool window_res = true;
window_res &= verify_field_exists(protocol, wndw,
wndw_info, "origin") &&
mesh::logical_dims::verify(wndw["origin"],
wndw_info["origin"]);
window_res &= verify_field_exists(protocol, wndw,
wndw_info, "dims") &&
mesh::logical_dims::verify(wndw["dims"],
wndw_info["dims"]);
window_res &= verify_field_exists(protocol, wndw,
wndw_info, "ratio") &&
mesh::logical_dims::verify(wndw["ratio"],
wndw_info["ratio"]);

// verify that dimensions for "origin" and
// "dims" and "ratio" are the same
if(window_res)
{
index_t window_dim = wndw["origin"].number_of_children();
window_res &= !wndw.has_child("dims") ||
verify_object_field(protocol, wndw,
wndw_info, "dims", false, window_dim);
window_res &= !wndw.has_child("ratio") ||
verify_object_field(protocol, wndw,
wndw_info, "ratio", false, window_dim);
}

log::validation(wndw_info,window_res);
windows_res &= window_res;
}

log::validation(chld_info["windows"],windows_res);
res &= windows_res;

if(chld.has_child("orientation"))
{
group_res &= verify_integer_field(protocol, chld,
chld_info, "orientation");
}
}

log::validation(chld_info,group_res);
groups_res &= group_res;
}
Expand Down

0 comments on commit 8b4da06

Please sign in to comment.