Skip to content

Commit

Permalink
Parsing for composite meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
itopcuoglu committed Mar 15, 2024
1 parent 81ae1e5 commit aece954
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
22 changes: 22 additions & 0 deletions app/exawind/exawind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,28 @@ int main(int argc, char** argv)
: false;
sim.set_holemap_alg(holemap_alg);

const YAML::Node& composite_mesh = node["composite_mesh"];
const int num_composite = composite_mesh.size();
sim.set_composite_num(num_composite);

for (int i = 0; i < num_composite; i++) {
const YAML::Node& composite_node = composite_mesh[i];

const int num_body_tags = composite_node["num_body_tags"].as<int>();

const auto body_tags =
composite_node["body_tags"].as<std::vector<int>>();

const auto dominance_tags =
composite_node["dominance_tags"].as<std::vector<int>>();

const double search_tol =
composite_node["search_tolerance"].as<double>();

sim.set_composite_body(
i, num_body_tags, body_tags, dominance_tags, search_tol);
}

const YAML::Node yaml_replace_all = node["nalu_replace_all"];
for (int i = 0; i < num_nwsolvers; i++) {
if (nalu_comms.at(i) != MPI_COMM_NULL) {
Expand Down
3 changes: 2 additions & 1 deletion src/OversetSimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ void OversetSimulation::perform_overset_connectivity()
m_tg.profile();
if ((m_is_adaptive_holemap_alg == 1) &&
(m_complementary_comm_initialized == false)) {
m_tg.assembleComms();
m_tg.assembleComplementComms();
m_complementary_comm_initialized = true;
if(m_num_composite_bodies>0) m_tg.assembleCompositeMap();
}
m_tg.performConnectivity();
if (m_has_amr) m_tg.performConnectivityAMR();
Expand Down
26 changes: 26 additions & 0 deletions src/OversetSimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class OversetSimulation
bool m_complementary_comm_initialized{false};
//! Flag for holemap algorithm
bool m_is_adaptive_holemap_alg{false};
//! Number of composite bodies
int m_num_composite_bodies{0};
//! Tioga instance
TIOGA::tioga m_tg;
//! Determine unstructured and structured solver types
Expand Down Expand Up @@ -109,6 +111,30 @@ class OversetSimulation
m_is_adaptive_holemap_alg = alg;
if (m_is_adaptive_holemap_alg == true) m_tg.setHoleMapAlgorithm(1);
}

void set_composite_num(int num_composite)
{
m_num_composite_bodies = num_composite;
m_tg.setNumCompositeBodies(num_composite);
}

void set_composite_body(
int body_index,
int num_body_tags,
std::vector<int> bodytags,
std::vector<int> dominance_tags,
double search_tol)
{
if (m_is_adaptive_holemap_alg == true) {
m_tg.registerCompositeBody(
(body_index+1), num_body_tags, bodytags.data(),
dominance_tags.data(), search_tol);
} else {
throw std::runtime_error(
"The composite body feature requires the use of adaptive "
"holemap");
}
}
};

} // namespace exawind
Expand Down

0 comments on commit aece954

Please sign in to comment.