Skip to content

Commit 5c29600

Browse files
authored
exception correction (#1107)
1 parent 675e73b commit 5c29600

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/amr/solvers/solver_ppc.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "core/def/phare_mpi.hpp" // IWYU pragma: keep
55

66
#include "core/numerics/ohm/ohm.hpp"
7+
#include "core/utilities/mpi_utils.hpp"
78
#include "core/numerics/ampere/ampere.hpp"
89
#include "core/data/vecfield/vecfield.hpp"
910
#include "core/numerics/faraday/faraday.hpp"
@@ -553,13 +554,20 @@ void SolverPPC<HybridModel, AMR_Types>::moveIons_(level_t& level, ModelViews_t&
553554
TimeSetter setTime{views, newTime};
554555
auto const& levelBoxing = boxing[level.getLevelNumber()];
555556

557+
try
556558
{
557559
auto dt = newTime - currentTime;
558560
for (auto& state : views)
559561
ionUpdater_.updatePopulations(
560562
state.ions, state.electromagAvg,
561563
levelBoxing.at(amr::to_string(state.patch->getGlobalId())), dt, mode);
562564
}
565+
catch (core::DictionaryException const& ex)
566+
{
567+
PHARE_LOG_ERROR(ex());
568+
}
569+
if (core::mpi::any(core::Errors::instance().any()))
570+
throw core::DictionaryException{}("ID", "Updater::updatePopulations");
563571

564572
// this needs to be done before calling the messenger
565573
setTime([](auto& state) -> auto& { return state.ions; });
@@ -569,17 +577,8 @@ void SolverPPC<HybridModel, AMR_Types>::moveIons_(level_t& level, ModelViews_t&
569577
fromCoarser.fillIonPopMomentGhosts(views.model().state.ions, level, newTime);
570578
fromCoarser.fillIonGhostParticles(views.model().state.ions, level, newTime);
571579

572-
try
573-
{
574-
for (auto& state : views)
575-
ionUpdater_.updateIons(state.ions);
576-
}
577-
catch (core::DictionaryException const& ex)
578-
{
579-
PHARE_LOG_ERROR(ex());
580-
}
581-
if (core::mpi::any(core::Errors::instance().any()))
582-
throw core::DictionaryException{}("ID", "Updater::updatePopulations");
580+
for (auto& state : views)
581+
ionUpdater_.updateIons(state.ions);
583582

584583
// no need to update time, since it has been done before
585584
// now Ni and Vi are calculated we can fill pure ghost nodes

src/core/numerics/ohm/ohm.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define PHARE_OHM_HPP
33

44

5+
#include "core/utilities/index/index.hpp"
56
#include "core/data/grid/gridlayoutdefs.hpp"
67
#include "core/data/grid/gridlayout_utils.hpp"
78
#include "core/data/vecfield/vecfield_component.hpp"

0 commit comments

Comments
 (0)