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

Remove unnecessary timestepPrecice_ #322

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions Adapter.C
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ void preciceAdapter::Adapter::initialize()

DEBUG(adapterInfo("Initializing preCICE data..."));
precice_->initialize();
timestepPrecice_ = precice_->getMaxTimeStepSize();
preciceInitialized_ = true;
ACCUMULATE_TIMER(timeInInitialize_);

Expand Down Expand Up @@ -587,7 +586,6 @@ void preciceAdapter::Adapter::advance()

SETUP_TIMER();
precice_->advance(timestepSolver_);
timestepPrecice_ = precice_->getMaxTimeStepSize();
ACCUMULATE_TIMER(timeInAdvance_);

return;
Expand Down Expand Up @@ -652,7 +650,7 @@ void preciceAdapter::Adapter::adjustSolverTimeStepAndReadData()
the same timestep as the one determined by preCICE.
*/
double tolerance = 1e-14;
if (timestepPrecice_ - timestepSolverDetermined > tolerance)
if (precice_->getMaxTimeStepSize() - timestepSolverDetermined > tolerance)
{
// Add a bool 'subCycling = true' which is checked in the storeMeshPoints() function.
adapterInfo(
Expand All @@ -668,24 +666,24 @@ void preciceAdapter::Adapter::adjustSolverTimeStepAndReadData()
"warning");
}
}
else if (timestepSolverDetermined - timestepPrecice_ > tolerance)
else if (timestepSolverDetermined - precice_->getMaxTimeStepSize() > tolerance)
{
// In the last time-step, we adjust to dt = 0, but we don't need to trigger the warning here
if (precice_->isCouplingOngoing())
{
adapterInfo(
"The solver's timestep cannot be larger than the coupling timestep."
" Adjusting from "
+ std::to_string(timestepSolverDetermined) + " to " + std::to_string(timestepPrecice_),
+ std::to_string(timestepSolverDetermined) + " to " + std::to_string(precice_->getMaxTimeStepSize()),
"warning");
}
timestepSolver_ = timestepPrecice_;
timestepSolver_ = precice_->getMaxTimeStepSize();
}
else
{
DEBUG(adapterInfo("The solver's timestep is the same as the "
"coupling timestep."));
timestepSolver_ = timestepPrecice_;
timestepSolver_ = precice_->getMaxTimeStepSize();
}

// Update the solver's timestep (but don't trigger the adjustDeltaT(),
Expand Down
3 changes: 0 additions & 3 deletions Adapter.H
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ private:

// Timesteps

//- Timestep dictated by preCICE
double timestepPrecice_;

//- Timestep used by the solver
double timestepSolver_;

Expand Down
Loading