From 584c87a8a1c84039b113d07dc4e987296d919e96 Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Wed, 10 Jun 2026 08:07:02 +0200 Subject: [PATCH 1/2] fix(core): Demote anchors below seabed from error to warning --- source/Line.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/Line.cpp b/source/Line.cpp index 1741a5a4..bcbcc684 100644 --- a/source/Line.cpp +++ b/source/Line.cpp @@ -546,9 +546,8 @@ Line::initialize() // so now we can proceed with figuring out the positions of the nodes along // the line. if (getWaterDepth(r[0][0], r[0][1]) > r[0][2]) { - LOGERR << "Water depth is shallower than Line " << number << " anchor" + LOGWRN << "Water depth is shallower than Line " << number << " anchor" << endl; - throw moordyn::invalid_value_error("Invalid water depth"); } // TODO - determine if F should be for each segment or for each node, From 9871815031df318d94fea6502ae62c4542eb67f4 Mon Sep 17 00:00:00 2001 From: Jose Luis Cercos-Pita Date: Wed, 10 Jun 2026 08:13:02 +0200 Subject: [PATCH 2/2] fix(core): Catch the exceptions when initializing the time integrator, instead of crashing --- source/MoorDyn2.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/source/MoorDyn2.cpp b/source/MoorDyn2.cpp index d9970cbb..5c39c5da 100644 --- a/source/MoorDyn2.cpp +++ b/source/MoorDyn2.cpp @@ -203,7 +203,12 @@ moordyn::MoorDyn::icLegacy() const unsigned int convergence_iters = 9; // 10 iterations, indexed 0-9 ICdt = ICdt / (convergence_iters + 1); - _t_integrator->Init(); + try { + _t_integrator->Init(); + } + MOORDYN_CATCHER(err, err_msg); + if (err != MOORDYN_SUCCESS) + return err; if (ICfile != "") { try { _t_integrator->LoadState(_basepath + ICfile); @@ -371,7 +376,12 @@ moordyn::MoorDyn::icStationary() for (auto obj : LineList) t_integrator.AddLine(obj); t_integrator.SetCFL((std::min)(cfl, 1.0)); - t_integrator.Init(); + try { + t_integrator.Init(); + } + MOORDYN_CATCHER(err, err_msg); + if (err != MOORDYN_SUCCESS) + return err; if (ICfile != "") { try { t_integrator.LoadState(_basepath + ICfile); @@ -574,7 +584,13 @@ moordyn::MoorDyn::Init(const double* x, const double* xd, bool skip_ic) } } else { - _t_integrator->Init(); + try { + _t_integrator->Init(); + } + MOORDYN_CATCHER(err, err_msg); + if (err != MOORDYN_SUCCESS) + return err; + if (ICfile != "") { try { _t_integrator->LoadState(_basepath + ICfile);