Skip to content

Commit 413c0d2

Browse files
authored
Merge pull request #20 from OFDataCommittee/hotfix
[meshMotion] bugfix: end-time check in mesh-motion solver
2 parents 34344cf + 84576f5 commit 413c0d2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/displacementSmartSimMotionSolver/displacementSmartSimMotionSolver.C

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ void Foam::displacementSmartSimMotionSolver::solve()
130130
if ((meshBoundary[patchI].type() == "empty") ||
131131
(meshBoundary[patchI].type() == "processor"))
132132
{
133+
// DEBUG INFO
133134
//Pout << "Skipping " << meshBoundary[patchI].name() << ", "
134135
// << meshBoundary[patchI].type() << endl;
135136
continue;
@@ -149,12 +150,14 @@ void Foam::displacementSmartSimMotionSolver::solve()
149150
// size 0. Size 0 data cannot be written into the SmartRedis database.
150151
if (patch.size() == 0)
151152
{
153+
// DEBUG INFO
152154
//Pout << "Skipping " << patch.name() << " with points size "
153155
// << patchPoints.size() << " and displacements size "
154156
// << patchDisplacementData.size() << endl;
155157
continue;
156158
}
157159

160+
// DEBUG INFO
158161
//Pout << "Sending " << patch.name()
159162
// << "points size " << patchPoints.size() << endl
160163
// << " displacements size " << patchDisplacementData.size() << endl
@@ -243,16 +246,14 @@ void Foam::displacementSmartSimMotionSolver::solve()
243246
newDisplacements.boundaryFieldRef().evaluate();
244247
pointDisplacement_.internalFieldRef() = newDisplacements.internalField();
245248
pointDisplacement_.boundaryFieldRef().evaluate();
246-
// TODO: debugging
247-
newDisplacements.write();
248-
// -
249249
}
250250

251251
// At the end of the simulation, have MPI rank 0 notify the python
252252
// client via SmartRedis that the simulation has completed by writing
253253
// an end_time_index tensor to SmartRedis.
254254
const auto& runTime = fvMesh_.time();
255-
if ((Pstream::myProcNo() == 0) && (runTime.timeIndex() == 20))
255+
if ((Pstream::myProcNo() == 0) &&
256+
(runTime.timeOutputValue() >= runTime.endTime().value()))
256257
{
257258
std::vector<double> end_time_vec {double(runTime.timeIndex())};
258259
Info << "Seting end time flag : " << end_time_vec[0] << endl;

0 commit comments

Comments
 (0)