void observeCompletedTimeStep(const Rythmos::StepperBase<double> &stepper,
				  const Rythmos::StepControlInfo<double> &stepCtrlInfo,
				  const int timeStepIter)
    { 
      Teuchos::RCP<const Thyra::VectorBase<double> > solution = stepper.getStepStatus().solution;
      
      // initialize the assembly container
      panzer::AssemblyEngineInArgs ae_inargs;
      ae_inargs.container_ = m_lof->buildLinearObjContainer();
      ae_inargs.ghostedContainer_ = m_lof->buildGhostedLinearObjContainer();
      ae_inargs.alpha = 0.0;
      ae_inargs.beta = 1.0;
      ae_inargs.evaluate_transient_terms = false;

      // initialize the ghosted container
      m_lof->initializeGhostedContainer(panzer::LinearObjContainer::X,*ae_inargs.ghostedContainer_);

      {
         // initialize the x vector
         const Teuchos::RCP<panzer::ThyraObjContainer<double> > thyraContainer
            = Teuchos::rcp_dynamic_cast<panzer::ThyraObjContainer<double> >(ae_inargs.container_,true);
         thyraContainer->set_x_th(Teuchos::rcp_const_cast<Thyra::VectorBase<double> >(solution));
      }

      m_response_library->addResponsesToInArgs<panzer::Traits::Residual>(ae_inargs);
      m_response_library->evaluate<panzer::Traits::Residual>(ae_inargs);
      
      m_mesh->writeToExodus(stepper.getStepStatus().time);
    }
コード例 #2
0
void RythmosSnapshotCollectionObserver::observeTimeStep(
    const Rythmos::StepperBase<double> &stepper) {
  const Rythmos::StepStatus<double> stepStatus = stepper.getStepStatus();

  const Teuchos::RCP<const Thyra::VectorBase<double> > stepperSolution = stepStatus.solution;
  const Teuchos::RCP<const Thyra::VectorBase<double> > stepperState = getRythmosState(stepperSolution);
  const Teuchos::RCP<const Thyra::VectorSpaceBase<double> > stateSpace = stepperState->space();
  const Teuchos::RCP<const Teuchos::Comm<Thyra::Ordinal> > stateSpaceComm = getComm(*stateSpace);

  const Teuchos::RCP<const Epetra_Comm> stateComm = Thyra::get_Epetra_Comm(*stateSpaceComm);
  const Teuchos::RCP<const Epetra_Map> stateMap = Thyra::get_Epetra_Map(*stateSpace, stateComm);
  const Teuchos::RCP<const Epetra_Vector> state = Thyra::get_Epetra_Vector(*stateMap, stepperState);

  const double stamp = stepStatus.time;

  snapshotCollector_.addVector(stamp, *state);
}