Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[meshMotion] bugfix: end-time check in mesh-motion solver #20

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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<double> end_time_vec {double(runTime.timeIndex())};
Info << "Seting end time flag : " << end_time_vec[0] << endl;
Expand Down
Loading