diff --git a/src/ELECTRODE/electrode_vector.cpp b/src/ELECTRODE/electrode_vector.cpp index c09bb19bb2..b979836ff3 100644 --- a/src/ELECTRODE/electrode_vector.cpp +++ b/src/ELECTRODE/electrode_vector.cpp @@ -53,10 +53,12 @@ ElectrodeVector::ElectrodeVector(LAMMPS *lmp, int sensor_group, int source_group ElectrodeVector::~ElectrodeVector() { if (timer_flag && (comm->me == 0)) { - utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total)); - utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total)); - utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total)); - utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total)); + try { + utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total)); + utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total)); + utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total)); + utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total)); + } catch (std::exception &) {} } } diff --git a/src/ELECTRODE/fix_electrode_conp.cpp b/src/ELECTRODE/fix_electrode_conp.cpp index 0122aeeffe..e42a2ab138 100644 --- a/src/ELECTRODE/fix_electrode_conp.cpp +++ b/src/ELECTRODE/fix_electrode_conp.cpp @@ -1055,10 +1055,12 @@ double FixElectrodeConp::gausscorr(int eflag, bool fflag) FixElectrodeConp::~FixElectrodeConp() { if (timer_flag && (comm->me == 0)) { - utils::logmesg(lmp, fmt::format("Multiplication time: {:.4g} s\n", mult_time)); - utils::logmesg(lmp, fmt::format("Update time: {:.4g} s\n", update_time)); + try { + utils::logmesg(lmp, fmt::format("Multiplication time: {:.4g} s\n", mult_time)); + utils::logmesg(lmp, fmt::format("Update time: {:.4g} s\n", update_time)); + } catch (std::exception &) {} } - if (modify->find_fix(id) != -1) // avoid segfault if derived fixes' ctor throws err + if (!modify->get_fix_by_id(id)) // avoid segfault if derived fixes' ctor throws err atom->delete_callback(id, Atom::GROW); // atomvec track local electrode atoms delete[] recvcounts; delete[] displs;