From 9e1f572dc3583be4f3caad0e42a89b56a676b359 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 16:54:41 -0600 Subject: [PATCH 01/22] Round 1 of Nalu-Wind changes --- CMakeLists.txt | 4 +- README.md | 2 +- app/exawind/exawind.cpp | 68 +++++++-------- src/CMakeLists.txt | 6 +- src/KynemaUGF.cpp | 175 ++++++++++++++++++++++++++++++++++++++ src/KynemaUGF.h | 87 +++++++++++++++++++ src/NaluWind.cpp | 48 +++++------ src/NaluWind.h | 14 +-- src/OversetSimulation.cpp | 2 +- src/OversetSimulation.h | 4 +- 10 files changed, 336 insertions(+), 74 deletions(-) create mode 100644 src/KynemaUGF.cpp create mode 100644 src/KynemaUGF.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f478ab..5cbc8db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,11 +36,11 @@ if (EXAWIND_ENABLE_UMPIRE) include_directories(SYSTEM ${UMPIRE_INCLUDE_DIRS}) endif() -set(CMAKE_PREFIX_PATH ${Nalu-Wind_DIR} ${Trilinos_DIR} ${AMR-Wind_DIR} +set(CMAKE_PREFIX_PATH ${Kynema-UGF_DIR} ${Trilinos_DIR} ${AMR-Wind_DIR} ${OpenFAST_DIR} ${TIOGA_DIR} ${YAML-CPP_DIR} ${CMAKE_PREFIX_PATH}) -find_package(Nalu-Wind REQUIRED) +find_package(Kynema-UGF REQUIRED) find_package(Trilinos REQUIRED) find_package(AMR-Wind REQUIRED) if(NALU_USES_OPENFAST) diff --git a/README.md b/README.md index cbab1ad..94ac9db 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![journal article](https://img.shields.io/badge/DOI-10.1002/we.2886-blue)](https://doi.org/10.1002/we.2886) This repository contains a pure C++ driver API for coupling -[Nalu-Wind](https://github.com/exawind/nalu-wind) and +[Kynema-UGF](https://github.com/exawind/nalu-wind) and [AMR-Wind](https://github.com/exawind/amr-wind) CFD codes. ## Citation diff --git a/app/exawind/exawind.cpp b/app/exawind/exawind.cpp index 2571322..57b4fe2 100644 --- a/app/exawind/exawind.cpp +++ b/app/exawind/exawind.cpp @@ -1,5 +1,5 @@ #include "AMRWind.h" -#include "NaluWind.h" +#include "KynemaUGF.h" #include "OversetSimulation.h" #include "MPIUtilities.h" #include "mpi.h" @@ -19,7 +19,7 @@ static std::string usage(std::string name) "\t-h,--help\t\tShow this help message\n" + "\t--awind NPROCS\t\tNumber of ranks for AMR-Wind (default = all " "ranks)\n" + - "\t--nwind NPROCS\t\tNumber of ranks for Nalu-Wind (default = all " + "\t--nwind NPROCS\t\tNumber of ranks for Kynema-UGF (default = all " "ranks)\n"; } @@ -100,13 +100,13 @@ int main(int argc, char** argv) const std::string amr_log = replace_extension(amr_inp, ".log"); std::ofstream out; - YAML::Node nalu_node = node["nalu_wind_inp"]; + YAML::Node kynema_ugf_node = node["nalu_wind_inp"]; // make sure it is a list for now - assert(nalu_node.IsSequence()); - const int num_nwsolvers = nalu_node.size(); + assert(kynema_ugf_node.IsSequence()); + const int num_nwsolvers = kynema_ugf_node.size(); if (num_nwind_ranks < num_nwsolvers) { throw std::runtime_error( - "Number of Nalu-Wind ranks is less than the number of Nalu-Wind " + "Number of Kynema-UGF ranks is less than the number of Kynema-UGF " "solvers. Please have at least one rank per solver."); } std::vector num_nw_solver_ranks; @@ -114,15 +114,15 @@ int main(int argc, char** argv) num_nw_solver_ranks = node["nalu_wind_procs"].as>(); if (static_cast(num_nw_solver_ranks.size()) != num_nwsolvers) { throw std::runtime_error( - "Number of Nalu-Wind rank specifications is less than the " - " number of Nalu-Wind solvers. Please have one rank count " + "Number of Kynema-UGF rank specifications is less than the " + " number of Kynema-UGF solvers. Please have one rank count " "specification per solver"); } const int tot_num_nw_ranks = std::accumulate( num_nw_solver_ranks.begin(), num_nw_solver_ranks.end(), 0); if (tot_num_nw_ranks != num_nwind_ranks) { throw std::runtime_error( - "Total number of Nalu-Wind ranks does not " + "Total number of Kynema-UGF ranks does not " "match that given in the command line. Please ensure " "they match"); } @@ -156,12 +156,12 @@ int main(int argc, char** argv) ? exawind::create_subcomm(MPI_COMM_WORLD, num_awind_ranks, 0) : MPI_COMM_NULL; - std::vector nalu_comms; - std::vector nalu_start_rank; + std::vector kynema_ugf_comms; + std::vector kynema_ugf_start_rank; int start = psize - num_nwind_ranks; for (const auto& nr : num_nw_solver_ranks) { - nalu_start_rank.push_back(start); - nalu_comms.push_back( + kynema_ugf_start_rank.push_back(start); + kynema_ugf_comms.push_back( exawind::create_subcomm(MPI_COMM_WORLD, nr, start)); start += nr; } @@ -176,14 +176,14 @@ int main(int argc, char** argv) } sim.echo( "Initializing " + std::to_string(num_nwsolvers) + - " Nalu-Wind solvers, equally partitioned on a total of " + + " Kynema-UGF solvers, equally partitioned on a total of " + std::to_string(num_nwind_ranks) + " MPI ranks"); - if (std::any_of(nalu_comms.begin(), nalu_comms.end(), [](const auto& comm) { + if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { return comm != MPI_COMM_NULL; })) { - exawind::NaluWind::initialize(); + exawind::KynemaUGF::initialize(); } - sim.set_nw_start_rank(nalu_start_rank); + sim.set_nw_start_rank(kynema_ugf_start_rank); const auto nalu_vars = node["nalu_vars"].as>(); const int num_timesteps = @@ -238,18 +238,18 @@ int main(int argc, char** argv) YAML::Node yaml_replace_instance; YAML::Node this_instance = nalu_node[i]; - std::string nalu_inpfile, logfile; + std::string kynema_ugf_inpfile, logfile; bool write_final_yaml_to_disk = false; if (this_instance.IsMap()) { yaml_replace_instance = this_instance["replace"]; - nalu_inpfile = + kynema_ugf_inpfile = this_instance["base_input_file"].as(); // deal with the logfile name if (this_instance["logfile"]) { logfile = this_instance["logfile"].as(); } else { - logfile = exawind::NaluWind::change_file_name_suffix( - nalu_inpfile, ".log", i); + logfile = exawind::KynemaUGF::change_file_name_suffix( + kynema_ugf_inpfile, ".log", i); } if (this_instance["write_final_yaml_to_disk"]) { write_final_yaml_to_disk = @@ -257,34 +257,34 @@ int main(int argc, char** argv) } } else { - nalu_inpfile = this_instance.as(); - logfile = exawind::NaluWind::change_file_name_suffix( - nalu_inpfile, ".log"); + kynema_ugf_inpfile = this_instance.as(); + logfile = exawind::KynemaUGF::change_file_name_suffix( + kynema_ugf_inpfile, ".log"); } - YAML::Node nalu_yaml = YAML::LoadFile(nalu_inpfile); + YAML::Node kynema_ugf_yaml = YAML::LoadFile(kynema_ugf_inpfile); // replace in order so instance can overwrite all if (yaml_replace_all) { - YEDIT::find_and_replace(nalu_yaml, yaml_replace_all); + YEDIT::find_and_replace(kynema_ugf_yaml, yaml_replace_all); } if (yaml_replace_instance) { - YEDIT::find_and_replace(nalu_yaml, yaml_replace_instance); + YEDIT::find_and_replace(kynema_ugf_yaml, yaml_replace_instance); } // only the first rank of the comm should write the file int comm_rank = -1; - MPI_Comm_rank(nalu_comms.at(i), &comm_rank); + MPI_Comm_rank(kynema_ugf_comms.at(i), &comm_rank); if (write_final_yaml_to_disk && comm_rank == 0) { auto new_ifile_name = - exawind::NaluWind::change_file_name_suffix( + exawind::KynemaUGF::change_file_name_suffix( logfile, ".yaml"); std::ofstream fout(new_ifile_name); - fout << nalu_yaml; + fout << kynema_ugf_yaml; fout.close(); } - sim.register_solver( - i + 1, nalu_comms.at(i), nalu_yaml, logfile, nalu_vars); + sim.register_solver( + i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, nalu_vars); } } @@ -308,10 +308,10 @@ int main(int argc, char** argv) exawind::AMRWind::finalize(); out.close(); } - if (std::any_of(nalu_comms.begin(), nalu_comms.end(), [](const auto& comm) { + if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { return comm != MPI_COMM_NULL; })) { - exawind::NaluWind::finalize(); + exawind::KynemaUGF::finalize(); } MPI_Finalize(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8e26142..b182ace 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,8 @@ target_sources(${EXAWIND_LIB_NAME} PRIVATE ExawindSolver.h ExawindSolver.cpp MPIUtilities.h - NaluWind.cpp - NaluWind.h + KynemaUGF.cpp + KynemaUGF.h OversetSimulation.cpp OversetSimulation.h ParallelPrinter.h @@ -21,7 +21,7 @@ target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC AMR-Wind::amrwind_api AMR-Wind::buildInfoamrwind_obj AMReX::amrex - Nalu-Wind::nalu) + Kynema-UGF::nalu) target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp new file mode 100644 index 0000000..cfc45c7 --- /dev/null +++ b/src/KynemaUGF.cpp @@ -0,0 +1,175 @@ +#include "KynemaUGF.h" +#include "NaluEnv.h" +#include "Realm.h" +#include "TimeIntegrator.h" +#include "overset/ExtOverset.h" +#include "overset/TiogaRef.h" + +#include "Kokkos_Core.hpp" +#include "tioga.h" +#include "HypreNGP.h" + +namespace exawind { + +void KynemaUGF::initialize() +{ + Kokkos::initialize(); + // Hypre initialization + nalu_hypre::hypre_initialize(); + nalu_hypre::hypre_set_params(); +} + +void KynemaUGF::finalize() +{ + // Hypre cleanup + nalu_hypre::hypre_finalize(); + + if (Kokkos::is_initialized()) { + Kokkos::finalize(); + } +} + +KynemaUGF::KynemaUGF( + int id, + stk::ParallelMachine comm, + const YAML::Node& inp_yaml, + const std::string& logfile, + const std::vector& fnames, + TIOGA::tioga& tg) + : m_doc(inp_yaml), m_sim(m_doc), m_fnames(fnames), m_id(id), m_comm(comm) +{ + auto& env = sierra::nalu::NaluEnv::self(); + env.parallelCommunicator_ = comm; + MPI_Comm_size(comm, &env.pSize_); + MPI_Comm_rank(comm, &env.pRank_); + + ::tioga_nalu::TiogaRef::self(&tg); + + env.set_log_file_stream(logfile); +} + +KynemaUGF::~KynemaUGF() = default; + +void KynemaUGF::init_prolog(bool multi_solver_mode) +{ + // Dump the input yaml to the start of the logfile + // before the nalu banner + auto& env = sierra::nalu::NaluEnv::self(); + env.naluOutputP0() << std::string(20, '#') << " INPUT FILE START " + << std::string(20, '#') << std::endl; + sierra::nalu::NaluParsingHelper::emit(*env.naluLogStream_, m_doc); + env.naluOutputP0() << std::string(20, '#') << " INPUT FILE END " + << std::string(20, '#') << std::endl; + + m_sim.load(m_doc); + if (m_sim.timeIntegrator_->overset_ != nullptr) + m_sim.timeIntegrator_->overset_->set_multi_solver_mode( + multi_solver_mode); + m_sim.breadboard(); + m_sim.init_prolog(); +} + +void KynemaUGF::init_epilog() { m_sim.init_epilog(); } + +void KynemaUGF::prepare_solver_prolog() +{ + m_sim.timeIntegrator_->prepare_for_time_integration(); +} + +void KynemaUGF::prepare_solver_epilog() +{ + for (auto* realm : m_sim.timeIntegrator_->realmVec_) + realm->output_converged_results(); +} + +void KynemaUGF::pre_advance_stage0(size_t inonlin) +{ + m_sim.timeIntegrator_->prepare_time_step(inonlin); +} + +void KynemaUGF::pre_advance_stage1(size_t inonlin) +{ + m_sim.timeIntegrator_->pre_realm_advance_stage1(inonlin); +} + +void KynemaUGF::pre_advance_stage2(size_t inonlin) +{ + m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); +} + +double KynemaUGF::get_time() +{ + return m_sim.timeIntegrator_->get_time(); +} + +double KynemaUGF::get_timestep_size() +{ + return m_sim.timeIntegrator_->get_time_step(); +} + +void KynemaUGF::set_timestep_size(const double dt) +{ + m_sim.timeIntegrator_->set_timestep_size(dt); +} + +bool KynemaUGF::is_fixed_timestep_size() +{ + return m_sim.timeIntegrator_->get_is_fixed_time_step(); +} + +void KynemaUGF::advance_timestep(size_t /*inonlin*/) +{ + for (auto* realm : m_sim.timeIntegrator_->realmVec_) { + realm->advance_time_step(); + realm->process_multi_physics_transfer(); + } +} + +void KynemaUGF::additional_picard_iterations(const int n) +{ + for (auto* realm : m_sim.timeIntegrator_->realmVec_) + realm->nonlinear_iterations(n); +} + +void KynemaUGF::post_advance() { m_sim.timeIntegrator_->post_realm_advance(); } + +void KynemaUGF::pre_overset_conn_work() +{ + m_sim.timeIntegrator_->overset_->pre_overset_conn_work(); +} + +void KynemaUGF::post_overset_conn_work() +{ + m_sim.timeIntegrator_->overset_->post_overset_conn_work(); +} + +void KynemaUGF::register_solution() +{ + m_ncomps = m_sim.timeIntegrator_->overset_->register_solution(m_fnames); +} + +void KynemaUGF::update_solution() +{ + m_sim.timeIntegrator_->overset_->update_solution(); +} + +int KynemaUGF::overset_update_interval() +{ + for (auto& realm : m_sim.timeIntegrator_->realmVec_) { + if (realm->does_mesh_move()) { + return 1; + } + } + return 100000000; +} + +int KynemaUGF::time_index() { return m_sim.timeIntegrator_->timeStepCount_; } + +void KynemaUGF::dump_simulation_time() +{ + for (auto& realm : m_sim.timeIntegrator_->realmVec_) { + realm->dump_simulation_time(); + } +} + +} // namespace exawind diff --git a/src/KynemaUGF.h b/src/KynemaUGF.h new file mode 100644 index 0000000..1b586f9 --- /dev/null +++ b/src/KynemaUGF.h @@ -0,0 +1,87 @@ +#ifndef KYNEMAUGF_H +#define KYNEMAUGF_H + +#include +#include + +#include "Simulation.h" +#include "stk_util/parallel/Parallel.hpp" +#include "yaml-cpp/yaml.h" +#include "ExawindSolver.h" + +namespace TIOGA { +class tioga; +} + +namespace exawind { + +class KynemaUGF : public ExawindSolver +{ +private: + YAML::Node m_doc; + sierra::nalu::Simulation m_sim; + std::vector m_fnames; + int m_ncomps; + int m_id; + +public: + static void initialize(); + static void finalize(); + static std::string change_file_name_suffix( + std::string inpfile, std::string suffix, int index = -1) + { + int extloc = inpfile.rfind("."); + std::string logfile = inpfile; + if (index >= 0) { + suffix = "_" + std::to_string(index) + suffix; + } + if (extloc != static_cast(std::string::npos)) { + logfile = inpfile.substr(0, extloc) + suffix; + } + return logfile; + } + explicit KynemaUGF( + int id, + stk::ParallelMachine comm, + const YAML::Node& inp_yaml, + const std::string& logfile, + const std::vector& fnames, + TIOGA::tioga& tg); + ~KynemaUGF(); + bool is_unstructured() override { return true; } + bool is_amr() override { return false; } + bool is_fixed_timestep_size() override; + int overset_update_interval() override; + int time_index() override; + std::string identifier() override + { + return ("Kynema-UGF-" + std::to_string(m_id)); + } + MPI_Comm comm() override { return m_comm; } + int get_ncomps() override { return m_ncomps; } + +protected: + void init_prolog(bool multi_solver_mode = true) override; + void init_epilog() override; + void prepare_solver_prolog() override; + void prepare_solver_epilog() override; + void pre_advance_stage0(size_t inonlin) override; + void pre_advance_stage1(size_t inonlin) override; + void pre_advance_stage2(size_t inonlin) override; + double get_time() override; + double get_timestep_size() override; + void set_timestep_size(const double) override; + void advance_timestep(size_t inonlin) override; + void additional_picard_iterations(const int) override; + void post_advance() override; + void pre_overset_conn_work() override; + void post_overset_conn_work() override; + void register_solution() override; + void update_solution() override; + void dump_simulation_time() override; + MPI_Comm m_comm; +}; + +} // namespace exawind + +#endif /* KYNEMAUGF_H */ diff --git a/src/NaluWind.cpp b/src/NaluWind.cpp index ac55970..8de180f 100644 --- a/src/NaluWind.cpp +++ b/src/NaluWind.cpp @@ -1,4 +1,4 @@ -#include "NaluWind.h" +#include "KynemaUGF.h" #include "NaluEnv.h" #include "Realm.h" #include "TimeIntegrator.h" @@ -11,7 +11,7 @@ namespace exawind { -void NaluWind::initialize() +void KynemaUGF::initialize() { Kokkos::initialize(); // Hypre initialization @@ -19,7 +19,7 @@ void NaluWind::initialize() nalu_hypre::hypre_set_params(); } -void NaluWind::finalize() +void KynemaUGF::finalize() { // Hypre cleanup nalu_hypre::hypre_finalize(); @@ -29,7 +29,7 @@ void NaluWind::finalize() } } -NaluWind::NaluWind( +KynemaUGF::KynemaUGF( int id, stk::ParallelMachine comm, const YAML::Node& inp_yaml, @@ -48,9 +48,9 @@ NaluWind::NaluWind( env.set_log_file_stream(logfile); } -NaluWind::~NaluWind() = default; +KynemaUGF::~KynemaUGF() = default; -void NaluWind::init_prolog(bool multi_solver_mode) +void KynemaUGF::init_prolog(bool multi_solver_mode) { // Dump the input yaml to the start of the logfile // before the nalu banner @@ -69,9 +69,9 @@ void NaluWind::init_prolog(bool multi_solver_mode) m_sim.init_prolog(); } -void NaluWind::init_epilog() { m_sim.init_epilog(); } +void KynemaUGF::init_epilog() { m_sim.init_epilog(); } -void NaluWind::prepare_solver_prolog() +void KynemaUGF::prepare_solver_prolog() { m_sim.timeIntegrator_->prepare_for_time_integration(); } @@ -97,27 +97,27 @@ void NaluWind::pre_advance_stage2(size_t inonlin) m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); } -double NaluWind::get_time() +double KynemaUGF::get_time() { - return m_sim.timeIntegrator_->get_current_time(); + return m_sim.timeIntegrator_->get_time(); } -double NaluWind::get_timestep_size() +double KynemaUGF::get_timestep_size() { return m_sim.timeIntegrator_->get_time_step(); } -void NaluWind::set_timestep_size(const double dt) +void KynemaUGF::set_timestep_size(const double dt) { - m_sim.timeIntegrator_->set_time_step(dt); + m_sim.timeIntegrator_->set_timestep_size(dt); } -bool NaluWind::is_fixed_timestep_size() +bool KynemaUGF::is_fixed_timestep_size() { return m_sim.timeIntegrator_->get_is_fixed_time_step(); } -void NaluWind::advance_timestep(size_t /*inonlin*/) +void KynemaUGF::advance_timestep(size_t /*inonlin*/) { for (auto* realm : m_sim.timeIntegrator_->realmVec_) { realm->advance_time_step(); @@ -125,35 +125,35 @@ void NaluWind::advance_timestep(size_t /*inonlin*/) } } -void NaluWind::additional_picard_iterations(const int n) +void KynemaUGF::additional_picard_iterations(const int n) { for (auto* realm : m_sim.timeIntegrator_->realmVec_) realm->nonlinear_iterations(n); } -void NaluWind::post_advance() { m_sim.timeIntegrator_->post_realm_advance(); } +void KynemaUGF::post_advance() { m_sim.timeIntegrator_->post_realm_advance(); } -void NaluWind::pre_overset_conn_work() +void KynemaUGF::pre_overset_conn_work() { m_sim.timeIntegrator_->overset_->pre_overset_conn_work(); } -void NaluWind::post_overset_conn_work() +void KynemaUGF::post_overset_conn_work() { m_sim.timeIntegrator_->overset_->post_overset_conn_work(); } -void NaluWind::register_solution() +void KynemaUGF::register_solution() { m_ncomps = m_sim.timeIntegrator_->overset_->register_solution(m_fnames); } -void NaluWind::update_solution() +void KynemaUGF::update_solution() { m_sim.timeIntegrator_->overset_->update_solution(); } -int NaluWind::overset_update_interval() +int KynemaUGF::overset_update_interval() { for (auto& realm : m_sim.timeIntegrator_->realmVec_) { if (realm->does_mesh_move()) { @@ -163,9 +163,9 @@ int NaluWind::overset_update_interval() return 100000000; } -int NaluWind::time_index() { return m_sim.timeIntegrator_->timeStepCount_; } +int KynemaUGF::time_index() { return m_sim.timeIntegrator_->timeStepCount_; } -void NaluWind::dump_simulation_time() +void KynemaUGF::dump_simulation_time() { for (auto& realm : m_sim.timeIntegrator_->realmVec_) { realm->dump_simulation_time(); diff --git a/src/NaluWind.h b/src/NaluWind.h index c4eb04a..1b586f9 100644 --- a/src/NaluWind.h +++ b/src/NaluWind.h @@ -1,5 +1,5 @@ -#ifndef NALUWIND_H -#define NALUWIND_H +#ifndef KYNEMAUGF_H +#define KYNEMAUGF_H #include #include @@ -15,7 +15,7 @@ class tioga; namespace exawind { -class NaluWind : public ExawindSolver +class KynemaUGF : public ExawindSolver { private: YAML::Node m_doc; @@ -40,14 +40,14 @@ class NaluWind : public ExawindSolver } return logfile; } - explicit NaluWind( + explicit KynemaUGF( int id, stk::ParallelMachine comm, const YAML::Node& inp_yaml, const std::string& logfile, const std::vector& fnames, TIOGA::tioga& tg); - ~NaluWind(); + ~KynemaUGF(); bool is_unstructured() override { return true; } bool is_amr() override { return false; } bool is_fixed_timestep_size() override; @@ -55,7 +55,7 @@ class NaluWind : public ExawindSolver int time_index() override; std::string identifier() override { - return ("Nalu-Wind-" + std::to_string(m_id)); + return ("Kynema-UGF-" + std::to_string(m_id)); } MPI_Comm comm() override { return m_comm; } int get_ncomps() override { return m_ncomps; } @@ -84,4 +84,4 @@ class NaluWind : public ExawindSolver } // namespace exawind -#endif /* NALUWIND_H */ +#endif /* KYNEMAUGF_H */ diff --git a/src/OversetSimulation.cpp b/src/OversetSimulation.cpp index 5c7cab8..e744104 100644 --- a/src/OversetSimulation.cpp +++ b/src/OversetSimulation.cpp @@ -121,7 +121,7 @@ void OversetSimulation::exchange_solution(bool increment_time) m_tg.dataUpdate_AMR(); } else { const int row_major = 0; - // assuming this pathway is nalu-wind only and all instances have same + // assuming this pathway is kynema-ugf only and all instances have same // number of field components const int ncomps = m_solvers[0]->get_ncomps(); m_tg.dataUpdate(ncomps, row_major); diff --git a/src/OversetSimulation.h b/src/OversetSimulation.h index 25f22e9..d29b4f2 100644 --- a/src/OversetSimulation.h +++ b/src/OversetSimulation.h @@ -19,7 +19,7 @@ class OversetSimulation MPI_Comm m_comm; //! List of solvers active in this overset simulation std::vector> m_solvers; - //! List of start ranks for all nalu-wind instances + //! List of start ranks for all kynema-ugf instances int m_num_nw_solvers; std::vector m_nw_start_rank; //! Flag indicating whether an AMR solver is active @@ -103,7 +103,7 @@ class OversetSimulation //! track memory usage and print to file long mem_usage_all(const int step); - //! set number of nalu-wind instances + //! set number of kynema-ugf instances void set_nw_start_rank(const std::vector& start_ranks) { if (!start_ranks.empty()) { From f5348b1744b2f815529f4c0a9dd8d282745fd394 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 17:07:13 -0600 Subject: [PATCH 02/22] update tests plus a manual change --- src/KynemaUGF.cpp | 8 ++++---- src/NaluWind.cpp | 16 ++++++++-------- .../abl-bndry-input/abl-bndry-input.yaml | 12 ++++++------ ...r-bndry-input.inp => abl-sgf-bndry-input.inp} | 0 ...bl-nalu-box-rst.yaml => abl-ugf-box-rst.yaml} | 0 .../abl-bndry-output/abl-bndry-output.yaml | 12 ++++++------ ...bndry-output.inp => abl-sgf-bndry-output.inp} | 0 .../{abl-nalu-box.yaml => abl-ugf-box.yaml} | 0 .../amr-nalu-cylinder-motion.yaml | 12 ++++++------ .../{cylinder-amr.inp => cylinder-sgf.inp} | 0 .../{cylinder-nalu.yaml => cylinder-ugf.yaml} | 2 +- .../amr-nalu-cylinder/amr-nalu-cylinder.yaml | 12 ++++++------ .../{cylinder-amr.inp => cylinder-sgf.inp} | 0 .../{cylinder-nalu.yaml => cylinder-ugf.yaml} | 2 +- .../ctv/{ctv-amr1.inp => ctv-sgf1.inp} | 0 .../ctv/{ctv-amr2.inp => ctv-sgf2.inp} | 0 .../ctv/{ctv-amr3.inp => ctv-sgf3.inp} | 0 .../ctv/{ctv-nalu1.yaml => ctv-ugf1.yaml} | 0 .../ctv/{ctv-nalu2.yaml => ctv-ugf2.yaml} | 0 .../ctv/{ctv-nalu3.yaml => ctv-ugf3.yaml} | 0 test/test_files/ctv/ctv1.yaml | 12 ++++++------ test/test_files/ctv/ctv2.yaml | 12 ++++++------ test/test_files/ctv/ctv3.yaml | 12 ++++++------ ...eak-block-amr.inp => dam-break-block-sgf.inp} | 0 ...-block-nalu.yaml => dam-break-block-ugf.yaml} | 0 .../dam-break-block/dam-break-block.yaml | 12 ++++++------ ...flat-surface-amr.inp => flat-surface-sgf.inp} | 0 ...t-surface-nalu.yaml => flat-surface-ugf.yaml} | 0 test/test_files/flat-surface/flat-surface.yaml | 12 ++++++------ ...ting-block-amr.inp => floating-block-sgf.inp} | 0 ...g-block-nalu.yaml => floating-block-ugf.yaml} | 0 .../floating-block/floating-block.yaml | 12 ++++++------ .../{cylinder-amr.inp => cylinder-sgf.inp} | 0 .../{cylinder-nalu.yaml => cylinder-ugf.yaml} | 0 .../hybrid-multi-cylinder.yaml | 14 +++++++------- ...linear-waves-amr.inp => linear-waves-sgf.inp} | 0 ...ear-waves-nalu.yaml => linear-waves-ugf.yaml} | 0 test/test_files/linear-waves/linear-waves.yaml | 12 ++++++------ ...inder-nalu-far.yaml => cylinder-ugf-far.yaml} | 0 ...der-nalu-near.yaml => cylinder-ugf-near.yaml} | 2 +- .../nalu-nalu-cylinder-motion.yaml | 8 ++++---- ...inder-nalu-far.yaml => cylinder-ugf-far.yaml} | 0 ...der-nalu-near.yaml => cylinder-ugf-near.yaml} | 2 +- .../nalu-nalu-cylinder/nalu-nalu-cylinder.yaml | 8 ++++---- ...oshing-tank-amr.inp => sloshing-tank-sgf.inp} | 0 ...ing-tank-nalu.yaml => sloshing-tank-ugf.yaml} | 0 test/test_files/sloshing-tank/sloshing-tank.yaml | 12 ++++++------ .../sphere/{sphere-amr.inp => sphere-sgf.inp} | 0 .../sphere/{sphere-nalu.yaml => sphere-ugf.yaml} | 0 ...der-amr.inp => stokes-waves-cylinder-sgf.inp} | 0 ...-nalu.yaml => stokes-waves-cylinder-ugf.yaml} | 0 .../stokes-waves-cylinder.yaml | 12 ++++++------ .../zalesak/{zalesak-amr.inp => zalesak-sgf.inp} | 0 .../{zalesak-nalu.yaml => zalesak-ugf.yaml} | 0 test/test_files/zalesak/zalesak.yaml | 12 ++++++------ 55 files changed, 115 insertions(+), 115 deletions(-) rename test/test_files/abl-bndry-input/{abl-amr-bndry-input.inp => abl-sgf-bndry-input.inp} (100%) rename test/test_files/abl-bndry-input/{abl-nalu-box-rst.yaml => abl-ugf-box-rst.yaml} (100%) rename test/test_files/abl-bndry-output/{abl-amr-bndry-output.inp => abl-sgf-bndry-output.inp} (100%) rename test/test_files/abl-bndry-output/{abl-nalu-box.yaml => abl-ugf-box.yaml} (100%) rename test/test_files/amr-nalu-cylinder-motion/{cylinder-amr.inp => cylinder-sgf.inp} (100%) rename test/test_files/amr-nalu-cylinder-motion/{cylinder-nalu.yaml => cylinder-ugf.yaml} (98%) rename test/test_files/amr-nalu-cylinder/{cylinder-amr.inp => cylinder-sgf.inp} (100%) rename test/test_files/amr-nalu-cylinder/{cylinder-nalu.yaml => cylinder-ugf.yaml} (98%) rename test/test_files/ctv/{ctv-amr1.inp => ctv-sgf1.inp} (100%) rename test/test_files/ctv/{ctv-amr2.inp => ctv-sgf2.inp} (100%) rename test/test_files/ctv/{ctv-amr3.inp => ctv-sgf3.inp} (100%) rename test/test_files/ctv/{ctv-nalu1.yaml => ctv-ugf1.yaml} (100%) rename test/test_files/ctv/{ctv-nalu2.yaml => ctv-ugf2.yaml} (100%) rename test/test_files/ctv/{ctv-nalu3.yaml => ctv-ugf3.yaml} (100%) rename test/test_files/dam-break-block/{dam-break-block-amr.inp => dam-break-block-sgf.inp} (100%) rename test/test_files/dam-break-block/{dam-break-block-nalu.yaml => dam-break-block-ugf.yaml} (100%) rename test/test_files/flat-surface/{flat-surface-amr.inp => flat-surface-sgf.inp} (100%) rename test/test_files/flat-surface/{flat-surface-nalu.yaml => flat-surface-ugf.yaml} (100%) rename test/test_files/floating-block/{floating-block-amr.inp => floating-block-sgf.inp} (100%) rename test/test_files/floating-block/{floating-block-nalu.yaml => floating-block-ugf.yaml} (100%) rename test/test_files/hybrid-multi-cylinder/{cylinder-amr.inp => cylinder-sgf.inp} (100%) rename test/test_files/hybrid-multi-cylinder/{cylinder-nalu.yaml => cylinder-ugf.yaml} (100%) rename test/test_files/linear-waves/{linear-waves-amr.inp => linear-waves-sgf.inp} (100%) rename test/test_files/linear-waves/{linear-waves-nalu.yaml => linear-waves-ugf.yaml} (100%) rename test/test_files/nalu-nalu-cylinder-motion/{cylinder-nalu-far.yaml => cylinder-ugf-far.yaml} (100%) rename test/test_files/nalu-nalu-cylinder-motion/{cylinder-nalu-near.yaml => cylinder-ugf-near.yaml} (98%) rename test/test_files/nalu-nalu-cylinder/{cylinder-nalu-far.yaml => cylinder-ugf-far.yaml} (100%) rename test/test_files/nalu-nalu-cylinder/{cylinder-nalu-near.yaml => cylinder-ugf-near.yaml} (98%) rename test/test_files/sloshing-tank/{sloshing-tank-amr.inp => sloshing-tank-sgf.inp} (100%) rename test/test_files/sloshing-tank/{sloshing-tank-nalu.yaml => sloshing-tank-ugf.yaml} (100%) rename test/test_files/sphere/{sphere-amr.inp => sphere-sgf.inp} (100%) rename test/test_files/sphere/{sphere-nalu.yaml => sphere-ugf.yaml} (100%) rename test/test_files/stokes-waves-cylinder/{stokes-waves-cylinder-amr.inp => stokes-waves-cylinder-sgf.inp} (100%) rename test/test_files/stokes-waves-cylinder/{stokes-waves-cylinder-nalu.yaml => stokes-waves-cylinder-ugf.yaml} (100%) rename test/test_files/zalesak/{zalesak-amr.inp => zalesak-sgf.inp} (100%) rename test/test_files/zalesak/{zalesak-nalu.yaml => zalesak-ugf.yaml} (100%) diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index cfc45c7..f714203 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -1,5 +1,5 @@ #include "KynemaUGF.h" -#include "NaluEnv.h" +#include "KynemaUGFEnv.h" #include "Realm.h" #include "TimeIntegrator.h" #include "overset/ExtOverset.h" @@ -38,7 +38,7 @@ KynemaUGF::KynemaUGF( TIOGA::tioga& tg) : m_doc(inp_yaml), m_sim(m_doc), m_fnames(fnames), m_id(id), m_comm(comm) { - auto& env = sierra::nalu::NaluEnv::self(); + auto& env = sierra::nalu::KynemaUGFEnv::self(); env.parallelCommunicator_ = comm; MPI_Comm_size(comm, &env.pSize_); MPI_Comm_rank(comm, &env.pRank_); @@ -54,10 +54,10 @@ void KynemaUGF::init_prolog(bool multi_solver_mode) { // Dump the input yaml to the start of the logfile // before the nalu banner - auto& env = sierra::nalu::NaluEnv::self(); + auto& env = sierra::nalu::KynemaUGFEnv::self(); env.naluOutputP0() << std::string(20, '#') << " INPUT FILE START " << std::string(20, '#') << std::endl; - sierra::nalu::NaluParsingHelper::emit(*env.naluLogStream_, m_doc); + sierra::nalu::KynemaUGFParsingHelper::emit(*env.naluLogStream_, m_doc); env.naluOutputP0() << std::string(20, '#') << " INPUT FILE END " << std::string(20, '#') << std::endl; diff --git a/src/NaluWind.cpp b/src/NaluWind.cpp index 8de180f..ef1e57c 100644 --- a/src/NaluWind.cpp +++ b/src/NaluWind.cpp @@ -1,5 +1,5 @@ #include "KynemaUGF.h" -#include "NaluEnv.h" +#include "KynemaUGFEnv.h" #include "Realm.h" #include "TimeIntegrator.h" #include "overset/ExtOverset.h" @@ -38,7 +38,7 @@ KynemaUGF::KynemaUGF( TIOGA::tioga& tg) : m_doc(inp_yaml), m_sim(m_doc), m_fnames(fnames), m_id(id), m_comm(comm) { - auto& env = sierra::nalu::NaluEnv::self(); + auto& env = sierra::nalu::KynemaUGFEnv::self(); env.parallelCommunicator_ = comm; MPI_Comm_size(comm, &env.pSize_); MPI_Comm_rank(comm, &env.pRank_); @@ -54,10 +54,10 @@ void KynemaUGF::init_prolog(bool multi_solver_mode) { // Dump the input yaml to the start of the logfile // before the nalu banner - auto& env = sierra::nalu::NaluEnv::self(); + auto& env = sierra::nalu::KynemaUGFEnv::self(); env.naluOutputP0() << std::string(20, '#') << " INPUT FILE START " << std::string(20, '#') << std::endl; - sierra::nalu::NaluParsingHelper::emit(*env.naluLogStream_, m_doc); + sierra::nalu::KynemaUGFParsingHelper::emit(*env.naluLogStream_, m_doc); env.naluOutputP0() << std::string(20, '#') << " INPUT FILE END " << std::string(20, '#') << std::endl; @@ -76,23 +76,23 @@ void KynemaUGF::prepare_solver_prolog() m_sim.timeIntegrator_->prepare_for_time_integration(); } -void NaluWind::prepare_solver_epilog() +void KynemaUGFWind::prepare_solver_epilog() { for (auto* realm : m_sim.timeIntegrator_->realmVec_) realm->output_converged_results(); } -void NaluWind::pre_advance_stage0(size_t inonlin) +void KynemaUGFWind::pre_advance_stage0(size_t inonlin) { m_sim.timeIntegrator_->prepare_time_step(inonlin); } -void NaluWind::pre_advance_stage1(size_t inonlin) +void KynemaUGFWind::pre_advance_stage1(size_t inonlin) { m_sim.timeIntegrator_->pre_realm_advance_stage1(inonlin); } -void NaluWind::pre_advance_stage2(size_t inonlin) +void KynemaUGFWind::pre_advance_stage2(size_t inonlin) { m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); } diff --git a/test/test_files/abl-bndry-input/abl-bndry-input.yaml b/test/test_files/abl-bndry-input/abl-bndry-input.yaml index 7f727d6..78590ff 100644 --- a/test/test_files/abl-bndry-input/abl-bndry-input.yaml +++ b/test/test_files/abl-bndry-input/abl-bndry-input.yaml @@ -1,15 +1,15 @@ exawind: - nalu_wind_inp: - - abl-nalu-box-rst.yaml - amr_wind_inp: abl-amr-bndry-input.inp + kynema_ugf_inp: + - abl-ugf-box-rst.yaml + kynema_sgf_inp: abl-sgf-bndry-input.inp num_timesteps: 5 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/abl-bndry-input/abl-amr-bndry-input.inp b/test/test_files/abl-bndry-input/abl-sgf-bndry-input.inp similarity index 100% rename from test/test_files/abl-bndry-input/abl-amr-bndry-input.inp rename to test/test_files/abl-bndry-input/abl-sgf-bndry-input.inp diff --git a/test/test_files/abl-bndry-input/abl-nalu-box-rst.yaml b/test/test_files/abl-bndry-input/abl-ugf-box-rst.yaml similarity index 100% rename from test/test_files/abl-bndry-input/abl-nalu-box-rst.yaml rename to test/test_files/abl-bndry-input/abl-ugf-box-rst.yaml diff --git a/test/test_files/abl-bndry-output/abl-bndry-output.yaml b/test/test_files/abl-bndry-output/abl-bndry-output.yaml index 06c449b..b013624 100644 --- a/test/test_files/abl-bndry-output/abl-bndry-output.yaml +++ b/test/test_files/abl-bndry-output/abl-bndry-output.yaml @@ -1,15 +1,15 @@ exawind: - nalu_wind_inp: - - abl-nalu-box.yaml - amr_wind_inp: abl-amr-bndry-output.inp + kynema_ugf_inp: + - abl-ugf-box.yaml + kynema_sgf_inp: abl-sgf-bndry-output.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/abl-bndry-output/abl-amr-bndry-output.inp b/test/test_files/abl-bndry-output/abl-sgf-bndry-output.inp similarity index 100% rename from test/test_files/abl-bndry-output/abl-amr-bndry-output.inp rename to test/test_files/abl-bndry-output/abl-sgf-bndry-output.inp diff --git a/test/test_files/abl-bndry-output/abl-nalu-box.yaml b/test/test_files/abl-bndry-output/abl-ugf-box.yaml similarity index 100% rename from test/test_files/abl-bndry-output/abl-nalu-box.yaml rename to test/test_files/abl-bndry-output/abl-ugf-box.yaml diff --git a/test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml b/test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml index 954b4f7..20f022b 100644 --- a/test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml +++ b/test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml @@ -1,17 +1,17 @@ # Example input file exawind: - nalu_wind_inp: - - cylinder-nalu.yaml - amr_wind_inp: cylinder-amr.inp + kynema_ugf_inp: + - cylinder-ugf.yaml + kynema_sgf_inp: cylinder-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/amr-nalu-cylinder-motion/cylinder-amr.inp b/test/test_files/amr-nalu-cylinder-motion/cylinder-sgf.inp similarity index 100% rename from test/test_files/amr-nalu-cylinder-motion/cylinder-amr.inp rename to test/test_files/amr-nalu-cylinder-motion/cylinder-sgf.inp diff --git a/test/test_files/amr-nalu-cylinder-motion/cylinder-nalu.yaml b/test/test_files/amr-nalu-cylinder-motion/cylinder-ugf.yaml similarity index 98% rename from test/test_files/amr-nalu-cylinder-motion/cylinder-nalu.yaml rename to test/test_files/amr-nalu-cylinder-motion/cylinder-ugf.yaml index d0c9c98..679b6e3 100644 --- a/test/test_files/amr-nalu-cylinder-motion/cylinder-nalu.yaml +++ b/test/test_files/amr-nalu-cylinder-motion/cylinder-ugf.yaml @@ -150,7 +150,7 @@ realms: post_processing: - type: surface physics: surface_force_and_moment - output_file_name: nalu_forces.dat + output_file_name: ugf_forces.dat frequency: 1 parameters: [0, 0] target_name: diff --git a/test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml b/test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml index 954b4f7..20f022b 100644 --- a/test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml +++ b/test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml @@ -1,17 +1,17 @@ # Example input file exawind: - nalu_wind_inp: - - cylinder-nalu.yaml - amr_wind_inp: cylinder-amr.inp + kynema_ugf_inp: + - cylinder-ugf.yaml + kynema_sgf_inp: cylinder-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/amr-nalu-cylinder/cylinder-amr.inp b/test/test_files/amr-nalu-cylinder/cylinder-sgf.inp similarity index 100% rename from test/test_files/amr-nalu-cylinder/cylinder-amr.inp rename to test/test_files/amr-nalu-cylinder/cylinder-sgf.inp diff --git a/test/test_files/amr-nalu-cylinder/cylinder-nalu.yaml b/test/test_files/amr-nalu-cylinder/cylinder-ugf.yaml similarity index 98% rename from test/test_files/amr-nalu-cylinder/cylinder-nalu.yaml rename to test/test_files/amr-nalu-cylinder/cylinder-ugf.yaml index 167283a..7f194b3 100644 --- a/test/test_files/amr-nalu-cylinder/cylinder-nalu.yaml +++ b/test/test_files/amr-nalu-cylinder/cylinder-ugf.yaml @@ -132,7 +132,7 @@ realms: post_processing: - type: surface physics: surface_force_and_moment - output_file_name: amr_forces.dat + output_file_name: sgf_forces.dat frequency: 1 parameters: [0, 0] target_name: diff --git a/test/test_files/ctv/ctv-amr1.inp b/test/test_files/ctv/ctv-sgf1.inp similarity index 100% rename from test/test_files/ctv/ctv-amr1.inp rename to test/test_files/ctv/ctv-sgf1.inp diff --git a/test/test_files/ctv/ctv-amr2.inp b/test/test_files/ctv/ctv-sgf2.inp similarity index 100% rename from test/test_files/ctv/ctv-amr2.inp rename to test/test_files/ctv/ctv-sgf2.inp diff --git a/test/test_files/ctv/ctv-amr3.inp b/test/test_files/ctv/ctv-sgf3.inp similarity index 100% rename from test/test_files/ctv/ctv-amr3.inp rename to test/test_files/ctv/ctv-sgf3.inp diff --git a/test/test_files/ctv/ctv-nalu1.yaml b/test/test_files/ctv/ctv-ugf1.yaml similarity index 100% rename from test/test_files/ctv/ctv-nalu1.yaml rename to test/test_files/ctv/ctv-ugf1.yaml diff --git a/test/test_files/ctv/ctv-nalu2.yaml b/test/test_files/ctv/ctv-ugf2.yaml similarity index 100% rename from test/test_files/ctv/ctv-nalu2.yaml rename to test/test_files/ctv/ctv-ugf2.yaml diff --git a/test/test_files/ctv/ctv-nalu3.yaml b/test/test_files/ctv/ctv-ugf3.yaml similarity index 100% rename from test/test_files/ctv/ctv-nalu3.yaml rename to test/test_files/ctv/ctv-ugf3.yaml diff --git a/test/test_files/ctv/ctv1.yaml b/test/test_files/ctv/ctv1.yaml index b0b990e..f3981b8 100644 --- a/test/test_files/ctv/ctv1.yaml +++ b/test/test_files/ctv/ctv1.yaml @@ -1,17 +1,17 @@ exawind: - nalu_wind_inp: - - ctv-nalu1.yaml - amr_wind_inp: ctv-amr1.inp + kynema_ugf_inp: + - ctv-ugf1.yaml + kynema_sgf_inp: ctv-sgf1.inp num_timesteps: 10 additional_picard_iterations: 4 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/ctv/ctv2.yaml b/test/test_files/ctv/ctv2.yaml index 8a6cb69..b5292a3 100644 --- a/test/test_files/ctv/ctv2.yaml +++ b/test/test_files/ctv/ctv2.yaml @@ -1,17 +1,17 @@ exawind: - nalu_wind_inp: - - ctv-nalu2.yaml - amr_wind_inp: ctv-amr2.inp + kynema_ugf_inp: + - ctv-ugf2.yaml + kynema_sgf_inp: ctv-sgf2.inp num_timesteps: 10 additional_picard_iterations: 4 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/ctv/ctv3.yaml b/test/test_files/ctv/ctv3.yaml index 901cc9a..4b26792 100644 --- a/test/test_files/ctv/ctv3.yaml +++ b/test/test_files/ctv/ctv3.yaml @@ -1,17 +1,17 @@ exawind: - nalu_wind_inp: - - ctv-nalu3.yaml - amr_wind_inp: ctv-amr3.inp + kynema_ugf_inp: + - ctv-ugf3.yaml + kynema_sgf_inp: ctv-sgf3.inp num_timesteps: 10 additional_picard_iterations: 4 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/dam-break-block/dam-break-block-amr.inp b/test/test_files/dam-break-block/dam-break-block-sgf.inp similarity index 100% rename from test/test_files/dam-break-block/dam-break-block-amr.inp rename to test/test_files/dam-break-block/dam-break-block-sgf.inp diff --git a/test/test_files/dam-break-block/dam-break-block-nalu.yaml b/test/test_files/dam-break-block/dam-break-block-ugf.yaml similarity index 100% rename from test/test_files/dam-break-block/dam-break-block-nalu.yaml rename to test/test_files/dam-break-block/dam-break-block-ugf.yaml diff --git a/test/test_files/dam-break-block/dam-break-block.yaml b/test/test_files/dam-break-block/dam-break-block.yaml index 4219df3..46f2fa6 100644 --- a/test/test_files/dam-break-block/dam-break-block.yaml +++ b/test/test_files/dam-break-block/dam-break-block.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - dam-break-block-nalu.yaml - amr_wind_inp: dam-break-block-amr.inp + kynema_ugf_inp: + - dam-break-block-ugf.yaml + kynema_sgf_inp: dam-break-block-sgf.inp max_time: 0.047 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/flat-surface/flat-surface-amr.inp b/test/test_files/flat-surface/flat-surface-sgf.inp similarity index 100% rename from test/test_files/flat-surface/flat-surface-amr.inp rename to test/test_files/flat-surface/flat-surface-sgf.inp diff --git a/test/test_files/flat-surface/flat-surface-nalu.yaml b/test/test_files/flat-surface/flat-surface-ugf.yaml similarity index 100% rename from test/test_files/flat-surface/flat-surface-nalu.yaml rename to test/test_files/flat-surface/flat-surface-ugf.yaml diff --git a/test/test_files/flat-surface/flat-surface.yaml b/test/test_files/flat-surface/flat-surface.yaml index 70fb40a..6ec07ca 100644 --- a/test/test_files/flat-surface/flat-surface.yaml +++ b/test/test_files/flat-surface/flat-surface.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - flat-surface-nalu.yaml - amr_wind_inp: flat-surface-amr.inp + kynema_ugf_inp: + - flat-surface-ugf.yaml + kynema_sgf_inp: flat-surface-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/floating-block/floating-block-amr.inp b/test/test_files/floating-block/floating-block-sgf.inp similarity index 100% rename from test/test_files/floating-block/floating-block-amr.inp rename to test/test_files/floating-block/floating-block-sgf.inp diff --git a/test/test_files/floating-block/floating-block-nalu.yaml b/test/test_files/floating-block/floating-block-ugf.yaml similarity index 100% rename from test/test_files/floating-block/floating-block-nalu.yaml rename to test/test_files/floating-block/floating-block-ugf.yaml diff --git a/test/test_files/floating-block/floating-block.yaml b/test/test_files/floating-block/floating-block.yaml index 4ea448c..04347df 100644 --- a/test/test_files/floating-block/floating-block.yaml +++ b/test/test_files/floating-block/floating-block.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - floating-block-nalu.yaml - amr_wind_inp: floating-block-amr.inp + kynema_ugf_inp: + - floating-block-ugf.yaml + kynema_sgf_inp: floating-block-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/hybrid-multi-cylinder/cylinder-amr.inp b/test/test_files/hybrid-multi-cylinder/cylinder-sgf.inp similarity index 100% rename from test/test_files/hybrid-multi-cylinder/cylinder-amr.inp rename to test/test_files/hybrid-multi-cylinder/cylinder-sgf.inp diff --git a/test/test_files/hybrid-multi-cylinder/cylinder-nalu.yaml b/test/test_files/hybrid-multi-cylinder/cylinder-ugf.yaml similarity index 100% rename from test/test_files/hybrid-multi-cylinder/cylinder-nalu.yaml rename to test/test_files/hybrid-multi-cylinder/cylinder-ugf.yaml diff --git a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml index 298587e..5e474ba 100644 --- a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml +++ b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml @@ -3,7 +3,7 @@ exawind: # we can change things globally across all instances by providing a trace through # the graph to the end values we want to edit - nalu_replace_all: + ugf_replace_all: realms: - name: replaced boundary_conditions: @@ -13,11 +13,11 @@ exawind: - overset_boundary_condition: changed_overset_name Time_Integrators: [ StandardTimeIntegrator: { realms: [replaced]}] - nalu_wind_inp: + kynema_ugf_inp: ################ # front cylinder ################ - - base_input_file: cylinder-nalu.yaml + - base_input_file: cylinder-ugf.yaml logfile: stationary_front_cylinder.log # set this value if you want to write the final nalu instances to disk write_final_yaml_to_disk: true @@ -41,15 +41,15 @@ exawind: - post_processing: [{output_file_name: back_forces.dat}] output: {output_data_base_name: out/back-cylinder.e} - amr_wind_inp: cylinder-amr.inp + kynema_sgf_inp: cylinder-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/linear-waves/linear-waves-amr.inp b/test/test_files/linear-waves/linear-waves-sgf.inp similarity index 100% rename from test/test_files/linear-waves/linear-waves-amr.inp rename to test/test_files/linear-waves/linear-waves-sgf.inp diff --git a/test/test_files/linear-waves/linear-waves-nalu.yaml b/test/test_files/linear-waves/linear-waves-ugf.yaml similarity index 100% rename from test/test_files/linear-waves/linear-waves-nalu.yaml rename to test/test_files/linear-waves/linear-waves-ugf.yaml diff --git a/test/test_files/linear-waves/linear-waves.yaml b/test/test_files/linear-waves/linear-waves.yaml index 124f194..db613a4 100644 --- a/test/test_files/linear-waves/linear-waves.yaml +++ b/test/test_files/linear-waves/linear-waves.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - linear-waves-nalu.yaml - amr_wind_inp: linear-waves-amr.inp + kynema_ugf_inp: + - linear-waves-ugf.yaml + kynema_sgf_inp: linear-waves-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/nalu-nalu-cylinder-motion/cylinder-nalu-far.yaml b/test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-far.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder-motion/cylinder-nalu-far.yaml rename to test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-far.yaml diff --git a/test/test_files/nalu-nalu-cylinder-motion/cylinder-nalu-near.yaml b/test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-near.yaml similarity index 98% rename from test/test_files/nalu-nalu-cylinder-motion/cylinder-nalu-near.yaml rename to test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-near.yaml index d0c9c98..679b6e3 100644 --- a/test/test_files/nalu-nalu-cylinder-motion/cylinder-nalu-near.yaml +++ b/test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-near.yaml @@ -150,7 +150,7 @@ realms: post_processing: - type: surface physics: surface_force_and_moment - output_file_name: nalu_forces.dat + output_file_name: ugf_forces.dat frequency: 1 parameters: [0, 0] target_name: diff --git a/test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml b/test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml index 0592760..3338063 100644 --- a/test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml +++ b/test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml @@ -1,13 +1,13 @@ # Example input file exawind: - nalu_wind_inp: - - cylinder-nalu-far.yaml - - cylinder-nalu-near.yaml + kynema_ugf_inp: + - cylinder-ugf-far.yaml + - cylinder-ugf-near.yaml num_timesteps: 10 additional_picard_iterations: 2 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure diff --git a/test/test_files/nalu-nalu-cylinder/cylinder-nalu-far.yaml b/test/test_files/nalu-nalu-cylinder/cylinder-ugf-far.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder/cylinder-nalu-far.yaml rename to test/test_files/nalu-nalu-cylinder/cylinder-ugf-far.yaml diff --git a/test/test_files/nalu-nalu-cylinder/cylinder-nalu-near.yaml b/test/test_files/nalu-nalu-cylinder/cylinder-ugf-near.yaml similarity index 98% rename from test/test_files/nalu-nalu-cylinder/cylinder-nalu-near.yaml rename to test/test_files/nalu-nalu-cylinder/cylinder-ugf-near.yaml index 4cce2f8..4869ea6 100644 --- a/test/test_files/nalu-nalu-cylinder/cylinder-nalu-near.yaml +++ b/test/test_files/nalu-nalu-cylinder/cylinder-ugf-near.yaml @@ -132,7 +132,7 @@ realms: post_processing: - type: surface physics: surface_force_and_moment - output_file_name: nalu_forces.dat + output_file_name: ugf_forces.dat frequency: 1 parameters: [0, 0] target_name: diff --git a/test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml b/test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml index 0592760..3338063 100644 --- a/test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml +++ b/test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml @@ -1,13 +1,13 @@ # Example input file exawind: - nalu_wind_inp: - - cylinder-nalu-far.yaml - - cylinder-nalu-near.yaml + kynema_ugf_inp: + - cylinder-ugf-far.yaml + - cylinder-ugf-near.yaml num_timesteps: 10 additional_picard_iterations: 2 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure diff --git a/test/test_files/sloshing-tank/sloshing-tank-amr.inp b/test/test_files/sloshing-tank/sloshing-tank-sgf.inp similarity index 100% rename from test/test_files/sloshing-tank/sloshing-tank-amr.inp rename to test/test_files/sloshing-tank/sloshing-tank-sgf.inp diff --git a/test/test_files/sloshing-tank/sloshing-tank-nalu.yaml b/test/test_files/sloshing-tank/sloshing-tank-ugf.yaml similarity index 100% rename from test/test_files/sloshing-tank/sloshing-tank-nalu.yaml rename to test/test_files/sloshing-tank/sloshing-tank-ugf.yaml diff --git a/test/test_files/sloshing-tank/sloshing-tank.yaml b/test/test_files/sloshing-tank/sloshing-tank.yaml index 7f1f6ac..d674e56 100644 --- a/test/test_files/sloshing-tank/sloshing-tank.yaml +++ b/test/test_files/sloshing-tank/sloshing-tank.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - sloshing-tank-nalu.yaml - amr_wind_inp: sloshing-tank-amr.inp + kynema_ugf_inp: + - sloshing-tank-ugf.yaml + kynema_sgf_inp: sloshing-tank-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/sphere/sphere-amr.inp b/test/test_files/sphere/sphere-sgf.inp similarity index 100% rename from test/test_files/sphere/sphere-amr.inp rename to test/test_files/sphere/sphere-sgf.inp diff --git a/test/test_files/sphere/sphere-nalu.yaml b/test/test_files/sphere/sphere-ugf.yaml similarity index 100% rename from test/test_files/sphere/sphere-nalu.yaml rename to test/test_files/sphere/sphere-ugf.yaml diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-sgf.inp similarity index 100% rename from test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp rename to test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-sgf.inp diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-ugf.yaml similarity index 100% rename from test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml rename to test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-ugf.yaml diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml index 9de34d1..496d41c 100644 --- a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml +++ b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml @@ -1,19 +1,19 @@ exawind: - nalu_wind_inp: - - stokes-waves-cylinder-nalu.yaml - amr_wind_inp: stokes-waves-cylinder-amr.inp + kynema_ugf_inp: + - stokes-waves-cylinder-ugf.yaml + kynema_sgf_inp: stokes-waves-cylinder-sgf.inp num_timesteps: 10 additional_picard_iterations: 1 - nalu_vars: + ugf_vars: - volume_of_fluid - velocity - density - pressure - amr_cell_vars: + sgf_cell_vars: - vof - velocity - density - amr_node_vars: + sgf_node_vars: - p diff --git a/test/test_files/zalesak/zalesak-amr.inp b/test/test_files/zalesak/zalesak-sgf.inp similarity index 100% rename from test/test_files/zalesak/zalesak-amr.inp rename to test/test_files/zalesak/zalesak-sgf.inp diff --git a/test/test_files/zalesak/zalesak-nalu.yaml b/test/test_files/zalesak/zalesak-ugf.yaml similarity index 100% rename from test/test_files/zalesak/zalesak-nalu.yaml rename to test/test_files/zalesak/zalesak-ugf.yaml diff --git a/test/test_files/zalesak/zalesak.yaml b/test/test_files/zalesak/zalesak.yaml index 2d8fabd..299e210 100644 --- a/test/test_files/zalesak/zalesak.yaml +++ b/test/test_files/zalesak/zalesak.yaml @@ -1,13 +1,13 @@ exawind: - nalu_wind_inp: - - zalesak-nalu.yaml - amr_wind_inp: zalesak-amr.inp + kynema_ugf_inp: + - zalesak-ugf.yaml + kynema_sgf_inp: zalesak-sgf.inp num_timesteps: 10 additional_picard_iterations: 2 - nalu_vars: + ugf_vars: - volume_of_fluid - amr_cell_vars: + sgf_cell_vars: - vof - amr_node_vars: [] + sgf_node_vars: [] From 175354f179762355dd4b62397b11b0914053d35e Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 17:19:57 -0600 Subject: [PATCH 03/22] more stuff --- CMakeLists.txt | 6 +- README.md | 2 +- app/exawind/exawind.cpp | 136 +++++++++--------- src/AMRTiogaIface.cpp | 6 +- src/AMRTiogaIface.h | 6 +- src/AMRWind.cpp | 54 +++---- src/AMRWind.h | 8 +- src/CMakeLists.txt | 10 +- src/KynemaSGF.cpp | 131 +++++++++++++++++ src/KynemaSGF.h | 58 ++++++++ src/OversetSimulation.h | 12 +- .../nalu-nalu-panel/nalu-nalu-panel.yaml | 4 +- test/test_files/sphere/sphere.yaml | 12 +- 13 files changed, 317 insertions(+), 128 deletions(-) create mode 100644 src/KynemaSGF.cpp create mode 100644 src/KynemaSGF.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cbc8db..07a4655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) option(EXAWIND_ENABLE_TESTS "Enable testing suite" ON) -option(EXAWIND_TEST_WITH_FCOMPARE "Check AMR-Wind test plots against gold files" OFF) +option(EXAWIND_TEST_WITH_FCOMPARE "Check Kynema-SGF test plots against gold files" OFF) option(EXAWIND_SAVE_GOLDS "Provide a directory in which to save golds during testing" OFF) option(EXAWIND_ENABLE_CUDA "Enable CUDA" OFF) option(EXAWIND_ENABLE_CUDA_RDC "Enable CUDA relocatable device code" OFF) @@ -36,13 +36,13 @@ if (EXAWIND_ENABLE_UMPIRE) include_directories(SYSTEM ${UMPIRE_INCLUDE_DIRS}) endif() -set(CMAKE_PREFIX_PATH ${Kynema-UGF_DIR} ${Trilinos_DIR} ${AMR-Wind_DIR} +set(CMAKE_PREFIX_PATH ${Kynema-UGF_DIR} ${Trilinos_DIR} ${Kynema-SGF_DIR} ${OpenFAST_DIR} ${TIOGA_DIR} ${YAML-CPP_DIR} ${CMAKE_PREFIX_PATH}) find_package(Kynema-UGF REQUIRED) find_package(Trilinos REQUIRED) -find_package(AMR-Wind REQUIRED) +find_package(Kynema-SGF REQUIRED) if(NALU_USES_OPENFAST) enable_language(Fortran) find_package(OpenFAST REQUIRED) diff --git a/README.md b/README.md index 94ac9db..c78077a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This repository contains a pure C++ driver API for coupling [Kynema-UGF](https://github.com/exawind/nalu-wind) and -[AMR-Wind](https://github.com/exawind/amr-wind) CFD codes. +[Kynema-SGF](https://github.com/exawind/amr-wind) CFD codes. ## Citation diff --git a/app/exawind/exawind.cpp b/app/exawind/exawind.cpp index 57b4fe2..fd4bf7c 100644 --- a/app/exawind/exawind.cpp +++ b/app/exawind/exawind.cpp @@ -1,4 +1,4 @@ -#include "AMRWind.h" +#include "KynemaSGF.h" #include "KynemaUGF.h" #include "OversetSimulation.h" #include "MPIUtilities.h" @@ -15,11 +15,11 @@ static std::string usage(std::string name) { return "usage: " + name + - " [--awind NPROCS] [--nwind NPROCS] input_file\n" + + " [--sgf NPROCS] [--ugf NPROCS] input_file\n" + "\t-h,--help\t\tShow this help message\n" + - "\t--awind NPROCS\t\tNumber of ranks for AMR-Wind (default = all " + "\t--sgf NPROCS\t\tNumber of ranks for Kynema-SGF (default = all " "ranks)\n" + - "\t--nwind NPROCS\t\tNumber of ranks for Kynema-UGF (default = all " + "\t--ugf NPROCS\t\tNumber of ranks for Kynema-UGF (default = all " "ranks)\n"; } @@ -50,8 +50,8 @@ int main(int argc, char** argv) throw std::runtime_error(usage(argv[0])); } - int num_nwind_ranks = psize; - int num_awind_ranks = psize; + int num_ugf_ranks = psize; + int num_sgf_ranks = psize; std::string inpfile = ""; for (int i = 1; i < argc; ++i) { @@ -59,29 +59,29 @@ int main(int argc, char** argv) if ((arg == "-h") || (arg == "--help")) { if (prank == 0) std::cout << usage(argv[0]); return 0; - } else if (arg == "--awind") { + } else if (arg == "--sgf") { if (i + 1 < argc) { std::string opt = argv[++i]; - num_awind_ranks = std::stoi(opt); - if (num_awind_ranks > psize) { + num_sgf_ranks = std::stoi(opt); + if (num_sgf_ranks > psize) { throw std::runtime_error( - "--awind option requesting more ranks than available."); + "--sgf option requesting more ranks than available."); } } else { throw std::runtime_error( - "--awind option requires one argument."); + "--sgf option requires one argument."); } - } else if (arg == "--nwind") { + } else if (arg == "--ugf") { if (i + 1 < argc) { std::string opt = argv[++i]; - num_nwind_ranks = std::stoi(opt); - if (num_nwind_ranks > psize) { + num_ugf_ranks = std::stoi(opt); + if (num_ugf_ranks > psize) { throw std::runtime_error( - "--nwind option requesting more ranks than available."); + "--ugf option requesting more ranks than available."); } } else { throw std::runtime_error( - "--nwind option requires one argument."); + "--ugf option requires one argument."); } } else { inpfile = argv[i]; @@ -90,76 +90,76 @@ int main(int argc, char** argv) const YAML::Node doc(YAML::LoadFile(inpfile)); const YAML::Node node = doc["exawind"]; - std::string amr_inp = "dummy"; - bool use_amr_wind = false; - if (node["amr_wind_inp"]) { - amr_inp = node["amr_wind_inp"].as(); - use_amr_wind = true; + std::string sgf_inp = "dummy"; + bool use_kynema_sgf = false; + if (node["kynema_sgf_inp"]) { + sgf_inp = node["kynema_sgf_inp"].as(); + use_kynema_sgf = true; } - const std::string amr_log = replace_extension(amr_inp, ".log"); + const std::string sgf_log = replace_extension(sgf_inp, ".log"); std::ofstream out; - YAML::Node kynema_ugf_node = node["nalu_wind_inp"]; + YAML::Node kynema_ugf_node = node["kynema_ugf_inp"]; // make sure it is a list for now assert(kynema_ugf_node.IsSequence()); - const int num_nwsolvers = kynema_ugf_node.size(); - if (num_nwind_ranks < num_nwsolvers) { + const int num_ugf_solvers = kynema_ugf_node.size(); + if (num_ugf_ranks < num_ugf_solvers) { throw std::runtime_error( "Number of Kynema-UGF ranks is less than the number of Kynema-UGF " "solvers. Please have at least one rank per solver."); } - std::vector num_nw_solver_ranks; - if (node["nalu_wind_procs"]) { - num_nw_solver_ranks = node["nalu_wind_procs"].as>(); - if (static_cast(num_nw_solver_ranks.size()) != num_nwsolvers) { + std::vector num_ugf_solver_ranks; + if (node["ugf_procs"]) { + num_ugf_solver_ranks = node["ugf_procs"].as>(); + if (static_cast(num_ugf_solver_ranks.size()) != num_ugf_solvers) { throw std::runtime_error( "Number of Kynema-UGF rank specifications is less than the " " number of Kynema-UGF solvers. Please have one rank count " "specification per solver"); } - const int tot_num_nw_ranks = std::accumulate( - num_nw_solver_ranks.begin(), num_nw_solver_ranks.end(), 0); - if (tot_num_nw_ranks != num_nwind_ranks) { + const int tot_num_ugf_ranks = std::accumulate( + num_ugf_solver_ranks.begin(), num_ugf_solver_ranks.end(), 0); + if (tot_num_ugf_ranks != num_ugf_ranks) { throw std::runtime_error( "Total number of Kynema-UGF ranks does not " "match that given in the command line. Please ensure " "they match"); } } else { - const int ranks_per_nw_solver = num_nwind_ranks / num_nwsolvers; - num_nw_solver_ranks = - std::vector(num_nwsolvers, ranks_per_nw_solver); - const int remainder = num_nwind_ranks % num_nwsolvers; + const int ranks_per_ugf_solver = num_ugf_ranks / num_ugf_solvers; + num_ugf_solver_ranks = + std::vector(num_ugf_solvers, ranks_per_ugf_solver); + const int remainder = num_ugf_ranks % num_ugf_solvers; if (remainder != 0) { std::fill( - num_nw_solver_ranks.begin() + num_nwsolvers - remainder, - num_nw_solver_ranks.end(), ranks_per_nw_solver + 1); + num_ugf_solver_ranks.begin() + num_ugf_solvers - remainder, + num_ugf_solver_ranks.end(), ranks_per_ugf_solver + 1); } } - if (!use_amr_wind) { - num_awind_ranks = 0; + if (!use_kynema_sgf) { + num_sgf_ranks = 0; } - if (num_awind_ranks + num_nwind_ranks < psize) { + if (num_sgf_ranks + num_ugf_ranks < psize) { if (prank == 0) throw std::runtime_error( "Abort: using fewer ranks than available ranks: MPI " "size = " + std::to_string(psize) + "; Num ranks used = " + - std::to_string(num_awind_ranks + num_nwind_ranks)); + std::to_string(num_sgf_ranks + num_ugf_ranks)); } - MPI_Comm amr_comm = - use_amr_wind - ? exawind::create_subcomm(MPI_COMM_WORLD, num_awind_ranks, 0) + MPI_Comm sgf_comm = + use_kynema_sgf + ? exawind::create_subcomm(MPI_COMM_WORLD, num_sgf_ranks, 0) : MPI_COMM_NULL; std::vector kynema_ugf_comms; std::vector kynema_ugf_start_rank; - int start = psize - num_nwind_ranks; - for (const auto& nr : num_nw_solver_ranks) { + int start = psize - num_ugf_ranks; + for (const auto& nr : num_ugf_solver_ranks) { kynema_ugf_start_rank.push_back(start); kynema_ugf_comms.push_back( exawind::create_subcomm(MPI_COMM_WORLD, nr, start)); @@ -167,25 +167,25 @@ int main(int argc, char** argv) } exawind::OversetSimulation sim(MPI_COMM_WORLD); - if (amr_comm != MPI_COMM_NULL) { + if (sgf_comm != MPI_COMM_NULL) { sim.echo( - "Initializing AMR-Wind on " + std::to_string(num_awind_ranks) + + "Initializing Kynema-SGF on " + std::to_string(num_sgf_ranks) + " MPI ranks"); - out.open(amr_log); - exawind::AMRWind::initialize(amr_comm, amr_inp, out); + out.open(sgf_log); + exawind::KynemaSGF::initialize(sgf_comm, sgf_inp, out); } sim.echo( - "Initializing " + std::to_string(num_nwsolvers) + + "Initializing " + std::to_string(num_ugf_solvers) + " Kynema-UGF solvers, equally partitioned on a total of " + - std::to_string(num_nwind_ranks) + " MPI ranks"); + std::to_string(num_ugf_ranks) + " MPI ranks"); if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { return comm != MPI_COMM_NULL; })) { exawind::KynemaUGF::initialize(); } - sim.set_nw_start_rank(kynema_ugf_start_rank); + sim.set_ugf_start_rank(kynema_ugf_start_rank); - const auto nalu_vars = node["nalu_vars"].as>(); + const auto ugf_vars = node["ugf_vars"].as>(); const int num_timesteps = node["num_timesteps"] ? node["num_timesteps"].as() : -1; const double max_time = @@ -232,11 +232,11 @@ int main(int argc, char** argv) } } - 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) { + const YAML::Node yaml_replace_all = node["ugf_replace_all"]; + for (int i = 0; i < num_ugf_solvers; i++) { + if (kynema_ugf_comms.at(i) != MPI_COMM_NULL) { YAML::Node yaml_replace_instance; - YAML::Node this_instance = nalu_node[i]; + YAML::Node this_instance = kynema_ugf_node[i]; std::string kynema_ugf_inpfile, logfile; bool write_final_yaml_to_disk = false; @@ -284,17 +284,17 @@ int main(int argc, char** argv) } sim.register_solver( - i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, nalu_vars); + i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, ugf_vars); } } - if (amr_comm != MPI_COMM_NULL) { - const auto amr_cvars = - node["amr_cell_vars"].as>(); - const auto amr_nvars = - node["amr_node_vars"].as>(); + if (sgf_comm != MPI_COMM_NULL) { + const auto sgf_cvars = + node["sgf_cell_vars"].as>(); + const auto sgf_nvars = + node["sgf_node_vars"].as>(); - sim.register_solver(amr_cvars, amr_nvars); + sim.register_solver(sgf_cvars, sgf_nvars); } sim.echo("Initializing overset simulation"); @@ -304,8 +304,8 @@ int main(int argc, char** argv) additional_picard_its, nonlinear_its, num_timesteps, max_time); sim.delete_solvers(); - if (amr_comm != MPI_COMM_NULL) { - exawind::AMRWind::finalize(); + if (sgf_comm != MPI_COMM_NULL) { + exawind::KynemaSGF::finalize(); out.close(); } if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { diff --git a/src/AMRTiogaIface.cpp b/src/AMRTiogaIface.cpp index d339c6a..fe04f2a 100644 --- a/src/AMRTiogaIface.cpp +++ b/src/AMRTiogaIface.cpp @@ -20,7 +20,7 @@ void amr_to_tioga(T1& lhs, T2& rhs) } // namespace -AMRTiogaIface::AMRTiogaIface(amr_wind::CFDSim& sim, TIOGA::tioga& tg) +AMRTiogaIface::AMRTiogaIface(kynema_sgf::CFDSim& sim, TIOGA::tioga& tg) : m_sim(sim), m_tg(tg), m_info(new TIOGA::AMRMeshInfo) {} @@ -41,7 +41,7 @@ void AMRTiogaIface::register_mesh() const int num_ghost = m_sim.pde_manager().num_ghost_state(); auto* amr_tg_iface = - dynamic_cast(m_sim.overset_manager()); + dynamic_cast(m_sim.overset_manager()); if (amr_tg_iface == nullptr) { amrex::Abort("Dynamic cast to TiogaInterface failed"); return; @@ -78,7 +78,7 @@ void AMRTiogaIface::register_solution( const std::vector& node_vars) { auto* amr_tg_iface = - dynamic_cast(m_sim.overset_manager()); + dynamic_cast(m_sim.overset_manager()); if (amr_tg_iface == nullptr) { amrex::Abort("Dynamic cast to TiogaInterface failed"); return; diff --git a/src/AMRTiogaIface.h b/src/AMRTiogaIface.h index 3c80a85..fbcf4ff 100644 --- a/src/AMRTiogaIface.h +++ b/src/AMRTiogaIface.h @@ -4,7 +4,7 @@ #include #include -namespace amr_wind { +namespace kynema_sgf { class CFDSim; } @@ -18,7 +18,7 @@ namespace exawind { class AMRTiogaIface { public: - AMRTiogaIface(amr_wind::CFDSim&, TIOGA::tioga& tg); + AMRTiogaIface(kynema_sgf::CFDSim&, TIOGA::tioga& tg); void pre_overset_conn_work(); @@ -33,7 +33,7 @@ class AMRTiogaIface void update_solution(); private: - amr_wind::CFDSim& m_sim; + kynema_sgf::CFDSim& m_sim; TIOGA::tioga& m_tg; std::unique_ptr m_info; diff --git a/src/AMRWind.cpp b/src/AMRWind.cpp index e1c5ec0..dc816ee 100644 --- a/src/AMRWind.cpp +++ b/src/AMRWind.cpp @@ -1,4 +1,4 @@ -#include "AMRWind.h" +#include "KynemaSGF.h" #include "amr-wind/incflo.H" #include "amr-wind/CFDSim.H" #include "amr-wind/core/SimTime.H" @@ -10,13 +10,13 @@ namespace exawind { -void AMRWind::initialize( +void KynemaSGF::initialize( MPI_Comm comm, const std::string& inpfile, std::ofstream& out) { int argc = 2; char** argv = new char*[argc]; - const char* exename = "amr_wind"; + const char* exename = "kynema_sgf"; argv[0] = const_cast(exename); argv[1] = const_cast(inpfile.c_str()); @@ -33,14 +33,14 @@ void AMRWind::initialize( }, out, out); - amr_wind::io::print_banner(comm, amrex::OutStream()); + kynema_sgf::io::print_banner(comm, amrex::OutStream()); delete[] argv; } -void AMRWind::finalize() { amrex::Finalize(); } +void KynemaSGF::finalize() { amrex::Finalize(); } -AMRWind::AMRWind( +KynemaSGF::KynemaSGF( const std::vector& cell_vars, const std::vector& node_vars, TIOGA::tioga& tg) @@ -53,24 +53,24 @@ AMRWind::AMRWind( m_incflo.sim().activate_overset(); } -AMRWind::~AMRWind() = default; +KynemaSGF::~KynemaSGF() = default; -void AMRWind::init_prolog(bool) +void KynemaSGF::init_prolog(bool) { m_incflo.init_mesh(); - m_incflo.init_amr_wind_modules(); + m_incflo.init_kynema_sgf_modules(); } -void AMRWind::init_epilog() {} +void KynemaSGF::init_epilog() {} -void AMRWind::prepare_solver_prolog() {} +void KynemaSGF::prepare_solver_prolog() {} -void AMRWind::prepare_solver_epilog() +void KynemaSGF::prepare_solver_epilog() { m_incflo.prepare_for_time_integration(); } -void AMRWind::pre_advance_stage0(size_t inonlin) +void KynemaSGF::pre_advance_stage0(size_t inonlin) { if (inonlin < 1) { m_incflo.sim().time().new_timestep(); @@ -79,53 +79,53 @@ void AMRWind::pre_advance_stage0(size_t inonlin) } } -void AMRWind::pre_advance_stage1(size_t inonlin) +void KynemaSGF::pre_advance_stage1(size_t inonlin) { if (inonlin < 1) { m_incflo.pre_advance_stage1(); } } -void AMRWind::pre_advance_stage2(size_t inonlin) +void KynemaSGF::pre_advance_stage2(size_t inonlin) { if (inonlin < 1) m_incflo.pre_advance_stage2(); } -double AMRWind::get_time() { return m_incflo.time().new_time(); } +double KynemaSGF::get_time() { return m_incflo.time().new_time(); } -double AMRWind::get_timestep_size() { return m_incflo.time().delta_t(); } +double KynemaSGF::get_timestep_size() { return m_incflo.time().delta_t(); } -void AMRWind::set_timestep_size(const double dt) +void KynemaSGF::set_timestep_size(const double dt) { m_incflo.sim().time().delta_t() = dt; } -bool AMRWind::is_fixed_timestep_size() +bool KynemaSGF::is_fixed_timestep_size() { return (!m_incflo.sim().time().adaptive_timestep()); } -void AMRWind::advance_timestep(size_t inonlin) { m_incflo.do_advance(inonlin); } +void KynemaSGF::advance_timestep(size_t inonlin) { m_incflo.do_advance(inonlin); } -void AMRWind::post_advance() { m_incflo.post_advance_work(); } +void KynemaSGF::post_advance() { m_incflo.post_advance_work(); } -void AMRWind::pre_overset_conn_work() { m_tgiface.pre_overset_conn_work(); } +void KynemaSGF::pre_overset_conn_work() { m_tgiface.pre_overset_conn_work(); } -void AMRWind::post_overset_conn_work() { m_tgiface.post_overset_conn_work(); } +void KynemaSGF::post_overset_conn_work() { m_tgiface.post_overset_conn_work(); } -void AMRWind::register_solution() +void KynemaSGF::register_solution() { m_tgiface.register_solution(m_cell_vars, m_node_vars); } -void AMRWind::update_solution() { m_tgiface.update_solution(); } +void KynemaSGF::update_solution() { m_tgiface.update_solution(); } -int AMRWind::overset_update_interval() +int KynemaSGF::overset_update_interval() { const int regrid_int = m_incflo.sim().time().regrid_interval(); return regrid_int > 0 ? regrid_int : 100000000; } -int AMRWind::time_index() { return m_incflo.sim().time().time_index(); } +int KynemaSGF::time_index() { return m_incflo.sim().time().time_index(); } } // namespace exawind diff --git a/src/AMRWind.h b/src/AMRWind.h index 85f1a9b..e7e4c90 100644 --- a/src/AMRWind.h +++ b/src/AMRWind.h @@ -8,7 +8,7 @@ class tioga; namespace exawind { -class AMRWind : public ExawindSolver +class KynemaSGF : public ExawindSolver { private: incflo m_incflo; @@ -20,17 +20,17 @@ class AMRWind : public ExawindSolver static void initialize(MPI_Comm comm, const std::string& inpfile, std::ofstream& out); static void finalize(); - explicit AMRWind( + explicit KynemaSGF( const std::vector&, const std::vector&, TIOGA::tioga&); - ~AMRWind(); + ~KynemaSGF(); bool is_unstructured() override { return false; } bool is_amr() override { return true; } bool is_fixed_timestep_size() override; int overset_update_interval() override; int time_index() override; - std::string identifier() override { return "AMR-Wind"; } + std::string identifier() override { return "Kynema-SGF"; } MPI_Comm comm() override { return m_comm; } protected: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b182ace..6a0b491 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,8 @@ target_sources(${EXAWIND_LIB_NAME} PRIVATE AMRTiogaIface.cpp AMRTiogaIface.h - AMRWind.cpp - AMRWind.h + KynemaSGF.cpp + KynemaSGF.h ExawindSolver.h ExawindSolver.cpp MPIUtilities.h @@ -18,10 +18,10 @@ target_include_directories(${EXAWIND_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC - AMR-Wind::amrwind_api - AMR-Wind::buildInfoamrwind_obj + Kynema-SGF::kynema_sgf_api + Kynema-SGF::buildInfokynema_sgf_obj AMReX::amrex - Kynema-UGF::nalu) + Kynema-UGF::kynema_ugf) target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) diff --git a/src/KynemaSGF.cpp b/src/KynemaSGF.cpp new file mode 100644 index 0000000..dc816ee --- /dev/null +++ b/src/KynemaSGF.cpp @@ -0,0 +1,131 @@ +#include "KynemaSGF.h" +#include "amr-wind/incflo.H" +#include "amr-wind/CFDSim.H" +#include "amr-wind/core/SimTime.H" +#include "amr-wind/utilities/console_io.H" +#include "AMReX.H" +#include "AMReX_ParmParse.H" + +#include "tioga.h" + +namespace exawind { + +void KynemaSGF::initialize( + MPI_Comm comm, const std::string& inpfile, std::ofstream& out) +{ + int argc = 2; + char** argv = new char*[argc]; + + const char* exename = "kynema_sgf"; + argv[0] = const_cast(exename); + argv[1] = const_cast(inpfile.c_str()); + + amrex::Initialize( + argc, argv, true, comm, + []() { + amrex::ParmParse pp("amrex"); + // Set the defaults so that we throw an exception instead of + // attempting to generate backtrace files. However, if the user has + // explicitly set these options in their input files respect those + // settings. + if (!pp.contains("throw_exception")) pp.add("throw_exception", 1); + if (!pp.contains("signal_handling")) pp.add("signal_handling", 0); + }, + out, out); + + kynema_sgf::io::print_banner(comm, amrex::OutStream()); + + delete[] argv; +} + +void KynemaSGF::finalize() { amrex::Finalize(); } + +KynemaSGF::KynemaSGF( + const std::vector& cell_vars, + const std::vector& node_vars, + TIOGA::tioga& tg) + : m_incflo() + , m_tgiface(m_incflo.sim(), tg) + , m_cell_vars(cell_vars) + , m_node_vars(node_vars) + , m_comm(amrex::ParallelContext::CommunicatorSub()) +{ + m_incflo.sim().activate_overset(); +} + +KynemaSGF::~KynemaSGF() = default; + +void KynemaSGF::init_prolog(bool) +{ + m_incflo.init_mesh(); + m_incflo.init_kynema_sgf_modules(); +} + +void KynemaSGF::init_epilog() {} + +void KynemaSGF::prepare_solver_prolog() {} + +void KynemaSGF::prepare_solver_epilog() +{ + m_incflo.prepare_for_time_integration(); +} + +void KynemaSGF::pre_advance_stage0(size_t inonlin) +{ + if (inonlin < 1) { + m_incflo.sim().time().new_timestep(); + m_incflo.regrid_and_update(); + m_incflo.compute_dt(); + } +} + +void KynemaSGF::pre_advance_stage1(size_t inonlin) +{ + if (inonlin < 1) { + m_incflo.pre_advance_stage1(); + } +} + +void KynemaSGF::pre_advance_stage2(size_t inonlin) +{ + if (inonlin < 1) m_incflo.pre_advance_stage2(); +} + +double KynemaSGF::get_time() { return m_incflo.time().new_time(); } + +double KynemaSGF::get_timestep_size() { return m_incflo.time().delta_t(); } + +void KynemaSGF::set_timestep_size(const double dt) +{ + m_incflo.sim().time().delta_t() = dt; +} + +bool KynemaSGF::is_fixed_timestep_size() +{ + return (!m_incflo.sim().time().adaptive_timestep()); +} + +void KynemaSGF::advance_timestep(size_t inonlin) { m_incflo.do_advance(inonlin); } + +void KynemaSGF::post_advance() { m_incflo.post_advance_work(); } + +void KynemaSGF::pre_overset_conn_work() { m_tgiface.pre_overset_conn_work(); } + +void KynemaSGF::post_overset_conn_work() { m_tgiface.post_overset_conn_work(); } + +void KynemaSGF::register_solution() +{ + m_tgiface.register_solution(m_cell_vars, m_node_vars); +} + +void KynemaSGF::update_solution() { m_tgiface.update_solution(); } + +int KynemaSGF::overset_update_interval() +{ + const int regrid_int = m_incflo.sim().time().regrid_interval(); + return regrid_int > 0 ? regrid_int : 100000000; +} + +int KynemaSGF::time_index() { return m_incflo.sim().time().time_index(); } + +} // namespace exawind diff --git a/src/KynemaSGF.h b/src/KynemaSGF.h new file mode 100644 index 0000000..e7e4c90 --- /dev/null +++ b/src/KynemaSGF.h @@ -0,0 +1,58 @@ +#include "amr-wind/incflo.H" +#include "AMRTiogaIface.h" +#include "ExawindSolver.h" + +namespace TIOGA { +class tioga; +} + +namespace exawind { + +class KynemaSGF : public ExawindSolver +{ +private: + incflo m_incflo; + AMRTiogaIface m_tgiface; + std::vector m_cell_vars; + std::vector m_node_vars; + +public: + static void + initialize(MPI_Comm comm, const std::string& inpfile, std::ofstream& out); + static void finalize(); + explicit KynemaSGF( + const std::vector&, + const std::vector&, + TIOGA::tioga&); + ~KynemaSGF(); + bool is_unstructured() override { return false; } + bool is_amr() override { return true; } + bool is_fixed_timestep_size() override; + int overset_update_interval() override; + int time_index() override; + std::string identifier() override { return "Kynema-SGF"; } + MPI_Comm comm() override { return m_comm; } + +protected: + void init_prolog(bool multi_solver_mode = true) override; + void init_epilog() override; + void prepare_solver_prolog() override; + void prepare_solver_epilog() override; + void pre_advance_stage0(size_t inonlin) override; + void pre_advance_stage1(size_t inonlin) override; + void pre_advance_stage2(size_t inonlin) override; + double get_time() override; + double get_timestep_size() override; + void set_timestep_size(const double) override; + void advance_timestep(size_t inonlin) override; + void additional_picard_iterations(const int) override {}; + void post_advance() override; + void pre_overset_conn_work() override; + void post_overset_conn_work() override; + void register_solution() override; + void update_solution() override; + void dump_simulation_time() override {}; + MPI_Comm m_comm; +}; + +} // namespace exawind diff --git a/src/OversetSimulation.h b/src/OversetSimulation.h index d29b4f2..2dfa185 100644 --- a/src/OversetSimulation.h +++ b/src/OversetSimulation.h @@ -20,8 +20,8 @@ class OversetSimulation //! List of solvers active in this overset simulation std::vector> m_solvers; //! List of start ranks for all kynema-ugf instances - int m_num_nw_solvers; - std::vector m_nw_start_rank; + int m_num_ugf_solvers; + std::vector m_ugf_start_rank; //! Flag indicating whether an AMR solver is active bool m_has_amr{false}; //! Flag indicating whether an unstructured solver is active @@ -104,14 +104,14 @@ class OversetSimulation long mem_usage_all(const int step); //! set number of kynema-ugf instances - void set_nw_start_rank(const std::vector& start_ranks) + void set_ugf_start_rank(const std::vector& start_ranks) { if (!start_ranks.empty()) { - m_nw_start_rank = start_ranks; + m_ugf_start_rank = start_ranks; } else { - m_nw_start_rank.clear(); + m_ugf_start_rank.clear(); } - m_num_nw_solvers = m_nw_start_rank.size(); + m_num_ugf_solvers = m_ugf_start_rank.size(); } void set_holemap_alg(bool alg) diff --git a/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml b/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml index 75af8ce..47b8a9e 100644 --- a/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml +++ b/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml @@ -1,7 +1,7 @@ # Example input file exawind: - nalu_wind_inp: + kynema_ugf_inp: - nalu_platform.yaml - nalu_panel.yaml num_timesteps: 10 @@ -15,7 +15,7 @@ exawind: search_tolerance: 1e-12 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - turbulent_ke diff --git a/test/test_files/sphere/sphere.yaml b/test/test_files/sphere/sphere.yaml index 5ccb6f1..1f7ad30 100644 --- a/test/test_files/sphere/sphere.yaml +++ b/test/test_files/sphere/sphere.yaml @@ -1,18 +1,18 @@ # Example input file exawind: - nalu_wind_inp: - - sphere-nalu.yaml - amr_wind_inp: sphere-amr.inp + kynema_ugf_inp: + - sphere-ugf.yaml + kynema_sgf_inp: sphere-sgf.inp num_timesteps: 10 # Variables for overset exchange - nalu_vars: + ugf_vars: - velocity - pressure - amr_cell_vars: + sgf_cell_vars: - velocity - amr_node_vars: + sgf_node_vars: - p From 88e79130392d1e36ee32b0e40463cb958eb67722 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 17:25:00 -0600 Subject: [PATCH 04/22] lots of renamed tests --- test/CMakeLists.txt | 14 +++++++------- .../cylinder-sgf.inp | 0 .../cylinder-ugf.yaml | 0 .../sgf-ugf-cylinder-motion.yaml} | 0 .../cylinder-sgf.inp | 0 .../cylinder-ugf.yaml | 0 .../sgf-ugf-cylinder.yaml} | 0 .../cylinder-ugf-far.yaml | 0 .../cylinder-ugf-near.yaml | 0 .../ugf-ugf-cylinder-motion.yaml} | 0 .../cylinder-ugf-far.yaml | 0 .../cylinder-ugf-near.yaml | 0 .../ugf-ugf-cylinder.yaml} | 0 .../ugf-ugf-panel.yaml} | 4 ++-- .../ugf_panel.yaml} | 0 .../ugf_platform.yaml} | 0 16 files changed, 9 insertions(+), 9 deletions(-) rename test/test_files/{amr-nalu-cylinder-motion => sgf-ugf-cylinder-motion}/cylinder-sgf.inp (100%) rename test/test_files/{amr-nalu-cylinder-motion => sgf-ugf-cylinder-motion}/cylinder-ugf.yaml (100%) rename test/test_files/{amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml => sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml} (100%) rename test/test_files/{amr-nalu-cylinder => sgf-ugf-cylinder}/cylinder-sgf.inp (100%) rename test/test_files/{amr-nalu-cylinder => sgf-ugf-cylinder}/cylinder-ugf.yaml (100%) rename test/test_files/{amr-nalu-cylinder/amr-nalu-cylinder.yaml => sgf-ugf-cylinder/sgf-ugf-cylinder.yaml} (100%) rename test/test_files/{nalu-nalu-cylinder-motion => ugf-ugf-cylinder-motion}/cylinder-ugf-far.yaml (100%) rename test/test_files/{nalu-nalu-cylinder-motion => ugf-ugf-cylinder-motion}/cylinder-ugf-near.yaml (100%) rename test/test_files/{nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml => ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml} (100%) rename test/test_files/{nalu-nalu-cylinder => ugf-ugf-cylinder}/cylinder-ugf-far.yaml (100%) rename test/test_files/{nalu-nalu-cylinder => ugf-ugf-cylinder}/cylinder-ugf-near.yaml (100%) rename test/test_files/{nalu-nalu-cylinder/nalu-nalu-cylinder.yaml => ugf-ugf-cylinder/ugf-ugf-cylinder.yaml} (100%) rename test/test_files/{nalu-nalu-panel/nalu-nalu-panel.yaml => ugf-ugf-panel/ugf-ugf-panel.yaml} (89%) rename test/test_files/{nalu-nalu-panel/nalu_panel.yaml => ugf-ugf-panel/ugf_panel.yaml} (100%) rename test/test_files/{nalu-nalu-panel/nalu_platform.yaml => ugf-ugf-panel/ugf_platform.yaml} (100%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2ccd6f0..e71c207 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -43,7 +43,7 @@ endif() macro(setup_test) set(CURRENT_TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${TEST_NAME}) set(CURRENT_TEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/test_files/${TEST_NAME}) - if(NOT "${TEST_NAME}" MATCHES "^nalu-nalu") + if(NOT "${TEST_NAME}" MATCHES "^ugf-ugf") set(PLOT_GOLD ${GOLD_FILES_DIRECTORY}/${TEST_NAME}/plt00010) set(PLOT_TEST ${CURRENT_TEST_BINARY_DIR}/plt00010) endif() @@ -55,11 +55,11 @@ macro(setup_test) if(AMReX_CUDA OR AMReX_HIP OR AMReX_SYCL) set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12") endif() - if(EXAWIND_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^nalu-nalu")) + if(EXAWIND_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) file(MAKE_DIRECTORY ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}) set(SAVE_GOLDS_COMMAND "&& cp -R ${PLOT_TEST} ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}/") endif() - if(EXAWIND_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^nalu-nalu")) + if(EXAWIND_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) set(FCOMPARE_COMMAND "&& CUDA_LAUNCH_BLOCKING=1 ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}") endif() execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink @@ -97,8 +97,8 @@ endfunction(add_test_rd) # Regression tests #============================================================================= add_test_r(sphere) -add_test_r(amr-nalu-cylinder) -add_test_r(amr-nalu-cylinder-motion) +add_test_r(sgf-ugf-cylinder) +add_test_r(sgf-ugf-cylinder-motion) add_test_r(zalesak) add_test_r(hybrid-multi-cylinder) add_test_r(flat-surface) @@ -107,8 +107,8 @@ add_test_r(linear-waves) add_test_r(dam-break-block) add_test_r(abl-bndry-output) add_test_rd(abl-bndry-input abl-bndry-output) -add_test_r(nalu-nalu-cylinder) -add_test_r(nalu-nalu-cylinder-motion) +add_test_r(ugf-ugf-cylinder) +add_test_r(ugf-ugf-cylinder-motion) add_test_re(stokes-waves-cylinder) if(NALU_USES_KYNEMA) diff --git a/test/test_files/amr-nalu-cylinder-motion/cylinder-sgf.inp b/test/test_files/sgf-ugf-cylinder-motion/cylinder-sgf.inp similarity index 100% rename from test/test_files/amr-nalu-cylinder-motion/cylinder-sgf.inp rename to test/test_files/sgf-ugf-cylinder-motion/cylinder-sgf.inp diff --git a/test/test_files/amr-nalu-cylinder-motion/cylinder-ugf.yaml b/test/test_files/sgf-ugf-cylinder-motion/cylinder-ugf.yaml similarity index 100% rename from test/test_files/amr-nalu-cylinder-motion/cylinder-ugf.yaml rename to test/test_files/sgf-ugf-cylinder-motion/cylinder-ugf.yaml diff --git a/test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml b/test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml similarity index 100% rename from test/test_files/amr-nalu-cylinder-motion/amr-nalu-cylinder-motion.yaml rename to test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml diff --git a/test/test_files/amr-nalu-cylinder/cylinder-sgf.inp b/test/test_files/sgf-ugf-cylinder/cylinder-sgf.inp similarity index 100% rename from test/test_files/amr-nalu-cylinder/cylinder-sgf.inp rename to test/test_files/sgf-ugf-cylinder/cylinder-sgf.inp diff --git a/test/test_files/amr-nalu-cylinder/cylinder-ugf.yaml b/test/test_files/sgf-ugf-cylinder/cylinder-ugf.yaml similarity index 100% rename from test/test_files/amr-nalu-cylinder/cylinder-ugf.yaml rename to test/test_files/sgf-ugf-cylinder/cylinder-ugf.yaml diff --git a/test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml b/test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml similarity index 100% rename from test/test_files/amr-nalu-cylinder/amr-nalu-cylinder.yaml rename to test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml diff --git a/test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-far.yaml b/test/test_files/ugf-ugf-cylinder-motion/cylinder-ugf-far.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-far.yaml rename to test/test_files/ugf-ugf-cylinder-motion/cylinder-ugf-far.yaml diff --git a/test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-near.yaml b/test/test_files/ugf-ugf-cylinder-motion/cylinder-ugf-near.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder-motion/cylinder-ugf-near.yaml rename to test/test_files/ugf-ugf-cylinder-motion/cylinder-ugf-near.yaml diff --git a/test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml b/test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder-motion/nalu-nalu-cylinder-motion.yaml rename to test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml diff --git a/test/test_files/nalu-nalu-cylinder/cylinder-ugf-far.yaml b/test/test_files/ugf-ugf-cylinder/cylinder-ugf-far.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder/cylinder-ugf-far.yaml rename to test/test_files/ugf-ugf-cylinder/cylinder-ugf-far.yaml diff --git a/test/test_files/nalu-nalu-cylinder/cylinder-ugf-near.yaml b/test/test_files/ugf-ugf-cylinder/cylinder-ugf-near.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder/cylinder-ugf-near.yaml rename to test/test_files/ugf-ugf-cylinder/cylinder-ugf-near.yaml diff --git a/test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml b/test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml similarity index 100% rename from test/test_files/nalu-nalu-cylinder/nalu-nalu-cylinder.yaml rename to test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml diff --git a/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml b/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml similarity index 89% rename from test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml rename to test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml index 47b8a9e..c575940 100644 --- a/test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml +++ b/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml @@ -2,8 +2,8 @@ exawind: kynema_ugf_inp: - - nalu_platform.yaml - - nalu_panel.yaml + - ugf_platform.yaml + - ugf_panel.yaml num_timesteps: 10 additional_picard_iterations: 2 use_adaptive_holemap: true diff --git a/test/test_files/nalu-nalu-panel/nalu_panel.yaml b/test/test_files/ugf-ugf-panel/ugf_panel.yaml similarity index 100% rename from test/test_files/nalu-nalu-panel/nalu_panel.yaml rename to test/test_files/ugf-ugf-panel/ugf_panel.yaml diff --git a/test/test_files/nalu-nalu-panel/nalu_platform.yaml b/test/test_files/ugf-ugf-panel/ugf_platform.yaml similarity index 100% rename from test/test_files/nalu-nalu-panel/nalu_platform.yaml rename to test/test_files/ugf-ugf-panel/ugf_platform.yaml From 787ce9f5f1cc21f49de214298ecae5cd6f35b2a0 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 21:46:04 -0600 Subject: [PATCH 05/22] CMake variables and some things that should have been deleted --- CMakeLists.txt | 2 +- src/AMRWind.cpp | 131 --------------------------------- src/AMRWind.h | 58 --------------- src/NaluWind.cpp | 175 -------------------------------------------- src/NaluWind.h | 87 ---------------------- test/CMakeLists.txt | 2 +- 6 files changed, 2 insertions(+), 453 deletions(-) delete mode 100644 src/AMRWind.cpp delete mode 100644 src/AMRWind.h delete mode 100644 src/NaluWind.cpp delete mode 100644 src/NaluWind.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 07a4655..29145c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ set(CMAKE_PREFIX_PATH ${Kynema-UGF_DIR} ${Trilinos_DIR} ${Kynema-SGF_DIR} find_package(Kynema-UGF REQUIRED) find_package(Trilinos REQUIRED) find_package(Kynema-SGF REQUIRED) -if(NALU_USES_OPENFAST) +if(UGF_USES_OPENFAST) enable_language(Fortran) find_package(OpenFAST REQUIRED) endif() diff --git a/src/AMRWind.cpp b/src/AMRWind.cpp deleted file mode 100644 index dc816ee..0000000 --- a/src/AMRWind.cpp +++ /dev/null @@ -1,131 +0,0 @@ -#include "KynemaSGF.h" -#include "amr-wind/incflo.H" -#include "amr-wind/CFDSim.H" -#include "amr-wind/core/SimTime.H" -#include "amr-wind/utilities/console_io.H" -#include "AMReX.H" -#include "AMReX_ParmParse.H" - -#include "tioga.h" - -namespace exawind { - -void KynemaSGF::initialize( - MPI_Comm comm, const std::string& inpfile, std::ofstream& out) -{ - int argc = 2; - char** argv = new char*[argc]; - - const char* exename = "kynema_sgf"; - argv[0] = const_cast(exename); - argv[1] = const_cast(inpfile.c_str()); - - amrex::Initialize( - argc, argv, true, comm, - []() { - amrex::ParmParse pp("amrex"); - // Set the defaults so that we throw an exception instead of - // attempting to generate backtrace files. However, if the user has - // explicitly set these options in their input files respect those - // settings. - if (!pp.contains("throw_exception")) pp.add("throw_exception", 1); - if (!pp.contains("signal_handling")) pp.add("signal_handling", 0); - }, - out, out); - - kynema_sgf::io::print_banner(comm, amrex::OutStream()); - - delete[] argv; -} - -void KynemaSGF::finalize() { amrex::Finalize(); } - -KynemaSGF::KynemaSGF( - const std::vector& cell_vars, - const std::vector& node_vars, - TIOGA::tioga& tg) - : m_incflo() - , m_tgiface(m_incflo.sim(), tg) - , m_cell_vars(cell_vars) - , m_node_vars(node_vars) - , m_comm(amrex::ParallelContext::CommunicatorSub()) -{ - m_incflo.sim().activate_overset(); -} - -KynemaSGF::~KynemaSGF() = default; - -void KynemaSGF::init_prolog(bool) -{ - m_incflo.init_mesh(); - m_incflo.init_kynema_sgf_modules(); -} - -void KynemaSGF::init_epilog() {} - -void KynemaSGF::prepare_solver_prolog() {} - -void KynemaSGF::prepare_solver_epilog() -{ - m_incflo.prepare_for_time_integration(); -} - -void KynemaSGF::pre_advance_stage0(size_t inonlin) -{ - if (inonlin < 1) { - m_incflo.sim().time().new_timestep(); - m_incflo.regrid_and_update(); - m_incflo.compute_dt(); - } -} - -void KynemaSGF::pre_advance_stage1(size_t inonlin) -{ - if (inonlin < 1) { - m_incflo.pre_advance_stage1(); - } -} - -void KynemaSGF::pre_advance_stage2(size_t inonlin) -{ - if (inonlin < 1) m_incflo.pre_advance_stage2(); -} - -double KynemaSGF::get_time() { return m_incflo.time().new_time(); } - -double KynemaSGF::get_timestep_size() { return m_incflo.time().delta_t(); } - -void KynemaSGF::set_timestep_size(const double dt) -{ - m_incflo.sim().time().delta_t() = dt; -} - -bool KynemaSGF::is_fixed_timestep_size() -{ - return (!m_incflo.sim().time().adaptive_timestep()); -} - -void KynemaSGF::advance_timestep(size_t inonlin) { m_incflo.do_advance(inonlin); } - -void KynemaSGF::post_advance() { m_incflo.post_advance_work(); } - -void KynemaSGF::pre_overset_conn_work() { m_tgiface.pre_overset_conn_work(); } - -void KynemaSGF::post_overset_conn_work() { m_tgiface.post_overset_conn_work(); } - -void KynemaSGF::register_solution() -{ - m_tgiface.register_solution(m_cell_vars, m_node_vars); -} - -void KynemaSGF::update_solution() { m_tgiface.update_solution(); } - -int KynemaSGF::overset_update_interval() -{ - const int regrid_int = m_incflo.sim().time().regrid_interval(); - return regrid_int > 0 ? regrid_int : 100000000; -} - -int KynemaSGF::time_index() { return m_incflo.sim().time().time_index(); } - -} // namespace exawind diff --git a/src/AMRWind.h b/src/AMRWind.h deleted file mode 100644 index e7e4c90..0000000 --- a/src/AMRWind.h +++ /dev/null @@ -1,58 +0,0 @@ -#include "amr-wind/incflo.H" -#include "AMRTiogaIface.h" -#include "ExawindSolver.h" - -namespace TIOGA { -class tioga; -} - -namespace exawind { - -class KynemaSGF : public ExawindSolver -{ -private: - incflo m_incflo; - AMRTiogaIface m_tgiface; - std::vector m_cell_vars; - std::vector m_node_vars; - -public: - static void - initialize(MPI_Comm comm, const std::string& inpfile, std::ofstream& out); - static void finalize(); - explicit KynemaSGF( - const std::vector&, - const std::vector&, - TIOGA::tioga&); - ~KynemaSGF(); - bool is_unstructured() override { return false; } - bool is_amr() override { return true; } - bool is_fixed_timestep_size() override; - int overset_update_interval() override; - int time_index() override; - std::string identifier() override { return "Kynema-SGF"; } - MPI_Comm comm() override { return m_comm; } - -protected: - void init_prolog(bool multi_solver_mode = true) override; - void init_epilog() override; - void prepare_solver_prolog() override; - void prepare_solver_epilog() override; - void pre_advance_stage0(size_t inonlin) override; - void pre_advance_stage1(size_t inonlin) override; - void pre_advance_stage2(size_t inonlin) override; - double get_time() override; - double get_timestep_size() override; - void set_timestep_size(const double) override; - void advance_timestep(size_t inonlin) override; - void additional_picard_iterations(const int) override {}; - void post_advance() override; - void pre_overset_conn_work() override; - void post_overset_conn_work() override; - void register_solution() override; - void update_solution() override; - void dump_simulation_time() override {}; - MPI_Comm m_comm; -}; - -} // namespace exawind diff --git a/src/NaluWind.cpp b/src/NaluWind.cpp deleted file mode 100644 index ef1e57c..0000000 --- a/src/NaluWind.cpp +++ /dev/null @@ -1,175 +0,0 @@ -#include "KynemaUGF.h" -#include "KynemaUGFEnv.h" -#include "Realm.h" -#include "TimeIntegrator.h" -#include "overset/ExtOverset.h" -#include "overset/TiogaRef.h" - -#include "Kokkos_Core.hpp" -#include "tioga.h" -#include "HypreNGP.h" - -namespace exawind { - -void KynemaUGF::initialize() -{ - Kokkos::initialize(); - // Hypre initialization - nalu_hypre::hypre_initialize(); - nalu_hypre::hypre_set_params(); -} - -void KynemaUGF::finalize() -{ - // Hypre cleanup - nalu_hypre::hypre_finalize(); - - if (Kokkos::is_initialized()) { - Kokkos::finalize(); - } -} - -KynemaUGF::KynemaUGF( - int id, - stk::ParallelMachine comm, - const YAML::Node& inp_yaml, - const std::string& logfile, - const std::vector& fnames, - TIOGA::tioga& tg) - : m_doc(inp_yaml), m_sim(m_doc), m_fnames(fnames), m_id(id), m_comm(comm) -{ - auto& env = sierra::nalu::KynemaUGFEnv::self(); - env.parallelCommunicator_ = comm; - MPI_Comm_size(comm, &env.pSize_); - MPI_Comm_rank(comm, &env.pRank_); - - ::tioga_nalu::TiogaRef::self(&tg); - - env.set_log_file_stream(logfile); -} - -KynemaUGF::~KynemaUGF() = default; - -void KynemaUGF::init_prolog(bool multi_solver_mode) -{ - // Dump the input yaml to the start of the logfile - // before the nalu banner - auto& env = sierra::nalu::KynemaUGFEnv::self(); - env.naluOutputP0() << std::string(20, '#') << " INPUT FILE START " - << std::string(20, '#') << std::endl; - sierra::nalu::KynemaUGFParsingHelper::emit(*env.naluLogStream_, m_doc); - env.naluOutputP0() << std::string(20, '#') << " INPUT FILE END " - << std::string(20, '#') << std::endl; - - m_sim.load(m_doc); - if (m_sim.timeIntegrator_->overset_ != nullptr) - m_sim.timeIntegrator_->overset_->set_multi_solver_mode( - multi_solver_mode); - m_sim.breadboard(); - m_sim.init_prolog(); -} - -void KynemaUGF::init_epilog() { m_sim.init_epilog(); } - -void KynemaUGF::prepare_solver_prolog() -{ - m_sim.timeIntegrator_->prepare_for_time_integration(); -} - -void KynemaUGFWind::prepare_solver_epilog() -{ - for (auto* realm : m_sim.timeIntegrator_->realmVec_) - realm->output_converged_results(); -} - -void KynemaUGFWind::pre_advance_stage0(size_t inonlin) -{ - m_sim.timeIntegrator_->prepare_time_step(inonlin); -} - -void KynemaUGFWind::pre_advance_stage1(size_t inonlin) -{ - m_sim.timeIntegrator_->pre_realm_advance_stage1(inonlin); -} - -void KynemaUGFWind::pre_advance_stage2(size_t inonlin) -{ - m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); -} - -double KynemaUGF::get_time() -{ - return m_sim.timeIntegrator_->get_time(); -} - -double KynemaUGF::get_timestep_size() -{ - return m_sim.timeIntegrator_->get_time_step(); -} - -void KynemaUGF::set_timestep_size(const double dt) -{ - m_sim.timeIntegrator_->set_timestep_size(dt); -} - -bool KynemaUGF::is_fixed_timestep_size() -{ - return m_sim.timeIntegrator_->get_is_fixed_time_step(); -} - -void KynemaUGF::advance_timestep(size_t /*inonlin*/) -{ - for (auto* realm : m_sim.timeIntegrator_->realmVec_) { - realm->advance_time_step(); - realm->process_multi_physics_transfer(); - } -} - -void KynemaUGF::additional_picard_iterations(const int n) -{ - for (auto* realm : m_sim.timeIntegrator_->realmVec_) - realm->nonlinear_iterations(n); -} - -void KynemaUGF::post_advance() { m_sim.timeIntegrator_->post_realm_advance(); } - -void KynemaUGF::pre_overset_conn_work() -{ - m_sim.timeIntegrator_->overset_->pre_overset_conn_work(); -} - -void KynemaUGF::post_overset_conn_work() -{ - m_sim.timeIntegrator_->overset_->post_overset_conn_work(); -} - -void KynemaUGF::register_solution() -{ - m_ncomps = m_sim.timeIntegrator_->overset_->register_solution(m_fnames); -} - -void KynemaUGF::update_solution() -{ - m_sim.timeIntegrator_->overset_->update_solution(); -} - -int KynemaUGF::overset_update_interval() -{ - for (auto& realm : m_sim.timeIntegrator_->realmVec_) { - if (realm->does_mesh_move()) { - return 1; - } - } - return 100000000; -} - -int KynemaUGF::time_index() { return m_sim.timeIntegrator_->timeStepCount_; } - -void KynemaUGF::dump_simulation_time() -{ - for (auto& realm : m_sim.timeIntegrator_->realmVec_) { - realm->dump_simulation_time(); - } -} - -} // namespace exawind diff --git a/src/NaluWind.h b/src/NaluWind.h deleted file mode 100644 index 1b586f9..0000000 --- a/src/NaluWind.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef KYNEMAUGF_H -#define KYNEMAUGF_H - -#include -#include - -#include "Simulation.h" -#include "stk_util/parallel/Parallel.hpp" -#include "yaml-cpp/yaml.h" -#include "ExawindSolver.h" - -namespace TIOGA { -class tioga; -} - -namespace exawind { - -class KynemaUGF : public ExawindSolver -{ -private: - YAML::Node m_doc; - sierra::nalu::Simulation m_sim; - std::vector m_fnames; - int m_ncomps; - int m_id; - -public: - static void initialize(); - static void finalize(); - static std::string change_file_name_suffix( - std::string inpfile, std::string suffix, int index = -1) - { - int extloc = inpfile.rfind("."); - std::string logfile = inpfile; - if (index >= 0) { - suffix = "_" + std::to_string(index) + suffix; - } - if (extloc != static_cast(std::string::npos)) { - logfile = inpfile.substr(0, extloc) + suffix; - } - return logfile; - } - explicit KynemaUGF( - int id, - stk::ParallelMachine comm, - const YAML::Node& inp_yaml, - const std::string& logfile, - const std::vector& fnames, - TIOGA::tioga& tg); - ~KynemaUGF(); - bool is_unstructured() override { return true; } - bool is_amr() override { return false; } - bool is_fixed_timestep_size() override; - int overset_update_interval() override; - int time_index() override; - std::string identifier() override - { - return ("Kynema-UGF-" + std::to_string(m_id)); - } - MPI_Comm comm() override { return m_comm; } - int get_ncomps() override { return m_ncomps; } - -protected: - void init_prolog(bool multi_solver_mode = true) override; - void init_epilog() override; - void prepare_solver_prolog() override; - void prepare_solver_epilog() override; - void pre_advance_stage0(size_t inonlin) override; - void pre_advance_stage1(size_t inonlin) override; - void pre_advance_stage2(size_t inonlin) override; - double get_time() override; - double get_timestep_size() override; - void set_timestep_size(const double) override; - void advance_timestep(size_t inonlin) override; - void additional_picard_iterations(const int) override; - void post_advance() override; - void pre_overset_conn_work() override; - void post_overset_conn_work() override; - void register_solution() override; - void update_solution() override; - void dump_simulation_time() override; - MPI_Comm m_comm; -}; - -} // namespace exawind - -#endif /* KYNEMAUGF_H */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e71c207..6e87384 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -111,6 +111,6 @@ add_test_r(ugf-ugf-cylinder) add_test_r(ugf-ugf-cylinder-motion) add_test_re(stokes-waves-cylinder) -if(NALU_USES_KYNEMA) +if(UGF_USES_FMB) add_test_r(floating-block) endif() \ No newline at end of file From 0aad7fed9793b02c086147e13e834e89b4cc9c5b Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 21:56:21 -0600 Subject: [PATCH 06/22] more renames of src files --- src/CMakeLists.txt | 4 ++-- src/KynemaSGF.cpp | 8 ++++---- src/KynemaSGF.h | 2 +- src/{ExawindSolver.cpp => KynemaSolver.cpp} | 4 ++-- src/{ExawindSolver.h => KynemaSolver.h} | 14 +++++++------- src/{AMRTiogaIface.cpp => SGFTiogaIface.cpp} | 16 ++++++++-------- src/{AMRTiogaIface.h => SGFTiogaIface.h} | 10 +++++----- 7 files changed, 29 insertions(+), 29 deletions(-) rename src/{ExawindSolver.cpp => KynemaSolver.cpp} (50%) rename src/{ExawindSolver.h => KynemaSolver.h} (95%) rename src/{AMRTiogaIface.cpp => SGFTiogaIface.cpp} (88%) rename src/{AMRTiogaIface.h => SGFTiogaIface.h} (78%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a0b491..fd3ddbf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ target_sources(${EXAWIND_LIB_NAME} PRIVATE - AMRTiogaIface.cpp - AMRTiogaIface.h + SGFTiogaIface.cpp + SGFTiogaIface.h KynemaSGF.cpp KynemaSGF.h ExawindSolver.h diff --git a/src/KynemaSGF.cpp b/src/KynemaSGF.cpp index dc816ee..2aad8a4 100644 --- a/src/KynemaSGF.cpp +++ b/src/KynemaSGF.cpp @@ -1,8 +1,8 @@ #include "KynemaSGF.h" -#include "amr-wind/incflo.H" -#include "amr-wind/CFDSim.H" -#include "amr-wind/core/SimTime.H" -#include "amr-wind/utilities/console_io.H" +#include "src/incflo.H" +#include "src/CFDSim.H" +#include "src/core/SimTime.H" +#include "src/utilities/console_io.H" #include "AMReX.H" #include "AMReX_ParmParse.H" diff --git a/src/KynemaSGF.h b/src/KynemaSGF.h index e7e4c90..b902151 100644 --- a/src/KynemaSGF.h +++ b/src/KynemaSGF.h @@ -1,4 +1,4 @@ -#include "amr-wind/incflo.H" +#include "src/incflo.H" #include "AMRTiogaIface.h" #include "ExawindSolver.h" diff --git a/src/ExawindSolver.cpp b/src/KynemaSolver.cpp similarity index 50% rename from src/ExawindSolver.cpp rename to src/KynemaSolver.cpp index ee0b67b..4b7f969 100644 --- a/src/ExawindSolver.cpp +++ b/src/KynemaSolver.cpp @@ -1,7 +1,7 @@ -#include "ExawindSolver.h" +#include "KynemaSolver.h" #include "MemoryUsage.h" namespace exawind { -ExawindSolver::~ExawindSolver() = default; +KynemaSolver::~KynemaSolver() = default; } // namespace exawind diff --git a/src/ExawindSolver.h b/src/KynemaSolver.h similarity index 95% rename from src/ExawindSolver.h rename to src/KynemaSolver.h index 3a447a8..6ab66eb 100644 --- a/src/ExawindSolver.h +++ b/src/KynemaSolver.h @@ -1,16 +1,16 @@ -#ifndef EXAWINDSOLVER_H -#define EXAWINDSOLVER_H +#ifndef KYNEMASOLVER_H +#define KYNEMASOLVER_H #include "Timers.h" #include "ParallelPrinter.h" namespace exawind { -class ExawindSolver +class KynemaSolver { public: - explicit ExawindSolver() : m_timers(m_names) {}; - virtual ~ExawindSolver(); + explicit KynemaSolver() : m_timers(m_names) {}; + virtual ~KynemaSolver(); void call_init_prolog(bool multi_solver_mode = true) { @@ -124,7 +124,7 @@ class ExawindSolver virtual bool is_fixed_timestep_size() = 0; virtual int overset_update_interval() { return 100000000; }; virtual int time_index() = 0; - virtual std::string identifier() { return "ExawindSolver"; } + virtual std::string identifier() { return "KynemaSolver"; } virtual MPI_Comm comm() = 0; virtual int get_ncomps() { return 0; }; void timing_details(); @@ -156,4 +156,4 @@ class ExawindSolver }; } // namespace exawind -#endif /* EXAWINDSOLVER_H */ +#endif /* KYNEMASOLVER_H */ diff --git a/src/AMRTiogaIface.cpp b/src/SGFTiogaIface.cpp similarity index 88% rename from src/AMRTiogaIface.cpp rename to src/SGFTiogaIface.cpp index fe04f2a..33d1433 100644 --- a/src/AMRTiogaIface.cpp +++ b/src/SGFTiogaIface.cpp @@ -1,6 +1,6 @@ #include -#include "AMRTiogaIface.h" +#include "SGFTiogaIface.h" #include "amr-wind/CFDSim.H" #include "amr-wind/overset/TiogaInterface.H" #include "TiogaMeshInfo.h" @@ -20,24 +20,24 @@ void amr_to_tioga(T1& lhs, T2& rhs) } // namespace -AMRTiogaIface::AMRTiogaIface(kynema_sgf::CFDSim& sim, TIOGA::tioga& tg) +SGFTiogaIface::SGFTiogaIface(kynema_sgf::CFDSim& sim, TIOGA::tioga& tg) : m_sim(sim), m_tg(tg), m_info(new TIOGA::AMRMeshInfo) {} -void AMRTiogaIface::pre_overset_conn_work() +void SGFTiogaIface::pre_overset_conn_work() { m_sim.overset_manager()->pre_overset_conn_work(); register_mesh(); } -void AMRTiogaIface::post_overset_conn_work() +void SGFTiogaIface::post_overset_conn_work() { m_sim.overset_manager()->post_overset_conn_work(); } -void AMRTiogaIface::register_mesh() +void SGFTiogaIface::register_mesh() { - BL_PROFILE("exawind::AMRTiogaIface::register_mesh"); + BL_PROFILE("exawind::SGFTiogaIface::register_mesh"); const int num_ghost = m_sim.pde_manager().num_ghost_state(); auto* amr_tg_iface = @@ -73,7 +73,7 @@ void AMRTiogaIface::register_mesh() m_tg.register_amr_grid(m_info.get()); } -void AMRTiogaIface::register_solution( +void SGFTiogaIface::register_solution( const std::vector& cell_vars, const std::vector& node_vars) { @@ -99,7 +99,7 @@ void AMRTiogaIface::register_solution( m_tg.register_amr_solution(); } -void AMRTiogaIface::update_solution() +void SGFTiogaIface::update_solution() { m_sim.overset_manager()->update_solution(); } diff --git a/src/AMRTiogaIface.h b/src/SGFTiogaIface.h similarity index 78% rename from src/AMRTiogaIface.h rename to src/SGFTiogaIface.h index fbcf4ff..08670b6 100644 --- a/src/AMRTiogaIface.h +++ b/src/SGFTiogaIface.h @@ -1,5 +1,5 @@ -#ifndef AMRTIOGAIFACE_H -#define AMRTIOGAIFACE_H +#ifndef SGFTIOGAIFACE_H +#define SGFTIOGAIFACE_H #include #include @@ -15,10 +15,10 @@ struct AMRMeshInfo; namespace exawind { -class AMRTiogaIface +class SGFTiogaIface { public: - AMRTiogaIface(kynema_sgf::CFDSim&, TIOGA::tioga& tg); + SGFTiogaIface(kynema_sgf::CFDSim&, TIOGA::tioga& tg); void pre_overset_conn_work(); @@ -41,4 +41,4 @@ class AMRTiogaIface } // namespace exawind -#endif /* AMRTIOGAIFACE_H */ +#endif /* SGFTIOGAIFACE_H */ From 4a969e0e793f49a524cd571db8b9f2b46b68489b Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 21:58:08 -0600 Subject: [PATCH 07/22] namespace stuff: replace exawind --- app/exawind/exawind.cpp | 24 ++++++++++++------------ src/Exawind.h | 2 +- src/KynemaSGF.cpp | 4 ++-- src/KynemaSGF.h | 4 ++-- src/KynemaSolver.cpp | 4 ++-- src/KynemaSolver.h | 4 ++-- src/KynemaUGF.cpp | 4 ++-- src/KynemaUGF.h | 4 ++-- src/MPIUtilities.h | 4 ++-- src/MemoryUsage.cpp | 4 ++-- src/MemoryUsage.h | 4 ++-- src/OversetSimulation.cpp | 4 ++-- src/OversetSimulation.h | 4 ++-- src/ParallelPrinter.h | 4 ++-- src/SGFTiogaIface.cpp | 6 +++--- src/Timers.h | 4 ++-- 16 files changed, 42 insertions(+), 42 deletions(-) diff --git a/app/exawind/exawind.cpp b/app/exawind/exawind.cpp index fd4bf7c..68f56b3 100644 --- a/app/exawind/exawind.cpp +++ b/app/exawind/exawind.cpp @@ -153,7 +153,7 @@ int main(int argc, char** argv) MPI_Comm sgf_comm = use_kynema_sgf - ? exawind::create_subcomm(MPI_COMM_WORLD, num_sgf_ranks, 0) + ? driver::create_subcomm(MPI_COMM_WORLD, num_sgf_ranks, 0) : MPI_COMM_NULL; std::vector kynema_ugf_comms; @@ -162,17 +162,17 @@ int main(int argc, char** argv) for (const auto& nr : num_ugf_solver_ranks) { kynema_ugf_start_rank.push_back(start); kynema_ugf_comms.push_back( - exawind::create_subcomm(MPI_COMM_WORLD, nr, start)); + driver::create_subcomm(MPI_COMM_WORLD, nr, start)); start += nr; } - exawind::OversetSimulation sim(MPI_COMM_WORLD); + driver::OversetSimulation sim(MPI_COMM_WORLD); if (sgf_comm != MPI_COMM_NULL) { sim.echo( "Initializing Kynema-SGF on " + std::to_string(num_sgf_ranks) + " MPI ranks"); out.open(sgf_log); - exawind::KynemaSGF::initialize(sgf_comm, sgf_inp, out); + driver::KynemaSGF::initialize(sgf_comm, sgf_inp, out); } sim.echo( "Initializing " + std::to_string(num_ugf_solvers) + @@ -181,7 +181,7 @@ int main(int argc, char** argv) if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { return comm != MPI_COMM_NULL; })) { - exawind::KynemaUGF::initialize(); + driver::KynemaUGF::initialize(); } sim.set_ugf_start_rank(kynema_ugf_start_rank); @@ -248,7 +248,7 @@ int main(int argc, char** argv) if (this_instance["logfile"]) { logfile = this_instance["logfile"].as(); } else { - logfile = exawind::KynemaUGF::change_file_name_suffix( + logfile = driver::KynemaUGF::change_file_name_suffix( kynema_ugf_inpfile, ".log", i); } if (this_instance["write_final_yaml_to_disk"]) { @@ -258,7 +258,7 @@ int main(int argc, char** argv) } else { kynema_ugf_inpfile = this_instance.as(); - logfile = exawind::KynemaUGF::change_file_name_suffix( + logfile = driver::KynemaUGF::change_file_name_suffix( kynema_ugf_inpfile, ".log"); } @@ -276,14 +276,14 @@ int main(int argc, char** argv) MPI_Comm_rank(kynema_ugf_comms.at(i), &comm_rank); if (write_final_yaml_to_disk && comm_rank == 0) { auto new_ifile_name = - exawind::KynemaUGF::change_file_name_suffix( + driver::KynemaUGF::change_file_name_suffix( logfile, ".yaml"); std::ofstream fout(new_ifile_name); fout << kynema_ugf_yaml; fout.close(); } - sim.register_solver( + sim.register_solver( i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, ugf_vars); } } @@ -294,7 +294,7 @@ int main(int argc, char** argv) const auto sgf_nvars = node["sgf_node_vars"].as>(); - sim.register_solver(sgf_cvars, sgf_nvars); + sim.register_solver(sgf_cvars, sgf_nvars); } sim.echo("Initializing overset simulation"); @@ -305,13 +305,13 @@ int main(int argc, char** argv) sim.delete_solvers(); if (sgf_comm != MPI_COMM_NULL) { - exawind::KynemaSGF::finalize(); + driver::KynemaSGF::finalize(); out.close(); } if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { return comm != MPI_COMM_NULL; })) { - exawind::KynemaUGF::finalize(); + driver::KynemaUGF::finalize(); } MPI_Finalize(); diff --git a/src/Exawind.h b/src/Exawind.h index e91e6ee..ad625d9 100644 --- a/src/Exawind.h +++ b/src/Exawind.h @@ -1,6 +1,6 @@ #ifndef EXAWIND_H #define EXAWIND_H -namespace exawind {} +namespace driver {} #endif /* EXAWIND_H */ diff --git a/src/KynemaSGF.cpp b/src/KynemaSGF.cpp index 2aad8a4..14dbfdb 100644 --- a/src/KynemaSGF.cpp +++ b/src/KynemaSGF.cpp @@ -8,7 +8,7 @@ #include "tioga.h" -namespace exawind { +namespace driver { void KynemaSGF::initialize( MPI_Comm comm, const std::string& inpfile, std::ofstream& out) @@ -128,4 +128,4 @@ int KynemaSGF::overset_update_interval() int KynemaSGF::time_index() { return m_incflo.sim().time().time_index(); } -} // namespace exawind +} // namespace driver diff --git a/src/KynemaSGF.h b/src/KynemaSGF.h index b902151..cb153a8 100644 --- a/src/KynemaSGF.h +++ b/src/KynemaSGF.h @@ -6,7 +6,7 @@ namespace TIOGA { class tioga; } -namespace exawind { +namespace driver { class KynemaSGF : public ExawindSolver { @@ -55,4 +55,4 @@ class KynemaSGF : public ExawindSolver MPI_Comm m_comm; }; -} // namespace exawind +} // namespace driver diff --git a/src/KynemaSolver.cpp b/src/KynemaSolver.cpp index 4b7f969..4147fcd 100644 --- a/src/KynemaSolver.cpp +++ b/src/KynemaSolver.cpp @@ -1,7 +1,7 @@ #include "KynemaSolver.h" #include "MemoryUsage.h" -namespace exawind { +namespace driver { KynemaSolver::~KynemaSolver() = default; -} // namespace exawind +} // namespace driver diff --git a/src/KynemaSolver.h b/src/KynemaSolver.h index 6ab66eb..12c41f1 100644 --- a/src/KynemaSolver.h +++ b/src/KynemaSolver.h @@ -4,7 +4,7 @@ #include "Timers.h" #include "ParallelPrinter.h" -namespace exawind { +namespace driver { class KynemaSolver { @@ -155,5 +155,5 @@ class KynemaSolver virtual void dump_simulation_time() = 0; }; -} // namespace exawind +} // namespace driver #endif /* KYNEMASOLVER_H */ diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index f714203..74a7872 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -9,7 +9,7 @@ #include "tioga.h" #include "HypreNGP.h" -namespace exawind { +namespace driver { void KynemaUGF::initialize() { @@ -172,4 +172,4 @@ void KynemaUGF::dump_simulation_time() } } -} // namespace exawind +} // namespace driver diff --git a/src/KynemaUGF.h b/src/KynemaUGF.h index 1b586f9..7168037 100644 --- a/src/KynemaUGF.h +++ b/src/KynemaUGF.h @@ -13,7 +13,7 @@ namespace TIOGA { class tioga; } -namespace exawind { +namespace driver { class KynemaUGF : public ExawindSolver { @@ -82,6 +82,6 @@ class KynemaUGF : public ExawindSolver MPI_Comm m_comm; }; -} // namespace exawind +} // namespace driver #endif /* KYNEMAUGF_H */ diff --git a/src/MPIUtilities.h b/src/MPIUtilities.h index 7e85f25..2508082 100644 --- a/src/MPIUtilities.h +++ b/src/MPIUtilities.h @@ -2,7 +2,7 @@ #define MPIUTILITIES_H #include "mpi.h" -namespace exawind { +namespace driver { //! Create a subcommunicator MPI_Comm @@ -28,5 +28,5 @@ create_subcomm(MPI_Comm comm, const int num_ranks, const int start_rank = 0) return sub_comm; } -} // namespace exawind +} // namespace driver #endif /* MPIUTILITIES_H */ diff --git a/src/MemoryUsage.cpp b/src/MemoryUsage.cpp index 708d738..f78abab 100644 --- a/src/MemoryUsage.cpp +++ b/src/MemoryUsage.cpp @@ -1,6 +1,6 @@ #include "MemoryUsage.h" -namespace exawind { +namespace driver { #ifdef __linux__ long memory_usage() @@ -15,4 +15,4 @@ long memory_usage() long memory_usage() { return -1; } #endif -} // namespace exawind +} // namespace driver diff --git a/src/MemoryUsage.h b/src/MemoryUsage.h index 4812558..e8d0b05 100644 --- a/src/MemoryUsage.h +++ b/src/MemoryUsage.h @@ -5,10 +5,10 @@ #include #endif -namespace exawind { +namespace driver { //! Get memory usage in MB long memory_usage(); -} // namespace exawind +} // namespace driver #endif /* MEMORYUSAGE_H */ diff --git a/src/OversetSimulation.cpp b/src/OversetSimulation.cpp index e744104..9961474 100644 --- a/src/OversetSimulation.cpp +++ b/src/OversetSimulation.cpp @@ -4,7 +4,7 @@ #include #include -namespace exawind { +namespace driver { OversetSimulation::OversetSimulation(MPI_Comm comm) : m_comm(comm) @@ -303,4 +303,4 @@ long OversetSimulation::mem_usage_all(const int step) return mem; } -} // namespace exawind +} // namespace driver diff --git a/src/OversetSimulation.h b/src/OversetSimulation.h index 2dfa185..3d23d3f 100644 --- a/src/OversetSimulation.h +++ b/src/OversetSimulation.h @@ -10,7 +10,7 @@ namespace TIOGA { class tioga; } -namespace exawind { +namespace driver { class OversetSimulation { @@ -145,5 +145,5 @@ class OversetSimulation } }; -} // namespace exawind +} // namespace driver #endif /* OVERSETSIMULATION_H */ diff --git a/src/ParallelPrinter.h b/src/ParallelPrinter.h index a9976a4..f6f9c59 100644 --- a/src/ParallelPrinter.h +++ b/src/ParallelPrinter.h @@ -5,7 +5,7 @@ #include #include "mpi.h" -namespace exawind { +namespace driver { class ParallelPrinter { @@ -92,5 +92,5 @@ class ParallelPrinter int io_rank() { return m_io_rank; }; bool is_io_rank() { return m_rank == m_io_rank; }; }; -} // namespace exawind +} // namespace driver #endif /* PARALLELPRINTER_H */ diff --git a/src/SGFTiogaIface.cpp b/src/SGFTiogaIface.cpp index 33d1433..f1b6c76 100644 --- a/src/SGFTiogaIface.cpp +++ b/src/SGFTiogaIface.cpp @@ -6,7 +6,7 @@ #include "TiogaMeshInfo.h" #include "tioga.h" -namespace exawind { +namespace driver { namespace { @@ -37,7 +37,7 @@ void SGFTiogaIface::post_overset_conn_work() void SGFTiogaIface::register_mesh() { - BL_PROFILE("exawind::SGFTiogaIface::register_mesh"); + BL_PROFILE("driver::SGFTiogaIface::register_mesh"); const int num_ghost = m_sim.pde_manager().num_ghost_state(); auto* amr_tg_iface = @@ -104,4 +104,4 @@ void SGFTiogaIface::update_solution() m_sim.overset_manager()->update_solution(); } -} // namespace exawind +} // namespace driver diff --git a/src/Timers.h b/src/Timers.h index a47ae33..07745c6 100644 --- a/src/Timers.h +++ b/src/Timers.h @@ -11,7 +11,7 @@ #include #include -namespace exawind { +namespace driver { class Timer { @@ -212,5 +212,5 @@ struct Timers return outstream; } }; -} // namespace exawind +} // namespace driver #endif /* TIMERS_H */ From 97cd6610abd5c424fa4ec0d740c46c2fffa28cab Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 22:32:53 -0600 Subject: [PATCH 08/22] more exawind -> kynema (regression test files, main file, etc.) --- .github/workflows/ci.yml | 16 +++---- CMakeLists.txt | 44 +++++++++---------- README.md | 4 +- app/exawind/CMakeLists.txt | 12 ----- app/kynema/CMakeLists.txt | 12 +++++ .../exawind.cpp => kynema/kynema.cpp} | 6 +-- ...exawind-utils.cmake => kynema-utils.cmake} | 4 +- src/CMakeLists.txt | 10 ++--- src/Exawind.h | 6 +-- src/Kynema.h | 6 +++ test/CMakeLists.txt | 26 +++++------ .../abl-bndry-input/abl-bndry-input.yaml | 2 +- .../abl-bndry-output/abl-bndry-output.yaml | 2 +- test/test_files/ctv/ctv1.yaml | 2 +- test/test_files/ctv/ctv2.yaml | 2 +- test/test_files/ctv/ctv3.yaml | 2 +- .../dam-break-block/dam-break-block.yaml | 2 +- .../test_files/flat-surface/flat-surface.yaml | 2 +- .../floating-block/floating-block.yaml | 2 +- .../hybrid-multi-cylinder.yaml | 2 +- .../test_files/linear-waves/linear-waves.yaml | 2 +- .../sgf-ugf-cylinder-motion.yaml | 2 +- .../sgf-ugf-cylinder/sgf-ugf-cylinder.yaml | 2 +- .../sloshing-tank/sloshing-tank.yaml | 2 +- test/test_files/sphere/sphere.yaml | 2 +- .../stokes-waves-cylinder.yaml | 2 +- .../ugf-ugf-cylinder-motion.yaml | 2 +- .../ugf-ugf-cylinder/ugf-ugf-cylinder.yaml | 2 +- .../ugf-ugf-panel/ugf-ugf-panel.yaml | 2 +- test/test_files/zalesak/zalesak.yaml | 2 +- 30 files changed, 95 insertions(+), 89 deletions(-) delete mode 100644 app/exawind/CMakeLists.txt create mode 100644 app/kynema/CMakeLists.txt rename app/{exawind/exawind.cpp => kynema/kynema.cpp} (99%) rename cmake/{exawind-utils.cmake => kynema-utils.cmake} (90%) create mode 100644 src/Kynema.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4797163..54386f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,9 @@ jobs: needs: Formatting runs-on: ubuntu-24.04 container: - image: ecpe4s/exawind-snapshot + image: ecpe4s/kynema-snapshot env: - EXAWIND_MANAGER: /exawind-manager + KYNEMA_MANAGER: /kynema-manager E4S_MACHINE: true steps: - name: Clone @@ -37,13 +37,13 @@ jobs: - name: Tests run: | /bin/bash -c " \ - source ${EXAWIND_MANAGER}/start.sh && spack-start && \ + source ${KYNEMA_MANAGER}/start.sh && spack-start && \ spack env activate e4s-build && \ - cd ${EXAWIND_MANAGER}/environments/e4s-build && \ - ln -s ${GITHUB_WORKSPACE} exawind && \ - spack develop --no-modify-concrete-specs --no-clone exawind@=master && \ + cd ${KYNEMA_MANAGER}/environments/e4s-build && \ + ln -s ${GITHUB_WORKSPACE} kynema && \ + spack develop --no-modify-concrete-specs --no-clone kynema@=master && \ spack concretize -f && \ spack install && \ - spack cd -b exawind && \ - spack build-env exawind ctest -j $(nproc) -LE no-ci --output-on-failure \ + spack cd -b kynema && \ + spack build-env kynema ctest -j $(nproc) -LE no-ci --output-on-failure \ " diff --git a/CMakeLists.txt b/CMakeLists.txt index 29145c2..5830fad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR) -project(exawind CXX C) +project(kynema CXX C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") @@ -8,21 +8,21 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) -option(EXAWIND_ENABLE_TESTS "Enable testing suite" ON) -option(EXAWIND_TEST_WITH_FCOMPARE "Check Kynema-SGF test plots against gold files" OFF) -option(EXAWIND_SAVE_GOLDS "Provide a directory in which to save golds during testing" OFF) -option(EXAWIND_ENABLE_CUDA "Enable CUDA" OFF) -option(EXAWIND_ENABLE_CUDA_RDC "Enable CUDA relocatable device code" OFF) -option(EXAWIND_ENABLE_ROCM "Enable HIP" OFF) -option(EXAWIND_ENABLE_UMPIRE "Enable Umpire GPU memory pools" OFF) +option(KYNEMA_ENABLE_TESTS "Enable testing suite" ON) +option(KYNEMA_TEST_WITH_FCOMPARE "Check Kynema-SGF test plots against gold files" OFF) +option(KYNEMA_SAVE_GOLDS "Provide a directory in which to save golds during testing" OFF) +option(KYNEMA_ENABLE_CUDA "Enable CUDA" OFF) +option(KYNEMA_ENABLE_CUDA_RDC "Enable CUDA relocatable device code" OFF) +option(KYNEMA_ENABLE_ROCM "Enable HIP" OFF) +option(KYNEMA_ENABLE_UMPIRE "Enable Umpire GPU memory pools" OFF) -if(EXAWIND_ENABLE_CUDA) +if(KYNEMA_ENABLE_CUDA) enable_language(CUDA) find_package(CUDAToolkit REQUIRED) - set(EXAWIND_CUDA_ARCH "70" CACHE STRING "CUDA architecture (Use 'Auto' for automatic detection)") + set(KYNEMA_CUDA_ARCH "70" CACHE STRING "CUDA architecture (Use 'Auto' for automatic detection)") endif() -if(EXAWIND_ENABLE_ROCM) +if(KYNEMA_ENABLE_ROCM) find_package(hip REQUIRED) find_package(rocrand REQUIRED CONFIG) find_package(rocprim REQUIRED CONFIG) @@ -30,7 +30,7 @@ if(EXAWIND_ENABLE_ROCM) find_package(hiprand REQUIRED CONFIG) endif() -if (EXAWIND_ENABLE_UMPIRE) +if (KYNEMA_ENABLE_UMPIRE) set(CMAKE_PREFIX_PATH ${UMPIRE_DIR} ${CMAKE_PREFIX_PATH}) find_package(Umpire REQUIRED) include_directories(SYSTEM ${UMPIRE_INCLUDE_DIRS}) @@ -63,26 +63,26 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(EXAWIND_LIB_NAME "exwsim") -add_library(${EXAWIND_LIB_NAME} OBJECT) +set(KYNEMA_LIB_NAME "exwsim") +add_library(${KYNEMA_LIB_NAME} OBJECT) add_subdirectory(src) -set(EXAWIND_EXE_NAME "exawind") -add_executable(${EXAWIND_EXE_NAME}) -add_subdirectory(app/exawind) +set(KYNEMA_EXE_NAME "kynema") +add_executable(${KYNEMA_EXE_NAME}) +add_subdirectory(app/kynema) -if(EXAWIND_ENABLE_CUDA) - include(exawind-utils) - set(ewtargets "${EXAWIND_LIB_NAME};${EXAWIND_EXE_NAME}") +if(KYNEMA_ENABLE_CUDA) + include(kynema-utils) + set(ewtargets "${KYNEMA_LIB_NAME};${KYNEMA_EXE_NAME}") foreach(tgt IN LISTS ewtargets) set_cuda_build_properties(${tgt}) endforeach() endif() -if(EXAWIND_ENABLE_TESTS) +if(KYNEMA_ENABLE_TESTS) enable_testing() include(CTest) add_subdirectory(test) endif() -install(TARGETS ${EXAWIND_EXE_NAME}) +install(TARGETS ${KYNEMA_EXE_NAME}) diff --git a/README.md b/README.md index c78077a..4a7719c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![journal article](https://img.shields.io/badge/DOI-10.1002/we.2886-blue)](https://doi.org/10.1002/we.2886) This repository contains a pure C++ driver API for coupling -[Kynema-UGF](https://github.com/exawind/nalu-wind) and -[Kynema-SGF](https://github.com/exawind/amr-wind) CFD codes. +[Kynema-UGF](https://github.com/kynema/nalu-wind) and +[Kynema-SGF](https://github.com/kynema/amr-wind) CFD codes. ## Citation diff --git a/app/exawind/CMakeLists.txt b/app/exawind/CMakeLists.txt deleted file mode 100644 index 96102fc..0000000 --- a/app/exawind/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -target_sources(${EXAWIND_EXE_NAME} PRIVATE - exawind.cpp) - -target_link_libraries(${EXAWIND_EXE_NAME} PRIVATE - ${EXAWIND_LIB_NAME} - yaml-cpp) - -target_include_directories(${EXAWIND_EXE_NAME} SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR}) - -if(EXAWIND_ENABLE_ROCM) - target_compile_definitions(${EXAWIND_EXE_NAME} PRIVATE EXAWIND_ENABLE_ROCM) -endif() diff --git a/app/kynema/CMakeLists.txt b/app/kynema/CMakeLists.txt new file mode 100644 index 0000000..4a9bce0 --- /dev/null +++ b/app/kynema/CMakeLists.txt @@ -0,0 +1,12 @@ +target_sources(${KYNEMA_EXE_NAME} PRIVATE + kynema.cpp) + +target_link_libraries(${KYNEMA_EXE_NAME} PRIVATE + ${KYNEMA_LIB_NAME} + yaml-cpp) + +target_include_directories(${KYNEMA_EXE_NAME} SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR}) + +if(KYNEMA_ENABLE_ROCM) + target_compile_definitions(${KYNEMA_EXE_NAME} PRIVATE KYNEMA_ENABLE_ROCM) +endif() diff --git a/app/exawind/exawind.cpp b/app/kynema/kynema.cpp similarity index 99% rename from app/exawind/exawind.cpp rename to app/kynema/kynema.cpp index 68f56b3..f35bc7a 100644 --- a/app/exawind/exawind.cpp +++ b/app/kynema/kynema.cpp @@ -8,7 +8,7 @@ #include "tioga.h" // Workaround for MPI issue on OLCF Frontier machine -#ifdef EXAWIND_ENABLE_ROCM +#ifdef KYNEMA_ENABLE_ROCM #include #endif @@ -38,7 +38,7 @@ replace_extension(const std::string& filepath, const std::string& newExt) int main(int argc, char** argv) { // Workaround for MPI issue on OLCF Frontier machine -#ifdef EXAWIND_ENABLE_ROCM +#ifdef KYNEMA_ENABLE_ROCM hipInit(0); #endif MPI_Init(&argc, &argv); @@ -89,7 +89,7 @@ int main(int argc, char** argv) } const YAML::Node doc(YAML::LoadFile(inpfile)); - const YAML::Node node = doc["exawind"]; + const YAML::Node node = doc["kynema_driver"]; std::string sgf_inp = "dummy"; bool use_kynema_sgf = false; if (node["kynema_sgf_inp"]) { diff --git a/cmake/exawind-utils.cmake b/cmake/kynema-utils.cmake similarity index 90% rename from cmake/exawind-utils.cmake rename to cmake/kynema-utils.cmake index c5f6067..c3f8286 100644 --- a/cmake/exawind-utils.cmake +++ b/cmake/kynema-utils.cmake @@ -2,10 +2,10 @@ function(set_cuda_build_properties target) get_target_property(_tgt_src ${target} SOURCES) list(FILTER _tgt_src INCLUDE REGEX "\\.cpp") set_source_files_properties(${_tgt_src} PROPERTIES LANGUAGE CUDA) - set_target_properties(${target} PROPERTIES CUDA_ARCHITECTURES "${EXAWIND_CUDA_ARCH}") + set_target_properties(${target} PROPERTIES CUDA_ARCHITECTURES "${KYNEMA_CUDA_ARCH}") set_target_properties(${target} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON) #set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CUDA) - if(EXAWIND_ENABLE_CUDA_RDC) + if(KYNEMA_ENABLE_CUDA_RDC) set_target_properties(${target} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() endfunction(set_cuda_build_properties) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd3ddbf..db2f20f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${EXAWIND_LIB_NAME} PRIVATE +target_sources(${KYNEMA_LIB_NAME} PRIVATE SGFTiogaIface.cpp SGFTiogaIface.h KynemaSGF.cpp @@ -14,17 +14,17 @@ target_sources(${EXAWIND_LIB_NAME} PRIVATE MemoryUsage.h MemoryUsage.cpp) -target_include_directories(${EXAWIND_LIB_NAME} PUBLIC +target_include_directories(${KYNEMA_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC +target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC Kynema-SGF::kynema_sgf_api Kynema-SGF::buildInfokynema_sgf_obj AMReX::amrex Kynema-UGF::kynema_ugf) -target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) -target_link_libraries(${EXAWIND_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) +target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) +target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) # Solve -fallow-argument-mismatch from fortran possibly making its way into arguments passed to clang #if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$") diff --git a/src/Exawind.h b/src/Exawind.h index ad625d9..58541ea 100644 --- a/src/Exawind.h +++ b/src/Exawind.h @@ -1,6 +1,6 @@ -#ifndef EXAWIND_H -#define EXAWIND_H +#ifndef KYNEMA_H +#define KYNEMA_H namespace driver {} -#endif /* EXAWIND_H */ +#endif /* KYNEMA_H */ diff --git a/src/Kynema.h b/src/Kynema.h new file mode 100644 index 0000000..58541ea --- /dev/null +++ b/src/Kynema.h @@ -0,0 +1,6 @@ +#ifndef KYNEMA_H +#define KYNEMA_H + +namespace driver {} + +#endif /* KYNEMA_H */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6e87384..ad85c6b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,25 +14,25 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake) -if(EXAWIND_TEST_WITH_FCOMPARE) +if(KYNEMA_TEST_WITH_FCOMPARE) set(FCOMPARE_EXE "${FCOMPARE_EXE}" CACHE STRING "Path to fcompare executable for regression tests") - if("${EXAWIND_REFERENCE_GOLDS_DIRECTORY}" STREQUAL "") - message(FATAL_ERROR "To reference gold files, EXAWIND_REFERENCE_GOLDS_DIRECTORY must be set and exist") + if("${KYNEMA_REFERENCE_GOLDS_DIRECTORY}" STREQUAL "") + message(FATAL_ERROR "To reference gold files, KYNEMA_REFERENCE_GOLDS_DIRECTORY must be set and exist") else() - set(GOLD_FILES_DIRECTORY ${EXAWIND_REFERENCE_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) + set(GOLD_FILES_DIRECTORY ${KYNEMA_REFERENCE_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) message(STATUS "Test golds directory for fcompare: ${GOLD_FILES_DIRECTORY}") endif() endif() -if(EXAWIND_SAVE_GOLDS) - if("${EXAWIND_SAVED_GOLDS_DIRECTORY}" STREQUAL "") - message(FATAL_ERROR "To save gold files, EXAWIND_SAVED_GOLDS_DIRECTORY must be set and the directory exist") +if(KYNEMA_SAVE_GOLDS) + if("${KYNEMA_SAVED_GOLDS_DIRECTORY}" STREQUAL "") + message(FATAL_ERROR "To save gold files, KYNEMA_SAVED_GOLDS_DIRECTORY must be set and the directory exist") else() - if(EXISTS ${EXAWIND_SAVED_GOLDS_DIRECTORY}) - set(SAVED_GOLDS_DIRECTORY ${EXAWIND_SAVED_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) + if(EXISTS ${KYNEMA_SAVED_GOLDS_DIRECTORY}) + set(SAVED_GOLDS_DIRECTORY ${KYNEMA_SAVED_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) message(STATUS "Gold files will be saved to: ${SAVED_GOLDS_DIRECTORY}") else() - message(FATAL_ERROR "Specified directory for saving gold files does not exist: ${EXAWIND_SAVED_GOLDS_DIRECTORY}") + message(FATAL_ERROR "Specified directory for saving gold files does not exist: ${KYNEMA_SAVED_GOLDS_DIRECTORY}") endif() endif() endif() @@ -55,11 +55,11 @@ macro(setup_test) if(AMReX_CUDA OR AMReX_HIP OR AMReX_SYCL) set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12") endif() - if(EXAWIND_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) + if(KYNEMA_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) file(MAKE_DIRECTORY ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}) set(SAVE_GOLDS_COMMAND "&& cp -R ${PLOT_TEST} ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}/") endif() - if(EXAWIND_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) + if(KYNEMA_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) set(FCOMPARE_COMMAND "&& CUDA_LAUNCH_BLOCKING=1 ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}") endif() execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink @@ -70,7 +70,7 @@ endmacro(setup_test) # Standard regression test function(add_test_r TEST_NAME) setup_test() - add_test(${TEST_NAME} bash -c "set -o pipefail && ${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${EXAWIND_EXE_NAME} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.yaml 2>&1 | tee ${TEST_NAME}.log ${SAVE_GOLDS_COMMAND} ${FCOMPARE_COMMAND}") + add_test(${TEST_NAME} bash -c "set -o pipefail && ${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${KYNEMA_EXE_NAME} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.yaml 2>&1 | tee ${TEST_NAME}.log ${SAVE_GOLDS_COMMAND} ${FCOMPARE_COMMAND}") # Set properties for test set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 14400 diff --git a/test/test_files/abl-bndry-input/abl-bndry-input.yaml b/test/test_files/abl-bndry-input/abl-bndry-input.yaml index 78590ff..902fe01 100644 --- a/test/test_files/abl-bndry-input/abl-bndry-input.yaml +++ b/test/test_files/abl-bndry-input/abl-bndry-input.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - abl-ugf-box-rst.yaml kynema_sgf_inp: abl-sgf-bndry-input.inp diff --git a/test/test_files/abl-bndry-output/abl-bndry-output.yaml b/test/test_files/abl-bndry-output/abl-bndry-output.yaml index b013624..64419a1 100644 --- a/test/test_files/abl-bndry-output/abl-bndry-output.yaml +++ b/test/test_files/abl-bndry-output/abl-bndry-output.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - abl-ugf-box.yaml kynema_sgf_inp: abl-sgf-bndry-output.inp diff --git a/test/test_files/ctv/ctv1.yaml b/test/test_files/ctv/ctv1.yaml index f3981b8..51ff47a 100644 --- a/test/test_files/ctv/ctv1.yaml +++ b/test/test_files/ctv/ctv1.yaml @@ -1,4 +1,4 @@ -exawind: +kynema_driver: kynema_ugf_inp: - ctv-ugf1.yaml kynema_sgf_inp: ctv-sgf1.inp diff --git a/test/test_files/ctv/ctv2.yaml b/test/test_files/ctv/ctv2.yaml index b5292a3..5a9025c 100644 --- a/test/test_files/ctv/ctv2.yaml +++ b/test/test_files/ctv/ctv2.yaml @@ -1,4 +1,4 @@ -exawind: +kynema_driver: kynema_ugf_inp: - ctv-ugf2.yaml kynema_sgf_inp: ctv-sgf2.inp diff --git a/test/test_files/ctv/ctv3.yaml b/test/test_files/ctv/ctv3.yaml index 4b26792..252b27c 100644 --- a/test/test_files/ctv/ctv3.yaml +++ b/test/test_files/ctv/ctv3.yaml @@ -1,4 +1,4 @@ -exawind: +kynema_driver: kynema_ugf_inp: - ctv-ugf3.yaml kynema_sgf_inp: ctv-sgf3.inp diff --git a/test/test_files/dam-break-block/dam-break-block.yaml b/test/test_files/dam-break-block/dam-break-block.yaml index 46f2fa6..509b29f 100644 --- a/test/test_files/dam-break-block/dam-break-block.yaml +++ b/test/test_files/dam-break-block/dam-break-block.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - dam-break-block-ugf.yaml kynema_sgf_inp: dam-break-block-sgf.inp diff --git a/test/test_files/flat-surface/flat-surface.yaml b/test/test_files/flat-surface/flat-surface.yaml index 6ec07ca..e98b7ae 100644 --- a/test/test_files/flat-surface/flat-surface.yaml +++ b/test/test_files/flat-surface/flat-surface.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - flat-surface-ugf.yaml kynema_sgf_inp: flat-surface-sgf.inp diff --git a/test/test_files/floating-block/floating-block.yaml b/test/test_files/floating-block/floating-block.yaml index 04347df..945a144 100644 --- a/test/test_files/floating-block/floating-block.yaml +++ b/test/test_files/floating-block/floating-block.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - floating-block-ugf.yaml kynema_sgf_inp: floating-block-sgf.inp diff --git a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml index 5e474ba..5259a01 100644 --- a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml +++ b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: # we can change things globally across all instances by providing a trace through # the graph to the end values we want to edit ugf_replace_all: diff --git a/test/test_files/linear-waves/linear-waves.yaml b/test/test_files/linear-waves/linear-waves.yaml index db613a4..f400ff0 100644 --- a/test/test_files/linear-waves/linear-waves.yaml +++ b/test/test_files/linear-waves/linear-waves.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - linear-waves-ugf.yaml kynema_sgf_inp: linear-waves-sgf.inp diff --git a/test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml b/test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml index 20f022b..1c417e2 100644 --- a/test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml +++ b/test/test_files/sgf-ugf-cylinder-motion/sgf-ugf-cylinder-motion.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - cylinder-ugf.yaml kynema_sgf_inp: cylinder-sgf.inp diff --git a/test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml b/test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml index 20f022b..1c417e2 100644 --- a/test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml +++ b/test/test_files/sgf-ugf-cylinder/sgf-ugf-cylinder.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - cylinder-ugf.yaml kynema_sgf_inp: cylinder-sgf.inp diff --git a/test/test_files/sloshing-tank/sloshing-tank.yaml b/test/test_files/sloshing-tank/sloshing-tank.yaml index d674e56..fa1aea9 100644 --- a/test/test_files/sloshing-tank/sloshing-tank.yaml +++ b/test/test_files/sloshing-tank/sloshing-tank.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - sloshing-tank-ugf.yaml kynema_sgf_inp: sloshing-tank-sgf.inp diff --git a/test/test_files/sphere/sphere.yaml b/test/test_files/sphere/sphere.yaml index 1f7ad30..67dfd82 100644 --- a/test/test_files/sphere/sphere.yaml +++ b/test/test_files/sphere/sphere.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - sphere-ugf.yaml kynema_sgf_inp: sphere-sgf.inp diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml index 496d41c..cb75a57 100644 --- a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml +++ b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - stokes-waves-cylinder-ugf.yaml kynema_sgf_inp: stokes-waves-cylinder-sgf.inp diff --git a/test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml b/test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml index 3338063..91d906e 100644 --- a/test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml +++ b/test/test_files/ugf-ugf-cylinder-motion/ugf-ugf-cylinder-motion.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - cylinder-ugf-far.yaml - cylinder-ugf-near.yaml diff --git a/test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml b/test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml index 3338063..91d906e 100644 --- a/test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml +++ b/test/test_files/ugf-ugf-cylinder/ugf-ugf-cylinder.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - cylinder-ugf-far.yaml - cylinder-ugf-near.yaml diff --git a/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml b/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml index c575940..b34bf1e 100644 --- a/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml +++ b/test/test_files/ugf-ugf-panel/ugf-ugf-panel.yaml @@ -1,6 +1,6 @@ # Example input file -exawind: +kynema_driver: kynema_ugf_inp: - ugf_platform.yaml - ugf_panel.yaml diff --git a/test/test_files/zalesak/zalesak.yaml b/test/test_files/zalesak/zalesak.yaml index 299e210..34d1371 100644 --- a/test/test_files/zalesak/zalesak.yaml +++ b/test/test_files/zalesak/zalesak.yaml @@ -1,5 +1,5 @@ -exawind: +kynema_driver: kynema_ugf_inp: - zalesak-ugf.yaml kynema_sgf_inp: zalesak-sgf.inp From 7e7905d216db1b8f9ff556922eca20820cfb217b Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Fri, 24 Apr 2026 22:33:47 -0600 Subject: [PATCH 09/22] formatting --- app/kynema/kynema.cpp | 24 +++++++++++------------- src/KynemaSGF.cpp | 5 ++++- src/KynemaUGF.cpp | 5 +---- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/app/kynema/kynema.cpp b/app/kynema/kynema.cpp index f35bc7a..95d67ab 100644 --- a/app/kynema/kynema.cpp +++ b/app/kynema/kynema.cpp @@ -14,8 +14,7 @@ static std::string usage(std::string name) { - return "usage: " + name + - " [--sgf NPROCS] [--ugf NPROCS] input_file\n" + + return "usage: " + name + " [--sgf NPROCS] [--ugf NPROCS] input_file\n" + "\t-h,--help\t\tShow this help message\n" + "\t--sgf NPROCS\t\tNumber of ranks for Kynema-SGF (default = all " "ranks)\n" + @@ -68,8 +67,7 @@ int main(int argc, char** argv) "--sgf option requesting more ranks than available."); } } else { - throw std::runtime_error( - "--sgf option requires one argument."); + throw std::runtime_error("--sgf option requires one argument."); } } else if (arg == "--ugf") { if (i + 1 < argc) { @@ -80,8 +78,7 @@ int main(int argc, char** argv) "--ugf option requesting more ranks than available."); } } else { - throw std::runtime_error( - "--ugf option requires one argument."); + throw std::runtime_error("--ugf option requires one argument."); } } else { inpfile = argv[i]; @@ -178,9 +175,9 @@ int main(int argc, char** argv) "Initializing " + std::to_string(num_ugf_solvers) + " Kynema-UGF solvers, equally partitioned on a total of " + std::to_string(num_ugf_ranks) + " MPI ranks"); - if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { - return comm != MPI_COMM_NULL; - })) { + if (std::any_of( + kynema_ugf_comms.begin(), kynema_ugf_comms.end(), + [](const auto& comm) { return comm != MPI_COMM_NULL; })) { driver::KynemaUGF::initialize(); } sim.set_ugf_start_rank(kynema_ugf_start_rank); @@ -284,7 +281,8 @@ int main(int argc, char** argv) } sim.register_solver( - i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, ugf_vars); + i + 1, kynema_ugf_comms.at(i), kynema_ugf_yaml, logfile, + ugf_vars); } } @@ -308,9 +306,9 @@ int main(int argc, char** argv) driver::KynemaSGF::finalize(); out.close(); } - if (std::any_of(kynema_ugf_comms.begin(), kynema_ugf_comms.end(), [](const auto& comm) { - return comm != MPI_COMM_NULL; - })) { + if (std::any_of( + kynema_ugf_comms.begin(), kynema_ugf_comms.end(), + [](const auto& comm) { return comm != MPI_COMM_NULL; })) { driver::KynemaUGF::finalize(); } MPI_Finalize(); diff --git a/src/KynemaSGF.cpp b/src/KynemaSGF.cpp index 14dbfdb..62338ea 100644 --- a/src/KynemaSGF.cpp +++ b/src/KynemaSGF.cpp @@ -105,7 +105,10 @@ bool KynemaSGF::is_fixed_timestep_size() return (!m_incflo.sim().time().adaptive_timestep()); } -void KynemaSGF::advance_timestep(size_t inonlin) { m_incflo.do_advance(inonlin); } +void KynemaSGF::advance_timestep(size_t inonlin) +{ + m_incflo.do_advance(inonlin); +} void KynemaSGF::post_advance() { m_incflo.post_advance_work(); } diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index 74a7872..1825893 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -97,10 +97,7 @@ void KynemaUGF::pre_advance_stage2(size_t inonlin) m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); } -double KynemaUGF::get_time() -{ - return m_sim.timeIntegrator_->get_time(); -} +double KynemaUGF::get_time() { return m_sim.timeIntegrator_->get_time(); } double KynemaUGF::get_timestep_size() { From 0795cb06b4eaad53657139bd239b6654e0d01436 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 09:09:04 -0600 Subject: [PATCH 10/22] correct meshes submodule path --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f696431..856bf33 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "test/meshes"] path = test/meshes - url = https://github.com/Exawind/meshes.git + url = https://github.com/Kynema/kynema-ugf-meshes.git From 8cd35889f2c7d4154d23fb87efd89f41b59269ad Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 09:10:41 -0600 Subject: [PATCH 11/22] more switches from Exawind to Kynema --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- CTestConfig.cmake | 4 ++-- src/CMakeLists.txt | 4 ++-- src/KynemaSGF.h | 4 ++-- src/KynemaUGF.h | 4 ++-- src/OversetSimulation.cpp | 6 +++--- src/OversetSimulation.h | 4 ++-- test/CMakeLists.txt | 2 +- test/CTestNightlyScript.cmake | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54386f7..8ab5780 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Exawind-CI +name: KynemaDriver-CI on: push: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5830fad..fbf7e35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ find_package(YAML-CPP 0.6.2 REQUIRED) find_package(MPI REQUIRED) # General information about machine, compiler, and build type -message(STATUS "Exawind information:") +message(STATUS "Kynema information:") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}") diff --git a/CTestConfig.cmake b/CTestConfig.cmake index a9fad59..5c3b6c7 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,6 +1,6 @@ -set(CTEST_PROJECT_NAME "Exawind") +set(CTEST_PROJECT_NAME "Kynema") set(CTEST_NIGHTLY_START_TIME "00:00:00 EDT") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=Exawind") +set(CTEST_DROP_LOCATION "/submit.php?project=Kynema") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db2f20f..be02fb3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,8 @@ target_sources(${KYNEMA_LIB_NAME} PRIVATE SGFTiogaIface.h KynemaSGF.cpp KynemaSGF.h - ExawindSolver.h - ExawindSolver.cpp + KynemaSolver.h + KynemaSolver.cpp MPIUtilities.h KynemaUGF.cpp KynemaUGF.h diff --git a/src/KynemaSGF.h b/src/KynemaSGF.h index cb153a8..7864f9b 100644 --- a/src/KynemaSGF.h +++ b/src/KynemaSGF.h @@ -1,6 +1,6 @@ #include "src/incflo.H" #include "AMRTiogaIface.h" -#include "ExawindSolver.h" +#include "KynemaSolver.h" namespace TIOGA { class tioga; @@ -8,7 +8,7 @@ class tioga; namespace driver { -class KynemaSGF : public ExawindSolver +class KynemaSGF : public KynemaSolver { private: incflo m_incflo; diff --git a/src/KynemaUGF.h b/src/KynemaUGF.h index 7168037..99add64 100644 --- a/src/KynemaUGF.h +++ b/src/KynemaUGF.h @@ -7,7 +7,7 @@ #include "Simulation.h" #include "stk_util/parallel/Parallel.hpp" #include "yaml-cpp/yaml.h" -#include "ExawindSolver.h" +#include "KynemaSolver.h" namespace TIOGA { class tioga; @@ -15,7 +15,7 @@ class tioga; namespace driver { -class KynemaUGF : public ExawindSolver +class KynemaUGF : public KynemaSolver { private: YAML::Node m_doc; diff --git a/src/OversetSimulation.cpp b/src/OversetSimulation.cpp index 9961474..afcd8e3 100644 --- a/src/OversetSimulation.cpp +++ b/src/OversetSimulation.cpp @@ -230,11 +230,11 @@ void OversetSimulation::print_timing(const int nt) { // overall timestep timing auto timing_summary = m_timers_exa.get_timings_summary( - "Exawind", nt, m_comm, m_printer.io_rank()); + "Kynema", nt, m_comm, m_printer.io_rank()); m_printer.echo(timing_summary); auto timing_detail = m_timers_exa.get_timings_detail( - "Exawind", nt, m_comm, m_printer.io_rank()); + "Kynema", nt, m_comm, m_printer.io_rank()); m_printer.timing_to_file(timing_detail); MPI_Barrier(m_comm); @@ -281,7 +281,7 @@ long OversetSimulation::mem_usage_all(const int step) &mem, 1, MPI_LONG, memall.data(), 1, MPI_LONG, m_printer.io_rank(), m_comm); - // FIXME: move to separate output files and put in ExawindSolver + // FIXME: move to separate output files and put in KynemaSolver if (m_printer.is_io_rank()) { const std::string filename = "memusage.dat"; std::ofstream fp; diff --git a/src/OversetSimulation.h b/src/OversetSimulation.h index 3d23d3f..e0fa9c2 100644 --- a/src/OversetSimulation.h +++ b/src/OversetSimulation.h @@ -2,7 +2,7 @@ #define OVERSETSIMULATION_H #include "mpi.h" #include "tioga.h" -#include "ExawindSolver.h" +#include "KynemaSolver.h" #include "ParallelPrinter.h" #include "Timers.h" @@ -18,7 +18,7 @@ class OversetSimulation //! World communicator instance MPI_Comm m_comm; //! List of solvers active in this overset simulation - std::vector> m_solvers; + std::vector> m_solvers; //! List of start ranks for all kynema-ugf instances int m_num_ugf_solvers; std::vector m_ugf_start_rank; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ad85c6b..d4d66be 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Exawind Testing +# Kynema Testing #============================================================================= # Check if mesh submodule is populated diff --git a/test/CTestNightlyScript.cmake b/test/CTestNightlyScript.cmake index f27e0e8..7cf26b9 100644 --- a/test/CTestNightlyScript.cmake +++ b/test/CTestNightlyScript.cmake @@ -23,7 +23,7 @@ endif() message(STATUS "\nNumber of processes to use: ${NP}") set(CTEST_SITE "${HOST_NAME}") -set(CTEST_BUILD_NAME "Exawind-${CMAKE_SYSTEM_NAME}${EXTRA_BUILD_NAME}") +set(CTEST_BUILD_NAME "Kynema-${CMAKE_SYSTEM_NAME}${EXTRA_BUILD_NAME}") find_program(CTEST_GIT_COMMAND NAMES git) find_program(MAKE NAMES make) From febc19b855ce200f0c7e00adb40743a5fd8229b6 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 09:12:13 -0600 Subject: [PATCH 12/22] file should have been replaced --- src/Exawind.h | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 src/Exawind.h diff --git a/src/Exawind.h b/src/Exawind.h deleted file mode 100644 index 58541ea..0000000 --- a/src/Exawind.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef KYNEMA_H -#define KYNEMA_H - -namespace driver {} - -#endif /* KYNEMA_H */ From b7bc119609cff147bd20b19b3472154ed7dd43a0 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 09:40:45 -0600 Subject: [PATCH 13/22] fix some filenames and namespaces --- README.md | 4 ++-- src/KynemaSGF.h | 4 ++-- src/KynemaUGF.cpp | 20 +++++++++---------- src/KynemaUGF.h | 2 +- src/SGFTiogaIface.cpp | 4 ++-- src/SGFTiogaIface.h | 4 ++-- .../hybrid-multi-cylinder.yaml | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4a7719c..dac379c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![journal article](https://img.shields.io/badge/DOI-10.1002/we.2886-blue)](https://doi.org/10.1002/we.2886) This repository contains a pure C++ driver API for coupling -[Kynema-UGF](https://github.com/kynema/nalu-wind) and -[Kynema-SGF](https://github.com/kynema/amr-wind) CFD codes. +[Kynema-UGF](https://github.com/kynema/kynema-ugf) and +[Kynema-SGF](https://github.com/kynema/kynema-sgf) CFD codes. ## Citation diff --git a/src/KynemaSGF.h b/src/KynemaSGF.h index 7864f9b..f788ecb 100644 --- a/src/KynemaSGF.h +++ b/src/KynemaSGF.h @@ -1,5 +1,5 @@ #include "src/incflo.H" -#include "AMRTiogaIface.h" +#include "SGFTiogaIface.h" #include "KynemaSolver.h" namespace TIOGA { @@ -12,7 +12,7 @@ class KynemaSGF : public KynemaSolver { private: incflo m_incflo; - AMRTiogaIface m_tgiface; + SGFTiogaIface m_tgiface; std::vector m_cell_vars; std::vector m_node_vars; diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index 1825893..d4add74 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -15,14 +15,14 @@ void KynemaUGF::initialize() { Kokkos::initialize(); // Hypre initialization - nalu_hypre::hypre_initialize(); - nalu_hypre::hypre_set_params(); + kynema_ugf_hypre::hypre_initialize(); + kynema_ugf_hypre::hypre_set_params(); } void KynemaUGF::finalize() { // Hypre cleanup - nalu_hypre::hypre_finalize(); + kynema_ugf_hypre::hypre_finalize(); if (Kokkos::is_initialized()) { Kokkos::finalize(); @@ -38,12 +38,12 @@ KynemaUGF::KynemaUGF( TIOGA::tioga& tg) : m_doc(inp_yaml), m_sim(m_doc), m_fnames(fnames), m_id(id), m_comm(comm) { - auto& env = sierra::nalu::KynemaUGFEnv::self(); + auto& env = sierra::kynema_ugf::KynemaUGFEnv::self(); env.parallelCommunicator_ = comm; MPI_Comm_size(comm, &env.pSize_); MPI_Comm_rank(comm, &env.pRank_); - ::tioga_nalu::TiogaRef::self(&tg); + ::tioga_kynema_ugf::TiogaRef::self(&tg); env.set_log_file_stream(logfile); } @@ -53,12 +53,12 @@ KynemaUGF::~KynemaUGF() = default; void KynemaUGF::init_prolog(bool multi_solver_mode) { // Dump the input yaml to the start of the logfile - // before the nalu banner - auto& env = sierra::nalu::KynemaUGFEnv::self(); - env.naluOutputP0() << std::string(20, '#') << " INPUT FILE START " + // before the kynema_ugf banner + auto& env = sierra::kynema_ugf::KynemaUGFEnv::self(); + env.kynema_ugfOutputP0() << std::string(20, '#') << " INPUT FILE START " << std::string(20, '#') << std::endl; - sierra::nalu::KynemaUGFParsingHelper::emit(*env.naluLogStream_, m_doc); - env.naluOutputP0() << std::string(20, '#') << " INPUT FILE END " + sierra::kynema_ugf::KynemaUGFParsingHelper::emit(*env.kynema_ugfLogStream_, m_doc); + env.kynema_ugfOutputP0() << std::string(20, '#') << " INPUT FILE END " << std::string(20, '#') << std::endl; m_sim.load(m_doc); diff --git a/src/KynemaUGF.h b/src/KynemaUGF.h index 99add64..fb2f18b 100644 --- a/src/KynemaUGF.h +++ b/src/KynemaUGF.h @@ -19,7 +19,7 @@ class KynemaUGF : public KynemaSolver { private: YAML::Node m_doc; - sierra::nalu::Simulation m_sim; + sierra::kynema_ugf::Simulation m_sim; std::vector m_fnames; int m_ncomps; int m_id; diff --git a/src/SGFTiogaIface.cpp b/src/SGFTiogaIface.cpp index f1b6c76..a0010c4 100644 --- a/src/SGFTiogaIface.cpp +++ b/src/SGFTiogaIface.cpp @@ -1,8 +1,8 @@ #include #include "SGFTiogaIface.h" -#include "amr-wind/CFDSim.H" -#include "amr-wind/overset/TiogaInterface.H" +#include "src/CFDSim.H" +#include "src/overset/TiogaInterface.H" #include "TiogaMeshInfo.h" #include "tioga.h" diff --git a/src/SGFTiogaIface.h b/src/SGFTiogaIface.h index 08670b6..e315b5e 100644 --- a/src/SGFTiogaIface.h +++ b/src/SGFTiogaIface.h @@ -13,7 +13,7 @@ class tioga; struct AMRMeshInfo; } // namespace TIOGA -namespace exawind { +namespace driver { class SGFTiogaIface { @@ -39,6 +39,6 @@ class SGFTiogaIface std::unique_ptr m_info; }; -} // namespace exawind +} // namespace driver #endif /* SGFTIOGAIFACE_H */ diff --git a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml index 5259a01..886aafd 100644 --- a/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml +++ b/test/test_files/hybrid-multi-cylinder/hybrid-multi-cylinder.yaml @@ -19,9 +19,9 @@ kynema_driver: ################ - base_input_file: cylinder-ugf.yaml logfile: stationary_front_cylinder.log - # set this value if you want to write the final nalu instances to disk + # set this value if you want to write the final kynema_ugf instances to disk write_final_yaml_to_disk: true - # same syntax as nalu_replace_all but for this specific instance + # same syntax as ugf_replace_all but for this specific instance replace: realms: - mesh_motion: @@ -33,7 +33,7 @@ kynema_driver: ################ # back cylinder ################ - - base_input_file: cylinder-nalu.yaml + - base_input_file: cylinder-ugf.yaml logfile: moving_back_cylinder.log write_final_yaml_to_disk: true replace: From 05177bd3d83da0e74eae6296f2ca3844376104c5 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 09:41:52 -0600 Subject: [PATCH 14/22] correct some (AI) changes that shouldn't be there --- src/KynemaUGF.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index d4add74..2afa49a 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -97,7 +97,7 @@ void KynemaUGF::pre_advance_stage2(size_t inonlin) m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); } -double KynemaUGF::get_time() { return m_sim.timeIntegrator_->get_time(); } +double KynemaUGF::get_time() { return m_sim.timeIntegrator_->get_current_time(); } double KynemaUGF::get_timestep_size() { @@ -106,7 +106,7 @@ double KynemaUGF::get_timestep_size() void KynemaUGF::set_timestep_size(const double dt) { - m_sim.timeIntegrator_->set_timestep_size(dt); + m_sim.timeIntegrator_->set_time_step(dt); } bool KynemaUGF::is_fixed_timestep_size() From 776c6680a4653669182bc76b6bc2d04cf1c98176 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 10:13:30 -0600 Subject: [PATCH 15/22] fix ugf library name --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf7e35..e985e3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(KYNEMA_LIB_NAME "exwsim") +set(KYNEMA_LIB_NAME "kynema-lib") add_library(${KYNEMA_LIB_NAME} OBJECT) add_subdirectory(src) @@ -73,8 +73,8 @@ add_subdirectory(app/kynema) if(KYNEMA_ENABLE_CUDA) include(kynema-utils) - set(ewtargets "${KYNEMA_LIB_NAME};${KYNEMA_EXE_NAME}") - foreach(tgt IN LISTS ewtargets) + set(kyntargets "${KYNEMA_LIB_NAME};${KYNEMA_EXE_NAME}") + foreach(tgt IN LISTS kyntargets) set_cuda_build_properties(${tgt}) endforeach() endif() From f7d1c5185be9935d3b17d036a6099d0c727bffaf Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 10:13:43 -0600 Subject: [PATCH 16/22] actual change of previous commit --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be02fb3..d7c9f56 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC Kynema-SGF::kynema_sgf_api Kynema-SGF::buildInfokynema_sgf_obj AMReX::amrex - Kynema-UGF::kynema_ugf) + Kynema-UGF::kynema-ugf-lib) target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) From d1864579fed3c615326a4154fc2ecfdd80df543e Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 10:27:43 -0600 Subject: [PATCH 17/22] formatting --- src/KynemaUGF.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/KynemaUGF.cpp b/src/KynemaUGF.cpp index 2afa49a..b7f60f3 100644 --- a/src/KynemaUGF.cpp +++ b/src/KynemaUGF.cpp @@ -56,10 +56,11 @@ void KynemaUGF::init_prolog(bool multi_solver_mode) // before the kynema_ugf banner auto& env = sierra::kynema_ugf::KynemaUGFEnv::self(); env.kynema_ugfOutputP0() << std::string(20, '#') << " INPUT FILE START " - << std::string(20, '#') << std::endl; - sierra::kynema_ugf::KynemaUGFParsingHelper::emit(*env.kynema_ugfLogStream_, m_doc); + << std::string(20, '#') << std::endl; + sierra::kynema_ugf::KynemaUGFParsingHelper::emit( + *env.kynema_ugfLogStream_, m_doc); env.kynema_ugfOutputP0() << std::string(20, '#') << " INPUT FILE END " - << std::string(20, '#') << std::endl; + << std::string(20, '#') << std::endl; m_sim.load(m_doc); if (m_sim.timeIntegrator_->overset_ != nullptr) @@ -97,7 +98,10 @@ void KynemaUGF::pre_advance_stage2(size_t inonlin) m_sim.timeIntegrator_->pre_realm_advance_stage2(inonlin); } -double KynemaUGF::get_time() { return m_sim.timeIntegrator_->get_current_time(); } +double KynemaUGF::get_time() +{ + return m_sim.timeIntegrator_->get_current_time(); +} double KynemaUGF::get_timestep_size() { From 4fb0fe9b46ff8b4a434333a7ad67633fe818584d Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 27 Apr 2026 11:55:45 -0600 Subject: [PATCH 18/22] update kynema-fmb arguments in reg test due to changes in kynema-ugf --- test/test_files/floating-block/floating-block-ugf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_files/floating-block/floating-block-ugf.yaml b/test/test_files/floating-block/floating-block-ugf.yaml index c35c5bb..4b4ec11 100644 --- a/test/test_files/floating-block/floating-block-ugf.yaml +++ b/test/test_files/floating-block/floating-block-ugf.yaml @@ -101,7 +101,7 @@ realms: wall_parts: [block] ovset_parts: [ovst_bdy] - kynema_six_dof: + kynema_fmb_six_dof: gravity: [0.0, 0.0, -9.81] number_of_bodies: 1 Body0: From b1b8b41da0655919f6d9bf54dd83bc214b3c8067 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 29 Apr 2026 14:50:24 -0600 Subject: [PATCH 19/22] switch more things to kynema-driver instead of just kynema Co-authored-by: Copilot --- .github/workflows/ci.yml | 8 +-- CMakeLists.txt | 55 +++++++++++-------- app/kynema/CMakeLists.txt | 12 ---- ...-utils.cmake => kynema-driver-utils.cmake} | 4 +- app/kynema/kynema.cpp => kynema_driver.cpp | 4 +- src/CMakeLists.txt | 10 ++-- src/Kynema.h | 6 -- test/CMakeLists.txt | 26 ++++----- 8 files changed, 58 insertions(+), 67 deletions(-) delete mode 100644 app/kynema/CMakeLists.txt rename cmake/{kynema-utils.cmake => kynema-driver-utils.cmake} (89%) rename app/kynema/kynema.cpp => kynema_driver.cpp (99%) delete mode 100644 src/Kynema.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ab5780..28c904c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,10 +40,10 @@ jobs: source ${KYNEMA_MANAGER}/start.sh && spack-start && \ spack env activate e4s-build && \ cd ${KYNEMA_MANAGER}/environments/e4s-build && \ - ln -s ${GITHUB_WORKSPACE} kynema && \ - spack develop --no-modify-concrete-specs --no-clone kynema@=master && \ + ln -s ${GITHUB_WORKSPACE} kynema-driver && \ + spack develop --no-modify-concrete-specs --no-clone kynema-driver@=main && \ spack concretize -f && \ spack install && \ - spack cd -b kynema && \ - spack build-env kynema ctest -j $(nproc) -LE no-ci --output-on-failure \ + spack cd -b kynema-driver && \ + spack build-env kynema-driver ctest -j $(nproc) -LE no-ci --output-on-failure \ " diff --git a/CMakeLists.txt b/CMakeLists.txt index e985e3c..c1961a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR) -project(kynema CXX C) +project(kynema-driver CXX C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") @@ -8,21 +8,21 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) -option(KYNEMA_ENABLE_TESTS "Enable testing suite" ON) -option(KYNEMA_TEST_WITH_FCOMPARE "Check Kynema-SGF test plots against gold files" OFF) -option(KYNEMA_SAVE_GOLDS "Provide a directory in which to save golds during testing" OFF) -option(KYNEMA_ENABLE_CUDA "Enable CUDA" OFF) -option(KYNEMA_ENABLE_CUDA_RDC "Enable CUDA relocatable device code" OFF) -option(KYNEMA_ENABLE_ROCM "Enable HIP" OFF) -option(KYNEMA_ENABLE_UMPIRE "Enable Umpire GPU memory pools" OFF) +option(KYNEMA_DRIVER_ENABLE_TESTS "Enable testing suite" ON) +option(KYNEMA_DRIVER_TEST_WITH_FCOMPARE "Check Kynema-SGF test plots against gold files" OFF) +option(KYNEMA_DRIVER_SAVE_GOLDS "Provide a directory in which to save golds during testing" OFF) +option(KYNEMA_DRIVER_ENABLE_CUDA "Enable CUDA" OFF) +option(KYNEMA_DRIVER_ENABLE_CUDA_RDC "Enable CUDA relocatable device code" OFF) +option(KYNEMA_DRIVER_ENABLE_ROCM "Enable HIP" OFF) +option(KYNEMA_DRIVER_ENABLE_UMPIRE "Enable Umpire GPU memory pools" OFF) -if(KYNEMA_ENABLE_CUDA) +if(KYNEMA_DRIVER_ENABLE_CUDA) enable_language(CUDA) find_package(CUDAToolkit REQUIRED) - set(KYNEMA_CUDA_ARCH "70" CACHE STRING "CUDA architecture (Use 'Auto' for automatic detection)") + set(KYNEMA_DRIVER_CUDA_ARCH "70" CACHE STRING "CUDA architecture (Use 'Auto' for automatic detection)") endif() -if(KYNEMA_ENABLE_ROCM) +if(KYNEMA_DRIVER_ENABLE_ROCM) find_package(hip REQUIRED) find_package(rocrand REQUIRED CONFIG) find_package(rocprim REQUIRED CONFIG) @@ -30,7 +30,7 @@ if(KYNEMA_ENABLE_ROCM) find_package(hiprand REQUIRED CONFIG) endif() -if (KYNEMA_ENABLE_UMPIRE) +if (KYNEMA_DRIVER_ENABLE_UMPIRE) set(CMAKE_PREFIX_PATH ${UMPIRE_DIR} ${CMAKE_PREFIX_PATH}) find_package(Umpire REQUIRED) include_directories(SYSTEM ${UMPIRE_INCLUDE_DIRS}) @@ -52,7 +52,7 @@ find_package(YAML-CPP 0.6.2 REQUIRED) find_package(MPI REQUIRED) # General information about machine, compiler, and build type -message(STATUS "Kynema information:") +message(STATUS "Kynema-Driver information:") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}") @@ -63,26 +63,35 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -set(KYNEMA_LIB_NAME "kynema-lib") -add_library(${KYNEMA_LIB_NAME} OBJECT) +set(KYNEMA_DRIVER_LIB_NAME "kynema_driver_lib") +add_library(${KYNEMA_DRIVER_LIB_NAME} OBJECT) add_subdirectory(src) -set(KYNEMA_EXE_NAME "kynema") -add_executable(${KYNEMA_EXE_NAME}) -add_subdirectory(app/kynema) +set(KYNEMA_DRIVER_EXE_NAME "kynema_driver") +add_executable(${KYNEMA_DRIVER_EXE_NAME}) -if(KYNEMA_ENABLE_CUDA) - include(kynema-utils) - set(kyntargets "${KYNEMA_LIB_NAME};${KYNEMA_EXE_NAME}") +target_sources(${KYNEMA_DRIVER_EXE_NAME} PRIVATE + kynema_driver.cpp) +target_link_libraries(${KYNEMA_DRIVER_EXE_NAME} PRIVATE + ${KYNEMA_DRIVER_LIB_NAME} + yaml-cpp) +target_include_directories(${KYNEMA_DRIVER_EXE_NAME} SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR}) +if(KYNEMA_DRIVER_ENABLE_ROCM) + target_compile_definitions(${KYNEMA_DRIVER_EXE_NAME} PRIVATE KYNEMA_DRIVER_ENABLE_ROCM) +endif() + +if(KYNEMA_DRIVER_ENABLE_CUDA) + include(kynema-driver-utils) + set(kyntargets "${KYNEMA_DRIVER_LIB_NAME};${KYNEMA_DRIVER_EXE_NAME}") foreach(tgt IN LISTS kyntargets) set_cuda_build_properties(${tgt}) endforeach() endif() -if(KYNEMA_ENABLE_TESTS) +if(KYNEMA_DRIVER_ENABLE_TESTS) enable_testing() include(CTest) add_subdirectory(test) endif() -install(TARGETS ${KYNEMA_EXE_NAME}) +install(TARGETS ${KYNEMA_DRIVER_EXE_NAME}) diff --git a/app/kynema/CMakeLists.txt b/app/kynema/CMakeLists.txt deleted file mode 100644 index 4a9bce0..0000000 --- a/app/kynema/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -target_sources(${KYNEMA_EXE_NAME} PRIVATE - kynema.cpp) - -target_link_libraries(${KYNEMA_EXE_NAME} PRIVATE - ${KYNEMA_LIB_NAME} - yaml-cpp) - -target_include_directories(${KYNEMA_EXE_NAME} SYSTEM PRIVATE ${YAML_CPP_INCLUDE_DIR}) - -if(KYNEMA_ENABLE_ROCM) - target_compile_definitions(${KYNEMA_EXE_NAME} PRIVATE KYNEMA_ENABLE_ROCM) -endif() diff --git a/cmake/kynema-utils.cmake b/cmake/kynema-driver-utils.cmake similarity index 89% rename from cmake/kynema-utils.cmake rename to cmake/kynema-driver-utils.cmake index c3f8286..3712400 100644 --- a/cmake/kynema-utils.cmake +++ b/cmake/kynema-driver-utils.cmake @@ -2,10 +2,10 @@ function(set_cuda_build_properties target) get_target_property(_tgt_src ${target} SOURCES) list(FILTER _tgt_src INCLUDE REGEX "\\.cpp") set_source_files_properties(${_tgt_src} PROPERTIES LANGUAGE CUDA) - set_target_properties(${target} PROPERTIES CUDA_ARCHITECTURES "${KYNEMA_CUDA_ARCH}") + set_target_properties(${target} PROPERTIES CUDA_ARCHITECTURES "${KYNEMA_DRIVER_CUDA_ARCH}") set_target_properties(${target} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON) #set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CUDA) - if(KYNEMA_ENABLE_CUDA_RDC) + if(KYNEMA_DRIVER_ENABLE_CUDA_RDC) set_target_properties(${target} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() endfunction(set_cuda_build_properties) diff --git a/app/kynema/kynema.cpp b/kynema_driver.cpp similarity index 99% rename from app/kynema/kynema.cpp rename to kynema_driver.cpp index 95d67ab..d929509 100644 --- a/app/kynema/kynema.cpp +++ b/kynema_driver.cpp @@ -8,7 +8,7 @@ #include "tioga.h" // Workaround for MPI issue on OLCF Frontier machine -#ifdef KYNEMA_ENABLE_ROCM +#ifdef KYNEMA_DRIVER_ENABLE_ROCM #include #endif @@ -37,7 +37,7 @@ replace_extension(const std::string& filepath, const std::string& newExt) int main(int argc, char** argv) { // Workaround for MPI issue on OLCF Frontier machine -#ifdef KYNEMA_ENABLE_ROCM +#ifdef KYNEMA_DRIVER_ENABLE_ROCM hipInit(0); #endif MPI_Init(&argc, &argv); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d7c9f56..88c86c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${KYNEMA_LIB_NAME} PRIVATE +target_sources(${KYNEMA_DRIVER_DRIVER_LIB_NAME} PRIVATE SGFTiogaIface.cpp SGFTiogaIface.h KynemaSGF.cpp @@ -14,17 +14,17 @@ target_sources(${KYNEMA_LIB_NAME} PRIVATE MemoryUsage.h MemoryUsage.cpp) -target_include_directories(${KYNEMA_LIB_NAME} PUBLIC +target_include_directories(${KYNEMA_DRIVER_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC +target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC Kynema-SGF::kynema_sgf_api Kynema-SGF::buildInfokynema_sgf_obj AMReX::amrex Kynema-UGF::kynema-ugf-lib) -target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) -target_link_libraries(${KYNEMA_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) +target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) +target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) # Solve -fallow-argument-mismatch from fortran possibly making its way into arguments passed to clang #if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$") diff --git a/src/Kynema.h b/src/Kynema.h deleted file mode 100644 index 58541ea..0000000 --- a/src/Kynema.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef KYNEMA_H -#define KYNEMA_H - -namespace driver {} - -#endif /* KYNEMA_H */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d4d66be..53bbd53 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,25 +14,25 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake) -if(KYNEMA_TEST_WITH_FCOMPARE) +if(KYNEMA_DRIVER_TEST_WITH_FCOMPARE) set(FCOMPARE_EXE "${FCOMPARE_EXE}" CACHE STRING "Path to fcompare executable for regression tests") - if("${KYNEMA_REFERENCE_GOLDS_DIRECTORY}" STREQUAL "") - message(FATAL_ERROR "To reference gold files, KYNEMA_REFERENCE_GOLDS_DIRECTORY must be set and exist") + if("${KYNEMA_DRIVER_REFERENCE_GOLDS_DIRECTORY}" STREQUAL "") + message(FATAL_ERROR "To reference gold files, KYNEMA_DRIVER_REFERENCE_GOLDS_DIRECTORY must be set and exist") else() - set(GOLD_FILES_DIRECTORY ${KYNEMA_REFERENCE_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) + set(GOLD_FILES_DIRECTORY ${KYNEMA_DRIVER_REFERENCE_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) message(STATUS "Test golds directory for fcompare: ${GOLD_FILES_DIRECTORY}") endif() endif() -if(KYNEMA_SAVE_GOLDS) - if("${KYNEMA_SAVED_GOLDS_DIRECTORY}" STREQUAL "") - message(FATAL_ERROR "To save gold files, KYNEMA_SAVED_GOLDS_DIRECTORY must be set and the directory exist") +if(KYNEMA_DRIVER_SAVE_GOLDS) + if("${KYNEMA_DRIVER_SAVED_GOLDS_DIRECTORY}" STREQUAL "") + message(FATAL_ERROR "To save gold files, KYNEMA_DRIVER_SAVED_GOLDS_DIRECTORY must be set and the directory exist") else() - if(EXISTS ${KYNEMA_SAVED_GOLDS_DIRECTORY}) - set(SAVED_GOLDS_DIRECTORY ${KYNEMA_SAVED_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) + if(EXISTS ${KYNEMA_DRIVER_SAVED_GOLDS_DIRECTORY}) + set(SAVED_GOLDS_DIRECTORY ${KYNEMA_DRIVER_SAVED_GOLDS_DIRECTORY}/${CMAKE_SYSTEM_NAME}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_CXX_COMPILER_VERSION}) message(STATUS "Gold files will be saved to: ${SAVED_GOLDS_DIRECTORY}") else() - message(FATAL_ERROR "Specified directory for saving gold files does not exist: ${KYNEMA_SAVED_GOLDS_DIRECTORY}") + message(FATAL_ERROR "Specified directory for saving gold files does not exist: ${KYNEMA_DRIVER_SAVED_GOLDS_DIRECTORY}") endif() endif() endif() @@ -55,11 +55,11 @@ macro(setup_test) if(AMReX_CUDA OR AMReX_HIP OR AMReX_SYCL) set(FCOMPARE_TOLERANCE "-r 1e-10 --abs_tol 1.0e-12") endif() - if(KYNEMA_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) + if(KYNEMA_DRIVER_SAVE_GOLDS AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) file(MAKE_DIRECTORY ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}) set(SAVE_GOLDS_COMMAND "&& cp -R ${PLOT_TEST} ${SAVED_GOLDS_DIRECTORY}/${TEST_NAME}/") endif() - if(KYNEMA_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) + if(KYNEMA_DRIVER_TEST_WITH_FCOMPARE AND (NOT "${TEST_NAME}" MATCHES "^ugf-ugf")) set(FCOMPARE_COMMAND "&& CUDA_LAUNCH_BLOCKING=1 ${FCOMPARE_EXE} ${FCOMPARE_TOLERANCE} ${PLOT_GOLD} ${PLOT_TEST}") endif() execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink @@ -70,7 +70,7 @@ endmacro(setup_test) # Standard regression test function(add_test_r TEST_NAME) setup_test() - add_test(${TEST_NAME} bash -c "set -o pipefail && ${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${KYNEMA_EXE_NAME} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.yaml 2>&1 | tee ${TEST_NAME}.log ${SAVE_GOLDS_COMMAND} ${FCOMPARE_COMMAND}") + add_test(${TEST_NAME} bash -c "set -o pipefail && ${MPI_COMMANDS} ${CMAKE_BINARY_DIR}/${KYNEMA_DRIVER_EXE_NAME} ${MPIEXEC_POSTFLAGS} ${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.yaml 2>&1 | tee ${TEST_NAME}.log ${SAVE_GOLDS_COMMAND} ${FCOMPARE_COMMAND}") # Set properties for test set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 14400 From 31df91d9fc13961e32e24006e2899e6274acf220 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 29 Apr 2026 15:49:46 -0600 Subject: [PATCH 20/22] try for formatting --- .github/workflows/ci.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28c904c..f1d2948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: DoozyX/clang-format-lint-action@v0.20 with: - source: './app ./src' + source: 'kynema_driver.cpp ./src' exclude: '.' extensions: 'H,h,cpp' clangFormatVersion: 20 diff --git a/README.md b/README.md index dac379c..548fa4c 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,5 @@ To cite ExaWind or the usage of this driver and to learn more about the methodol To pass the format check use this with a new version of `clang-format`: ``` -find ./app ./src \( -name "*.cpp" -o -name "*.H" -o -name "*.h" -o -name "*.C" \) -exec clang-format -i {} + +find kynema_driver.cpp ./src \( -name "*.cpp" -o -name "*.H" -o -name "*.h" -o -name "*.C" \) -exec clang-format -i {} + ``` From 0b16f31253f083a6a54f92e941d2b8bb70012875 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 29 Apr 2026 15:58:52 -0600 Subject: [PATCH 21/22] correct some cmake names --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1961a6..3c10495 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ set(CMAKE_PREFIX_PATH ${Kynema-UGF_DIR} ${Trilinos_DIR} ${Kynema-SGF_DIR} find_package(Kynema-UGF REQUIRED) find_package(Trilinos REQUIRED) find_package(Kynema-SGF REQUIRED) -if(UGF_USES_OPENFAST) +if(KYNEMA_UGF_USES_OPENFAST) enable_language(Fortran) find_package(OpenFAST REQUIRED) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88c86c1..dcb38c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${KYNEMA_DRIVER_DRIVER_LIB_NAME} PRIVATE +target_sources(${KYNEMA_DRIVER_LIB_NAME} PRIVATE SGFTiogaIface.cpp SGFTiogaIface.h KynemaSGF.cpp @@ -21,7 +21,7 @@ target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC Kynema-SGF::kynema_sgf_api Kynema-SGF::buildInfokynema_sgf_obj AMReX::amrex - Kynema-UGF::kynema-ugf-lib) + Kynema-UGF::kynema_ugf_lib) target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC $<$:MPI::MPI_CXX>) target_link_libraries(${KYNEMA_DRIVER_LIB_NAME} PUBLIC $<$:MPI::MPI_Fortran>) From 9fddf2f5a699d6fb315644c242e1875a68bbd55e Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Wed, 29 Apr 2026 16:10:50 -0600 Subject: [PATCH 22/22] one more (FMB-related) --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 53bbd53..17398cf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -111,6 +111,6 @@ add_test_r(ugf-ugf-cylinder) add_test_r(ugf-ugf-cylinder-motion) add_test_re(stokes-waves-cylinder) -if(UGF_USES_FMB) +if(KYNEMA_UGF_USES_KYNEMA_FMB) add_test_r(floating-block) endif() \ No newline at end of file