Skip to content

Commit

Permalink
Fix bc interface from PR 1177
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Nov 9, 2024
1 parent e67f589 commit 503a5b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 9 additions & 6 deletions src/outputs/parthenon_opmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,15 @@ void OpenPMDOutput::WriteOutputFile(Mesh *pm, ParameterInput *pin, SimTime *tm,
pm->mesh_size.nx(X3DIR)});

// Boundary conditions
std::vector<std::string> boundary_condition_str(BOUNDARY_NFACES);
for (size_t i = 0; i < boundary_condition_str.size(); i++) {
boundary_condition_str[i] = GetBoundaryString(pm->mesh_bcs[i]);
}

it.setAttribute("BoundaryConditions", boundary_condition_str);
auto arr_to_vec = [](const auto &arr) {
std::vector<std::string> vec(BOUNDARY_NFACES);
for (int i = 0; i < BOUNDARY_NFACES; i++) {
vec[i] = arr.at(i);
}
return vec;
};
it.setAttribute("BoundaryConditions", arr_to_vec(pm->mesh_bc_names));
it.setAttribute("SwarmBoundaryConditions", arr_to_vec(pm->mesh_swarm_bc_names));
} // Info section

Kokkos::Profiling::popRegion(); // write Attributes
Expand Down
3 changes: 0 additions & 3 deletions src/outputs/restart_opmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ RestartReaderOPMD::MeshInfo RestartReaderOPMD::GetMeshInfo() const {
mesh_info.nbtotal = it->getAttribute("NumMeshBlocks").get<int>();
mesh_info.root_level = it->getAttribute("RootLevel").get<int>();

mesh_info.bound_cond =
it->getAttribute("BoundaryConditions").get<std::vector<std::string>>();

mesh_info.block_size = it->getAttribute("MeshBlockSize").get<std::vector<int>>();
mesh_info.includes_ghost = it->getAttribute("IncludesGhost").get<int>();
mesh_info.n_ghost = it->getAttribute("NGhost").get<int>();
Expand Down

0 comments on commit 503a5b6

Please sign in to comment.