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

Tempus: (fix) output integrator info at interval specified #2168

Merged
merged 1 commit into from
Jan 19, 2018
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
5 changes: 0 additions & 5 deletions packages/tempus/src/Tempus_IntegratorBasic_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,6 @@ void IntegratorBasic<Scalar>::acceptTimeStep()
csmd->setNFailures(std::max(csmd->getNFailures()-1,0));
csmd->setNConsecutiveFailures(0);

if ((csmd->getOutputScreen() == true) or
(csmd->getOutput() == true) or
(csmd->getTime() == timeStepControl_->getFinalTime())) {
}

// Output and screen output
if (csmd->getOutput() == true) {
// Dump solution!
Expand Down
36 changes: 21 additions & 15 deletions packages/tempus/src/Tempus_IntegratorObserverBasic_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,27 @@ observeAcceptedTimeStep(const Integrator<Scalar>& integrator){
RCP<SolutionStateMetaData<Scalar> > csmd =
integrator.getSolutionHistory()->getCurrentState()->getMetaData();

const Scalar steppertime = integrator.getStepperTimer()->totalElapsedTime();
const Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
Teuchos::OSTab ostab(out,0,"ScreenOutput");
*out<<std::scientific<<std::setw( 6)<<std::setprecision(3)<<csmd->getIStep()
<<std::setw(11)<<std::setprecision(3)<<csmd->getTime()
<<std::setw(11)<<std::setprecision(3)<<csmd->getDt()
<<std::setw(11)<<std::setprecision(3)<<csmd->getErrorAbs()
<<std::setw(11)<<std::setprecision(3)<<csmd->getErrorRel()
<<std::fixed <<std::setw( 7)<<std::setprecision(1)<<csmd->getOrder()
<<std::scientific<<std::setw( 7)<<std::setprecision(3)<<csmd->getNFailures()
<<std::setw(11)<<std::setprecision(3)<<steppertime
<<std::endl;

// reset the stepper timer
integrator.getStepperTimer()->reset();
if ((csmd->getOutputScreen() == true) or
(csmd->getOutput() == true) or
(csmd->getTime() == integrator.getTimeStepControl()->getFinalTime())) {

const Scalar steppertime = integrator.getStepperTimer()->totalElapsedTime();
// reset the stepper timer
integrator.getStepperTimer()->reset();

const Teuchos::RCP<Teuchos::FancyOStream> out = integrator.getOStream();
Teuchos::OSTab ostab(out,0,"ScreenOutput");
*out<<std::scientific<<std::setw( 6)<<std::setprecision(3)<<csmd->getIStep()
<<std::setw(11)<<std::setprecision(3)<<csmd->getTime()
<<std::setw(11)<<std::setprecision(3)<<csmd->getDt()
<<std::setw(11)<<std::setprecision(3)<<csmd->getErrorAbs()
<<std::setw(11)<<std::setprecision(3)<<csmd->getErrorRel()
<<std::fixed <<std::setw( 7)<<std::setprecision(1)<<csmd->getOrder()
<<std::scientific<<std::setw( 7)<<std::setprecision(3)<<csmd->getNFailures()
<<std::setw(11)<<std::setprecision(3)<<steppertime
<<std::endl;
}

}

template<class Scalar>
Expand Down