From 84576f59f0a6aebbf6c5f21bee3987e965dedee8 Mon Sep 17 00:00:00 2001 From: Tomislav Maric Date: Sun, 14 Apr 2024 14:26:37 +0200 Subject: [PATCH] [meshMotion] bugfix: end-time check in mesh-motion solver --- .../displacementSmartSimMotionSolver.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/displacementSmartSimMotionSolver/displacementSmartSimMotionSolver.C b/src/displacementSmartSimMotionSolver/displacementSmartSimMotionSolver.C index 711cf16..8079ea7 100644 --- a/src/displacementSmartSimMotionSolver/displacementSmartSimMotionSolver.C +++ b/src/displacementSmartSimMotionSolver/displacementSmartSimMotionSolver.C @@ -130,6 +130,7 @@ void Foam::displacementSmartSimMotionSolver::solve() if ((meshBoundary[patchI].type() == "empty") || (meshBoundary[patchI].type() == "processor")) { + // DEBUG INFO //Pout << "Skipping " << meshBoundary[patchI].name() << ", " // << meshBoundary[patchI].type() << endl; continue; @@ -149,12 +150,14 @@ void Foam::displacementSmartSimMotionSolver::solve() // size 0. Size 0 data cannot be written into the SmartRedis database. if (patch.size() == 0) { + // DEBUG INFO //Pout << "Skipping " << patch.name() << " with points size " // << patchPoints.size() << " and displacements size " // << patchDisplacementData.size() << endl; continue; } + // DEBUG INFO //Pout << "Sending " << patch.name() // << "points size " << patchPoints.size() << endl // << " displacements size " << patchDisplacementData.size() << endl @@ -243,16 +246,14 @@ void Foam::displacementSmartSimMotionSolver::solve() newDisplacements.boundaryFieldRef().evaluate(); pointDisplacement_.internalFieldRef() = newDisplacements.internalField(); pointDisplacement_.boundaryFieldRef().evaluate(); - // TODO: debugging - newDisplacements.write(); - // - } // At the end of the simulation, have MPI rank 0 notify the python // client via SmartRedis that the simulation has completed by writing // an end_time_index tensor to SmartRedis. const auto& runTime = fvMesh_.time(); - if ((Pstream::myProcNo() == 0) && (runTime.timeIndex() == 20)) + if ((Pstream::myProcNo() == 0) && + (runTime.timeOutputValue() >= runTime.endTime().value())) { std::vector end_time_vec {double(runTime.timeIndex())}; Info << "Seting end time flag : " << end_time_vec[0] << endl;