Skip to content

Commit dffc5a6

Browse files
authored
Add adjacency set between adjacent refined domains. (#1460)
Domains that neighbor each other (spatially) are connected by adjsets, as long as they are at the same level of refinement. This PR adds adjsets between neighboring refined domains.
1 parent 44eb76c commit dffc5a6

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Notable changes to Conduit are documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project aspires to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Added
10+
11+
#### Blueprint
12+
- Finished `bent_multi_grid_amr` mesh by adding adjacency sets between spatially adjacent domains at the same level of refinement.
13+
714
## [0.9.5] - Released 2025-09-10
815

916
### Added

src/libs/blueprint/conduit_blueprint_mesh_examples.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,8 @@ braid_init_example_adjset(Node &mesh)
10821082
typedef std::map< point, std::map<index_t, index_t> > point_doms_map;
10831083
typedef std::map<std::set<index_t>, std::vector<std::vector<index_t> > > group_idx_map;
10841084

1085+
if (mesh.dtype().is_empty()) { return; }
1086+
10851087
const std::string dim_names[3] = {"x", "y", "z"};
10861088
const index_t dim_count = blueprint::mesh::coordset::dims(
10871089
mesh.child(0).fetch("coordsets").child(0));
@@ -3946,6 +3948,7 @@ void CONDUIT_BLUEPRINT_API bent_multi_grid(const conduit::Node &spec,
39463948

39473949
// Now refine selected domains.
39483950
doms_it.to_front();
3951+
conduit::Node nested_doms;
39493952
while (doms_it.has_next())
39503953
{
39513954
const Node& dom_node = doms_it.next();
@@ -3958,14 +3961,25 @@ void CONDUIT_BLUEPRINT_API bent_multi_grid(const conduit::Node &spec,
39583961
const std::string nest_name = oss.str();
39593962
if (last_dim == 2)
39603963
{
3961-
nest_quads(dom_node, res[doms_it.name()], res[nest_name]);
3964+
nest_quads(dom_node, res[doms_it.name()], nested_doms[nest_name]);
39623965
}
39633966
else
39643967
{
3965-
nest_hexs(dom_node, res[doms_it.name()], res[nest_name]);
3968+
nest_hexs(dom_node, res[doms_it.name()], nested_doms[nest_name]);
39663969
}
39673970
}
39683971
}
3972+
3973+
// Tie adjacent refined domains together with adjsets.
3974+
braid_init_example_adjset(nested_doms);
3975+
3976+
// Now store the new domains back into the result.
3977+
NodeConstIterator nested_doms_it = nested_doms.children();
3978+
while (nested_doms_it.has_next())
3979+
{
3980+
const Node& ndom_node = nested_doms_it.next();
3981+
res[nested_doms_it.name()] = ndom_node;
3982+
}
39693983
}
39703984
}
39713985

@@ -3978,6 +3992,10 @@ void CONDUIT_BLUEPRINT_API bent_multi_grid_amr(const conduit::Node &spec,
39783992
bent_multi_grid_defaults(default_spec);
39793993
default_spec["domain0/nest_child_id"] = 6;
39803994
default_spec["domain0/nest_ratio"] = 3;
3995+
default_spec["domain1/nest_child_id"] = 7;
3996+
default_spec["domain1/nest_ratio"] = 3;
3997+
default_spec["domain5/nest_child_id"] = 8;
3998+
default_spec["domain5/nest_ratio"] = 3;
39813999
bent_multi_grid(default_spec, res);
39824000
}
39834001
else

0 commit comments

Comments
 (0)